Skip to content

Feature/maintenance #162

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,8 @@ dotnet_diagnostic.MA0091.severity = none # Sender should be 'this' for
dotnet_diagnostic.MA0131.severity = none # ArgumentNullException.ThrowIfNull should not be used with non-nullable types

dotnet_diagnostic.SA1010.severity = none # Opening square brackets must be spaced correctly
dotnet_diagnostic.SA1311.severity = none # Static readonly fields must begin with upper case letter
dotnet_diagnostic.IDE1006.severity = none # Static readonly fields must begin with upper case letter

dotnet_diagnostic.S107.severity = none # Methods should not have too many parameters
dotnet_diagnostic.S1144.severity = none # Remove the unused internal class
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This is a base libraries for building WPF application with the MVVM design patte
| Nuget package | Description | Dependencies |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------|----------------------------------------------|
| [![NuGet Version](https://img.shields.io/nuget/v/Atc.Wpf.svg?label=Atc.Wpf&logo=nuget&style=for-the-badge)](https://www.nuget.org/packages/Atc.Wpf) | Base Controls, ValueConverters, Extensions etc. | <ul><li>Atc</li><li>Atc.XamlToolkit</li><li>Atc.XamlToolkit.Wpf</li></ul> |
| [![NuGet Version](https://img.shields.io/nuget/v/Atc.Wpf.Controls.svg?label=Atc.Wpf.Controls&logo=nuget&style=for-the-badge)](https://www.nuget.org/packages/Atc.Wpf.Controls) | Miscellaneous UI Controls | <ul><li>Atc.Wpf</li><li>Atc.Wpf.Theming</li><li>Atc.XamlToolkit</li><li>Atc.XamlToolkit.Wpf</li></ul> |
| [![NuGet Version](https://img.shields.io/nuget/v/Atc.Wpf.Controls.svg?label=Atc.Wpf.Controls&logo=nuget&style=for-the-badge)](https://www.nuget.org/packages/Atc.Wpf.Controls) | Miscellaneous UI Controls | <ul><li>Atc.Wpf</li><li>Atc.Wpf.FontIcons</li><li>Atc.Wpf.Theming</li><li>Atc.XamlToolkit</li><li>Atc.XamlToolkit.Wpf</li></ul> |
| [![NuGet Version](https://img.shields.io/nuget/v/Atc.Wpf.Controls.Sample.svg?label=Atc.Wpf.Controls.Sample&logo=nuget&style=for-the-badge)](https://www.nuget.org/packages/Atc.Wpf.Controls.Sample) | Controls for creating WPF sample apps | <ul><li>Atc.Wpf</li><li>Atc.Wpf.Theming</li><li>Atc.Wpf.Controls</li></ul> |
| [![NuGet Version](https://img.shields.io/nuget/v/Atc.Wpf.FontIcons.svg?label=Atc.Wpf.FontIcons&logo=nuget&style=for-the-badge)](https://www.nuget.org/packages/Atc.Wpf.FontIcons) | Render Svg and Img resources based on fonts | <ul><li>Atc.Wpf</li></ul> |
| [![NuGet Version](https://img.shields.io/nuget/v/Atc.Wpf.Theming.svg?label=Atc.Wpf.Theming&logo=nuget&style=for-the-badge)](https://www.nuget.org/packages/Atc.Wpf.Theming) | Theming for Light & Dark mode for WPF base controls | <ul><li>Atc.Wpf</li><li>Atc.XamlToolkit</li><li>Atc.XamlToolkit.Wpf</li></ul> |
Expand Down
4 changes: 2 additions & 2 deletions sample/Atc.Wpf.Sample/Atc.Wpf.Sample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@

<ItemGroup>
<PackageReference Include="Atc" Version="2.0.552" />
<PackageReference Include="Atc.XamlToolkit" Version="1.5.36" />
<PackageReference Include="Atc.XamlToolkit.Wpf" Version="1.5.36" />
<PackageReference Include="Atc.XamlToolkit" Version="1.5.42" />
<PackageReference Include="Atc.XamlToolkit.Wpf" Version="1.5.42" />
<PackageReference Include="ControlzEx" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.4" />
<PackageReference Include="Microsoft.Extensions.Options.DataAnnotations" Version="9.0.4" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@
Orientation="Horizontal"
Spacing="10">
<atc:ImageButton
HorizontalContentAlignment="Left"
Content="Hello"
ImageBorderSpacing="5"
ImageContentSpacing="10"
ImageSource="/Assets/ok.png"
IsBusy="{Binding ElementName=CbIsBusy, Path=IsChecked}" />
<atc:ImageButton
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<UserControl
x:Class="Atc.Wpf.Sample.SamplesWpfTheming.InputButton.ImageToggledButton"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:atc="https://github.com/atc-net/atc-wpf/tree/main/schemas"
xmlns:atcValueConverters="https://github.com/atc-net/atc-wpf/tree/main/schemas/value-converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:fontIcons="clr-namespace:Atc.Wpf.FontIcons;assembly=Atc.Wpf.FontIcons"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">

<atc:AutoGrid Columns="*" Rows="Auto,*">

<GroupBox
Margin="0,0,0,10"
Padding="10"
Header="Features">

<StackPanel>
<atc:LabelCheckBox
x:Name="CbIsBusy"
HideAreas="All"
LabelText="IsBusy" />

<atc:LabelToggleSwitch
x:Name="CbIsPrimary"
HideAreas="All"
LabelText="State"
OffText="Secondary"
OnText="Primary" />
</StackPanel>

</GroupBox>

<GroupBox Header="Usage">
<ScrollViewer>
<atc:GridEx Columns="*,10,*" ShowGridLines="True">
<atc:UniformSpacingPanel
Grid.Column="0"
Margin="10"
Orientation="Vertical"
Spacing="10">

<atc:UniformSpacingPanel
ItemWidth="100"
Orientation="Horizontal"
Spacing="10">

<atc:UniformSpacingPanel Orientation="Vertical" Spacing="10">

<atc:ImageToggledButton
HorizontalContentAlignment="Left"
ImageBorderSpacing="5"
ImageContentSpacing="10"
IsBusy="{Binding ElementName=CbIsBusy, Path=IsChecked}"
IsToggled="{Binding ElementName=CbIsPrimary, Path=IsOn}"
OffContent="State Off"
OffImageSource="/Assets/error.png"
OnContent="State On"
OnImageSource="/Assets/ok.png" />

<atc:ImageToggledButton
IsBusy="{Binding ElementName=CbIsBusy, Path=IsChecked}"
IsToggled="{Binding ElementName=CbIsPrimary, Path=IsOn}"
OffContent="Login"
OffSvgImageSource="/Atc.Wpf.Sample;component/Assets/eggeaster.svg"
OnContent="Logout"
OnSvgImageSource="/Atc.Wpf.Sample;component/Assets/a.svg" />

</atc:UniformSpacingPanel>

</atc:UniformSpacingPanel>

</atc:UniformSpacingPanel>
<atc:UniformSpacingPanel
Grid.Column="2"
Margin="10"
Orientation="Vertical"
Spacing="10">

<atc:UniformSpacingPanel
ItemWidth="100"
Orientation="Horizontal"
Spacing="10">

<atc:UniformSpacingPanel Orientation="Vertical" Spacing="10">

<atc:ImageToggledButton
IsBusy="{Binding Path=IsBusy}"
IsToggled="{Binding Path=IsConnected}"
OffCommand="{Binding Path=ConnectCommand}"
OffContent="Login"
OffImageSource="{Binding Source={x:Static fontIcons:FontMaterialDesignType.Login}, Converter={x:Static atcValueConverters:FontIconImageSourceValueConverter.Instance}, ConverterParameter={StaticResource AtcApps.Brushes.ThemeForeground}}"
OnCommand="{Binding Path=DisconnectCommand}"
OnContent="Logout"
OnImageSource="{Binding Source={x:Static fontIcons:FontMaterialDesignType.Logout}, Converter={x:Static atcValueConverters:FontIconImageSourceValueConverter.Instance}, ConverterParameter={StaticResource AtcApps.Brushes.Accent}}" />

</atc:UniformSpacingPanel>

</atc:UniformSpacingPanel>

</atc:UniformSpacingPanel>
</atc:GridEx>
</ScrollViewer>
</GroupBox>
</atc:AutoGrid>

</UserControl>
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
namespace Atc.Wpf.Sample.SamplesWpfTheming.InputButton;

public partial class ImageToggledButton
{
public ImageToggledButton()
{
InitializeComponent();

DataContext = this;
}

[DependencyProperty]
private bool isBusy;

[DependencyProperty]
private bool isConnected;

[RelayCommand]
private async Task Connect()
{
IsBusy = true;

await Task
.Delay(2_000)
.ConfigureAwait(false);

await Application.Current.Dispatcher
.InvokeAsyncIfRequired(() =>
{
IsConnected = true;
IsBusy = false;
})
.ConfigureAwait(false);
}

[RelayCommand]
private async Task Disconnect()
{
IsBusy = true;

await Task
.Delay(500)
.ConfigureAwait(false);

await Application.Current.Dispatcher
.InvokeAsyncIfRequired(() =>
{
IsConnected = false;
IsBusy = false;
})
.ConfigureAwait(false);
}
}
4 changes: 4 additions & 0 deletions sample/Atc.Wpf.Sample/SamplesWpfThemingTreeView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
Header="ImageButton"
IsExpanded="True"
SamplePath="InputButton.ImageButtonView" />
<sample:SampleTreeViewItem
Header="ImageToggledButton"
IsExpanded="True"
SamplePath="InputButton.ImageToggledButton" />
<TreeViewItem
Header="ToggleButton"
IsEnabled="False"
Expand Down
4 changes: 2 additions & 2 deletions src/Atc.Wpf.Controls/Atc.Wpf.Controls.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@

<ItemGroup>
<PackageReference Include="Atc" Version="2.0.552" />
<PackageReference Include="Atc.XamlToolkit" Version="1.5.36" />
<PackageReference Include="Atc.XamlToolkit.Wpf" Version="1.5.36" />
<PackageReference Include="Atc.XamlToolkit" Version="1.5.42" />
<PackageReference Include="Atc.XamlToolkit.Wpf" Version="1.5.42" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

Expand Down
19 changes: 7 additions & 12 deletions src/Atc.Wpf.Controls/BaseControls/ClockPanelPicker.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// ReSharper disable InconsistentNaming
namespace Atc.Wpf.Controls.BaseControls;

public partial class ClockPanelPicker : INotifyPropertyChanged
Expand All @@ -9,19 +10,12 @@ public partial class ClockPanelPicker : INotifyPropertyChanged

public event PropertyChangedEventHandler? PropertyChanged;

public static readonly RoutedEvent SelectedClockChangedEvent = EventManager.RegisterRoutedEvent(
nameof(SelectedClockChanged),
[RoutedEvent(
RoutingStrategy.Direct,
typeof(EventHandler<RoutedEventArgs>),
typeof(ClockPanelPicker));
HandlerType = typeof(EventHandler<RoutedEventArgs>))]
private static readonly RoutedEvent selectedClockChanged;

public event EventHandler<RoutedEventArgs> SelectedClockChanged
{
add => AddHandler(SelectedClockChangedEvent, value);
remove => RemoveHandler(SelectedClockChangedEvent, value);
}

[DependencyProperty(DefaultValue = "default(DateTime?)")]
[DependencyProperty]
private DateTime? selectedDateTime;

public ClockPanelPicker()
Expand All @@ -43,7 +37,8 @@ public ClockPanelPicker()
SelectedKeyMinute = "0";
}

protected virtual void OnPropertyChanged([CallerMemberName] string? propertyName = null)
protected virtual void OnPropertyChanged(
[CallerMemberName] string? propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
Expand Down
4 changes: 2 additions & 2 deletions src/Atc.Wpf.Controls/BaseControls/ColorPicker.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ public partial class ColorPicker
private RenderColorIndicatorType renderColorIndicatorType;

[DependencyProperty(
DefaultValue = "Black",
DefaultValue = nameof(Brushes.Black),
PropertyChangedCallback = nameof(OnColorValueChanged))]
private Color? colorValue;

[DependencyProperty(
DefaultValue = "Black",
DefaultValue = nameof(Brushes.Black),
PropertyChangedCallback = nameof(OnBrushValueChanged))]
private SolidColorBrush? brushValue;

Expand Down
Loading
Loading