Updated Avalonia version

This commit is contained in:
ClemensFischer 2024-07-22 19:58:42 +02:00
parent a5e83db79c
commit 8e24a2d2c5
6 changed files with 15 additions and 16 deletions

View file

@ -15,6 +15,6 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="11.0.11" />
<PackageReference Include="Avalonia" Version="11.1.0" />
</ItemGroup>
</Project>

View file

@ -15,11 +15,10 @@ namespace MapControl
{
public class ToggleMenuFlyoutItem : MenuItem
{
internal static readonly FontFamily SymbolFont = new FontFamily("Segoe MDL2 Assets");
internal static readonly FontFamily SymbolFont = new("Segoe MDL2 Assets");
private readonly StackPanel header;
private readonly TextBlock icon;
private bool isChecked;
public ToggleMenuFlyoutItem(string text, object item, EventHandler<RoutedEventArgs> click)
{
@ -42,13 +41,13 @@ namespace MapControl
protected override Type StyleKeyOverride => typeof(MenuItem);
public bool IsChecked
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs args)
{
get => isChecked;
set
base.OnPropertyChanged(args);
if (args.Property == IsCheckedProperty)
{
isChecked = value;
icon.Text = isChecked ? "\uE73E" : ""; // CheckMark
icon.Text = (bool)args.NewValue ? "\uE73E" : ""; // CheckMark
}
}
}