mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Update MenuButton.Avalonia.cs
This commit is contained in:
parent
218071faea
commit
be48c45e91
|
|
@ -17,25 +17,18 @@ namespace MapControl
|
||||||
{
|
{
|
||||||
internal static readonly FontFamily SymbolFont = new("Segoe MDL2 Assets");
|
internal static readonly FontFamily SymbolFont = new("Segoe MDL2 Assets");
|
||||||
|
|
||||||
private readonly StackPanel header;
|
private readonly TextBlock icon = new()
|
||||||
private readonly TextBlock icon;
|
{
|
||||||
|
FontFamily = SymbolFont,
|
||||||
|
FontWeight = FontWeight.Black,
|
||||||
|
VerticalAlignment = Avalonia.Layout.VerticalAlignment.Center,
|
||||||
|
};
|
||||||
|
|
||||||
public ToggleMenuFlyoutItem(string text, object item, EventHandler<RoutedEventArgs> click)
|
public ToggleMenuFlyoutItem(string text, object item, EventHandler<RoutedEventArgs> click)
|
||||||
{
|
{
|
||||||
icon = new TextBlock
|
Icon = icon;
|
||||||
{
|
Header = text;
|
||||||
FontFamily = SymbolFont,
|
|
||||||
Width = 20,
|
|
||||||
VerticalAlignment = Avalonia.Layout.VerticalAlignment.Center
|
|
||||||
};
|
|
||||||
|
|
||||||
header = new StackPanel { Orientation = Avalonia.Layout.Orientation.Horizontal };
|
|
||||||
header.Children.Add(icon);
|
|
||||||
header.Children.Add(new TextBlock { Text = text });
|
|
||||||
|
|
||||||
Header = header;
|
|
||||||
Tag = item;
|
Tag = item;
|
||||||
|
|
||||||
Click += click;
|
Click += click;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue