Files
LehrerApp/LehrerApp.Desktop/Views/NavButton.axaml
2026-03-29 23:47:31 +02:00

39 lines
1.5 KiB
XML

<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="clr-namespace:LehrerApp.Desktop.ViewModels"
x:Class="LehrerApp.Desktop.Views.NavButton">
<Button Command="{Binding Command, RelativeSource={RelativeSource AncestorType=UserControl}}"
CommandParameter="{Binding CommandParameter, RelativeSource={RelativeSource AncestorType=UserControl}}"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Left"
Padding="10,8"
CornerRadius="6"
Background="Transparent">
<Grid ColumnDefinitions="24,*">
<TextBlock Grid.Column="0"
Text="{Binding Icon, RelativeSource={RelativeSource AncestorType=UserControl}}"
FontFamily="Segoe MDL2 Assets"
FontSize="14"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Opacity="0.7"/>
<TextBlock Grid.Column="1"
Text="{Binding Label, RelativeSource={RelativeSource AncestorType=UserControl}}"
FontSize="13"
VerticalAlignment="Center"
Margin="8,0,0,0"/>
</Grid>
<Button.Styles>
<Style Selector="Button:pointerover /template/ ContentPresenter">
<Setter Property="Background"
Value="{DynamicResource SystemControlBackgroundListLowBrush}"/>
</Style>
</Button.Styles>
</Button>
</UserControl>