mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-06 23:15:14 +00:00
Updated Avalonia version
This commit is contained in:
parent
a5e83db79c
commit
8e24a2d2c5
6 changed files with 15 additions and 16 deletions
|
|
@ -15,6 +15,6 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia" Version="11.0.11" />
|
||||
<PackageReference Include="Avalonia" Version="11.1.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue