184 lines
9.7 KiB
XML
184 lines
9.7 KiB
XML
<Window
|
|
x:Class="OrpaonEMS.App.Views.MainWindow"
|
|
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:i="http://schemas.microsoft.com/xaml/behaviors"
|
|
xmlns:local="clr-namespace:OrpaonEMS.App.Views"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:md="http://materialdesigninxaml.net/winfx/xaml/themes"
|
|
xmlns:prism="http://prismlibrary.com/"
|
|
Title="MainWindow"
|
|
Width="1024"
|
|
Height="768"
|
|
prism:ViewModelLocator.AutoWireViewModel="True"
|
|
ResizeMode="NoResize"
|
|
WindowStartupLocation="CenterScreen"
|
|
WindowStyle="None"
|
|
mc:Ignorable="d">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="auto" />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
|
|
<md:ColorZone md:ElevationAssist.Elevation="Dp2" Mode="PrimaryMid">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="auto" />
|
|
<ColumnDefinition />
|
|
<ColumnDefinition Width="auto" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<StackPanel Margin="15" Orientation="Horizontal">
|
|
<TextBlock
|
|
Margin="5,0,5,0"
|
|
VerticalAlignment="Center"
|
|
FontSize="22"
|
|
FontWeight="Bold"
|
|
Text="大孚-EMS" />
|
|
</StackPanel>
|
|
|
|
<ListBox
|
|
x:Name="listBox"
|
|
Grid.Column="1"
|
|
ItemsSource="{Binding MenuService.MenuItems}"
|
|
SelectedIndex="{Binding SelectedIndex}">
|
|
<ListBox.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<StackPanel Orientation="Horizontal" />
|
|
</ItemsPanelTemplate>
|
|
</ListBox.ItemsPanel>
|
|
|
|
<ListBox.ItemContainerStyle>
|
|
<Style TargetType="ListBoxItem">
|
|
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
|
|
<Setter Property="Foreground" Value="White" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="ListBoxItem">
|
|
<Grid>
|
|
<Border x:Name="border" />
|
|
<Border x:Name="borderheader" Background="{TemplateBinding Background}" />
|
|
<ContentPresenter
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
|
TextBlock.Foreground="{TemplateBinding Foreground}" />
|
|
</Grid>
|
|
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsSelected" Value="true">
|
|
<Setter TargetName="borderheader" Property="Background" Value="#ffffff" />
|
|
<Setter TargetName="borderheader" Property="Opacity" Value="0.1" />
|
|
<Setter TargetName="border" Property="BorderBrush" Value="#ffffff" />
|
|
<Setter TargetName="border" Property="BorderThickness" Value="0,0,0,3" />
|
|
</Trigger>
|
|
<Trigger Property="IsMouseOver" Value="true">
|
|
<Setter TargetName="borderheader" Property="Background" Value="#ffffff" />
|
|
<Setter TargetName="borderheader" Property="Opacity" Value="0.1" />
|
|
<Setter TargetName="border" Property="BorderBrush" Value="#ffffff" />
|
|
<Setter TargetName="border" Property="BorderThickness" Value="0,0,0,3" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
</ListBox.ItemContainerStyle>
|
|
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<StackPanel Margin="10,5" Orientation="Horizontal">
|
|
<md:PackIcon VerticalAlignment="Center" Kind="{Binding Icon}" />
|
|
<!--<TextBlock
|
|
Margin="0,5"
|
|
FontFamily="../Assets/Fonts/#iconfont"
|
|
FontSize="10"
|
|
Text="{Binding Icon}" />-->
|
|
<TextBlock
|
|
Margin="3,3"
|
|
FontSize="16"
|
|
Text="{Binding Name}" />
|
|
</StackPanel>
|
|
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
|
|
<i:Interaction.Triggers>
|
|
<i:EventTrigger EventName="SelectionChanged">
|
|
<i:InvokeCommandAction Command="{Binding NavigateCommand}" CommandParameter="{Binding ElementName=listBox, Path=SelectedItem}" />
|
|
</i:EventTrigger>
|
|
</i:Interaction.Triggers>
|
|
</ListBox>
|
|
<StackPanel Grid.Column="2" VerticalAlignment="Center">
|
|
<TextBlock
|
|
Margin="5"
|
|
FontSize="20"
|
|
Text="{Binding CurrentTime, StringFormat={}{0:MM/dd HH:mm}}" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</md:ColorZone>
|
|
|
|
<md:DialogHost Grid.Row="1">
|
|
<!-- Content="{Binding ElementName=MainViewContentControl, Path=Content, Mode=TwoWay}" IsTopDrawerOpen="{Binding IsTopDrawerOpen}" -->
|
|
<md:DrawerHost Content="{Binding ElementName=MainViewContentControl, Path=Content, Mode=TwoWay}" IsTopDrawerOpen="{Binding IsTopDrawerOpen}">
|
|
<md:DrawerHost.TopDrawerContent>
|
|
<ItemsControl Padding="0,5,0,20" ItemsSource="{Binding MenuService.MenuItems[0].Items}">
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<WrapPanel />
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="auto" />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
|
|
<StackPanel Margin="15,10" Orientation="Horizontal">
|
|
<TextBlock
|
|
Margin="5,0"
|
|
VerticalAlignment="Center"
|
|
FontSize="14"
|
|
FontWeight="Bold"
|
|
Foreground="White"
|
|
Text="{Binding Name}" />
|
|
</StackPanel>
|
|
|
|
<ItemsControl
|
|
Grid.Row="1"
|
|
Margin="10,0"
|
|
VerticalAlignment="Top"
|
|
ItemsSource="{Binding Items}">
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<UniformGrid VerticalAlignment="Center" Columns="2" />
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<Button Height="40" Margin="5">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock Margin="10,5" Text="{Binding Name}" />
|
|
</StackPanel>
|
|
</Button>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</Grid>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</md:DrawerHost.TopDrawerContent>
|
|
</md:DrawerHost>
|
|
</md:DialogHost>
|
|
|
|
<ContentControl
|
|
x:Name="MainViewContentControl"
|
|
prism:RegionManager.RegionName="MainViewContentRegion"
|
|
Visibility="Collapsed" />
|
|
</Grid>
|
|
</Window>
|