83 lines
2.6 KiB
XML
83 lines
2.6 KiB
XML
<UserControl
|
|
x:Class="Store.Management.Views.LeftNavView"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:f="Store.Management.Framework"
|
|
xmlns:local="clr-namespace:Store.Management.Views"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:vm="clr-namespace:Store.Management.ViewModels"
|
|
xmlns:wpf="MAX.WPF"
|
|
d:Background="White"
|
|
d:DataContext="{d:DesignInstance Type=vm:MainViewModel}"
|
|
d:DesignHeight="450"
|
|
d:Width="255"
|
|
Background="White"
|
|
mc:Ignorable="d">
|
|
<UserControl.Resources>
|
|
<wpf:CommandProxy x:Key="NavItemCommand" Command="{Binding NavItemCommand}" />
|
|
<Style
|
|
x:Key="NavItemButton"
|
|
BasedOn="{StaticResource ButtonCustom}"
|
|
TargetType="Button">
|
|
<Style.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter Property="Foreground" Value="{StaticResource PrimaryBrush}" />
|
|
</Trigger>
|
|
<DataTrigger Binding="{Binding IsSelected}" Value="True">
|
|
<Setter Property="Foreground" Value="{StaticResource PrimaryBrush}" />
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
<DataTemplate x:Key="NavItemTemplate" DataType="{x:Type vm:NavItemViewModel}">
|
|
<Button
|
|
HorizontalContentAlignment="Stretch"
|
|
Command="{StaticResource NavItemCommand}"
|
|
CommandParameter="{Binding}"
|
|
Style="{StaticResource NavItemButton}">
|
|
<Button.Content>
|
|
<Border
|
|
Height="45"
|
|
Background="Transparent"
|
|
BorderBrush="{StaticResource SecondaryBorderBrush}"
|
|
BorderThickness="0,0,0,1"
|
|
Cursor="Hand">
|
|
<Grid>
|
|
<StackPanel Orientation="Horizontal">
|
|
<f:IconText
|
|
Margin="10,0,10,0"
|
|
FontSize="18"
|
|
Icon="{Binding Icon}" />
|
|
<TextBlock
|
|
VerticalAlignment="Center"
|
|
FontSize="14"
|
|
Text="{Binding Title}" />
|
|
</StackPanel>
|
|
<Border
|
|
Margin="0,0,10,0"
|
|
HorizontalAlignment="Right"
|
|
Visibility="{Binding IsSelected, Converter={StaticResource Boolean2VisibilityConverter}}">
|
|
<f:IconText Icon="ChevronRight" />
|
|
</Border>
|
|
</Grid>
|
|
|
|
</Border>
|
|
</Button.Content>
|
|
</Button>
|
|
|
|
</DataTemplate>
|
|
</UserControl.Resources>
|
|
<ItemsControl
|
|
d:ItemsSource="{d:SampleData ItemCount=10}"
|
|
ItemTemplate="{StaticResource NavItemTemplate}"
|
|
ItemsSource="{Binding NavItems}">
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<wpf:SpacingStackPanel Orientation="Vertical" />
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
|
|
</ItemsControl>
|
|
|
|
</UserControl>
|