HeaderMenuItem
This commit is contained in:
15
Pilz.UI.AvaloniaUI/Dialogs/HeaderMenuItem.axaml
Normal file
15
Pilz.UI.AvaloniaUI/Dialogs/HeaderMenuItem.axaml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<MenuItem xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||||
|
x:Class="Pilz.UI.AvaloniaUI.Dialogs.HeaderMenuItem"
|
||||||
|
x:Name="RootItem">
|
||||||
|
|
||||||
|
<MenuItem.Header>
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="3">
|
||||||
|
<ContentControl Content="{Binding #RootItem.Icon}"/>
|
||||||
|
<TextBlock x:Name="TextBlockHeader"/>
|
||||||
|
</StackPanel>
|
||||||
|
</MenuItem.Header>
|
||||||
|
</MenuItem>
|
||||||
24
Pilz.UI.AvaloniaUI/Dialogs/HeaderMenuItem.axaml.cs
Normal file
24
Pilz.UI.AvaloniaUI/Dialogs/HeaderMenuItem.axaml.cs
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
using Avalonia;
|
||||||
|
using Avalonia.Controls;
|
||||||
|
|
||||||
|
namespace Pilz.UI.AvaloniaUI.Dialogs;
|
||||||
|
|
||||||
|
public partial class HeaderMenuItem : MenuItem
|
||||||
|
{
|
||||||
|
public static readonly StyledProperty<string?> HeaderTextProperty = AvaloniaProperty.Register<HeaderMenuItem, string?>(nameof(HeaderText));
|
||||||
|
|
||||||
|
public string? HeaderText
|
||||||
|
{
|
||||||
|
get => GetValue(HeaderTextProperty);
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetValue(HeaderTextProperty, value);
|
||||||
|
TextBlockHeader.Text = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public HeaderMenuItem()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user