<Window x:Class="MWS.Domain.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:UserControls="clr-namespace:MWSDomain.Common.UserControls"
        Height="1030" Width="1920"
        mc:Ignorable="d" ResizeMode="CanResizeWithGrip"   AllowsTransparency="True"
        Loaded="Window_Loaded"
        Title="MainWindow"  WindowStartupLocation="CenterScreen" WindowStyle="None" >
    <Window.Resources>
        <!--<cvt:Bool2VisibilityConverter x:Key="b2vCvt"/>-->
        <XmlDataProvider x:Key="mainMenuData" 
                         Source="Assets/Config/MenuData.xml" 
                         XPath="MenuData/MainMenu"></XmlDataProvider>
        <XmlDataProvider x:Key="subMenuData" 
                         Source="Assets/Config/MenuData.xml" 
                         XPath="MenuData/MainMenu[1]/SubMenu"></XmlDataProvider>

        <HierarchicalDataTemplate DataType="MainMenu" 
                                  ItemsSource="{Binding XPath=MainMenu}" >
            <StackPanel  Width="199" Margin="0,0,0,20" Height="50" Orientation="Horizontal" HorizontalAlignment="Left" Background="{Binding XPath=@Bg}" VerticalAlignment="Center" >
                <!--<StackPanel.Background>
                    <ImageBrush ImageSource="{Binding XPath=@Active}"></ImageBrush>

                </StackPanel.Background>
                <Image Source="{Binding XPath=@Icon}" Height="64" Width="64"  Margin="0,18,0,0"></Image>
                <TextBlock FontSize="24"  Foreground="{Binding XPath=@FontColor}" Text="{Binding XPath=@Name}" Block.TextAlignment="Center"></TextBlock>-->
                <Image Source="{Binding XPath=@Active}" Height="40" Width="20"></Image>
                <Image Source="{Binding XPath=@Icon}" Height="15" Margin="13,0,0,0"></Image>
                <TextBlock FontSize="20" Margin="13,0,0,0" VerticalAlignment="Center" Foreground="{Binding XPath=@FontColor}" Text="{Binding XPath=@Name}" ></TextBlock>
            </StackPanel>
        </HierarchicalDataTemplate>

        <HierarchicalDataTemplate DataType="SubMenu" ItemsSource="{Binding XPath=SubMenu}">
            <StackPanel  Width="146" Height="45" Margin="20,0,12,0" HorizontalAlignment="Center" Background="{Binding XPath=@Bg}" VerticalAlignment="Center" >

                <TextBlock  FontSize="20" Text="{Binding XPath=@Name}" Foreground="{Binding XPath=@FontColor}"  HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,10,0,0" />
            </StackPanel>
            <!--<StackPanel  Width="155" Height="56" Margin="0,0,12,0" HorizontalAlignment="Center" VerticalAlignment="Center" >
                <StackPanel.Background>
                    <ImageBrush ImageSource="{Binding XPath=@Bg}"></ImageBrush>
                </StackPanel.Background>
                <TextBlock  Text="{Binding XPath=@Name}" Foreground="{Binding XPath=@FontColor}"  Block.TextAlignment="Center" Margin="0,9,0,0" FontSize="28px"/>
            </StackPanel>-->
        </HierarchicalDataTemplate>
        <Style TargetType="MenuItem">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate  TargetType="{x:Type MenuItem}">
                        <Border x:Name="templateRoot" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
                            <Grid VerticalAlignment="Center">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <ContentPresenter x:Name="Icon" Content="{TemplateBinding Icon}" ContentSource="Icon" HorizontalAlignment="Center" Height="16" Margin="3" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center" Width="16"/>
                                <Path x:Name="GlyphPanel" Data="F1M10,1.2L4.7,9.1 4.5,9.1 0,5.2 1.3,3.5 4.3,6.1 8.3,0 10,1.2z" Fill="#FF212121" FlowDirection="LeftToRight" Margin="3" Visibility="Collapsed" VerticalAlignment="Center"/>
                                <ContentPresenter ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" Grid.Column="1" ContentStringFormat="{TemplateBinding HeaderStringFormat}" ContentSource="Header" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                            </Grid>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="Icon" Value="{x:Null}">
                                <Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
                            </Trigger>
                            <Trigger Property="IsChecked" Value="True">
                                <Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible"/>
                                <Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
                            </Trigger>
                            <Trigger Property="IsHighlighted" Value="True">
                                <Setter Property="Background" TargetName="templateRoot" Value="{x:Null}"/>
                                <Setter Property="BorderBrush" TargetName="templateRoot" Value="{x:Null}"/>
                                <Setter Property="Cursor" TargetName="templateRoot" Value="Hand"/>

                            </Trigger>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter Property="TextElement.Foreground" TargetName="templateRoot" Value="#FF707070"/>
                                <Setter Property="Fill" TargetName="GlyphPanel" Value="#FF707070"/>
                            </Trigger>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="IsHighlighted" Value="True"/>
                                    <Condition Property="IsEnabled" Value="False"/>
                                </MultiTrigger.Conditions>
                                <Setter Property="Background" TargetName="templateRoot" Value="#0A000000"/>
                                <Setter Property="BorderBrush" TargetName="templateRoot" Value="#21000000"/>
                            </MultiTrigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>

        </Style>
        <Style x:Key="FocusVisual">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <SolidColorBrush x:Key="Button.Static.Background" Color="#FFDDDDDD"/>
        <SolidColorBrush x:Key="Button.Static.Border" Color="#FF707070"/>
        <SolidColorBrush x:Key="Button.MouseOver.Background" Color="#FFBEE6FD"/>
        <SolidColorBrush x:Key="Button.MouseOver.Border" Color="#FF3C7FB1"/>
        <SolidColorBrush x:Key="Button.Pressed.Background" Color="#FFC4E5F6"/>
        <SolidColorBrush x:Key="Button.Pressed.Border" Color="#FF2C628B"/>
        <SolidColorBrush x:Key="Button.Disabled.Background" Color="#FFF4F4F4"/>
        <SolidColorBrush x:Key="Button.Disabled.Border" Color="#FFADB2B5"/>
        <SolidColorBrush x:Key="Button.Disabled.Foreground" Color="#FF838383"/>
        <Style x:Key="ButtonStyle1" TargetType="{x:Type Button}">
            <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
            <Setter Property="Background" Value="{StaticResource Button.Static.Background}"/>
            <Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}"/>
            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Padding" Value="1"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
                            <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsDefaulted" Value="true">
                                <Setter Property="BorderBrush" TargetName="border" Value="{x:Null}"/>
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter Property="Background" TargetName="border" Value="{x:Null}"/>
                                <Setter Property="BorderBrush" TargetName="border" Value="{x:Null}"/>
                                <Setter Property="Cursor" TargetName="border" Value="Hand"/>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="true">
                                <Setter Property="Background" TargetName="border" Value="{StaticResource Button.Pressed.Background}"/>
                                <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Pressed.Border}"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Background" TargetName="border" Value="{StaticResource Button.Disabled.Background}"/>
                                <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Disabled.Border}"/>
                                <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource Button.Disabled.Foreground}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>
    <materialDesign:DialogHost Identifier="RootDialog" >
        <materialDesign:DrawerHost >
            <Grid>
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="60"></RowDefinition>
                        <RowDefinition Height="85"></RowDefinition>
                        <RowDefinition Height="935"></RowDefinition>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="199"></ColumnDefinition>
                        <ColumnDefinition  Width="1720"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                </Grid>
                <Border BorderBrush="#071431" BorderThickness="1" />
                <Grid Grid.Row="0" Grid.ColumnSpan="2"  VerticalAlignment="Top" Name="Header">

                    <DockPanel>
                        <materialDesign:ColorZone materialDesign:ShadowAssist.ShadowDepth="Depth2" Name="Zone"
                                          Mode="Custom" Background="#253A57" DockPanel.Dock="Top">
                            <UniformGrid Columns="2">
                                <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                                    <!--<Image Source="/Assets/Images/logo.png" Height="60" />-->
                                    <Image Source="/Assets/Images/hdlogo.png" Height="60" />
                                    <TextBlock Margin="16,0,0,0" Text="恒达称重管理系统" FontSize="30"
                           FontFamily="SourceHanSansCN-Bold" 
                           FontWeight="Bold" Foreground="#C8DBFF" VerticalAlignment="Center"/>
                                </StackPanel>
                                <StackPanel Orientation="Horizontal"  HorizontalAlignment="Right">
                                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,45,0">
                                        <materialDesign:Chip  Width="380" IconBackground="#16253A" Background="#16253A"  IconForeground="#F2465F">
                                            <DockPanel Margin="0,0,8,0">
                                                <TextBlock  Foreground="#D1DDE6" HorizontalAlignment="Right" Text="当前班组："></TextBlock>
                                                <TextBlock x:Name="txtAlertMessage"  Foreground="#D1DDE6" HorizontalAlignment="Left"></TextBlock>
                                                <TextBlock x:Name="txtNowTime" Foreground="#D1DDE6" HorizontalAlignment="Right"></TextBlock>
                                            </DockPanel>
                                        </materialDesign:Chip>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" DockPanel.Dock="Right" HorizontalAlignment="Right" VerticalAlignment="Center">
                                        <UserControls:MainUserInfo Margin="0 0 55 0" />
                                    </StackPanel>
                                    <StackPanel Margin="0,0,0,0" Height="40" Width="50"  >
                                        <Button x:Name="btnClose" Click="btnClose_Click" Width="40" Height="40" BorderThickness="0" Background="Transparent" >
                                            <Image Source="/Assets/Images/signout.png" Width="24" Height="24"  Margin="-16,0,0,0"></Image>
                                        </Button>

                                    </StackPanel>
                                </StackPanel>
                            </UniformGrid>
                        </materialDesign:ColorZone>
                    </DockPanel>

                </Grid>
                <Grid Grid.Row="1" Grid.Column="0" Grid.RowSpan="2"   Margin="0,60,0,0" Width="200" HorizontalAlignment="Left">
                    <Grid.Background>
                        <LinearGradientBrush StartPoint="0,0">
                            <GradientStop Color="#1b2a39" Offset="0"/>
                            <!--<GradientStop Color="#1b2a39" Offset="0.5"/>-->
                            <GradientStop Color="#364b5b" Offset="1"/>
                        </LinearGradientBrush>
                    </Grid.Background>

                    <StackPanel  Orientation="Vertical"   HorizontalAlignment="Center" >
                        <StackPanel MenuItem.Click="StackPanel_Click" Margin="0,100,0,0"  Orientation="Vertical" >
                            <Menu x:Name="mainMenu"  ItemsSource="{Binding Source={StaticResource mainMenuData}}"  Background="{x:Null}">
                            </Menu>
                        </StackPanel>
                        <StackPanel Margin="0,100,0,57" VerticalAlignment="Bottom">
                            <Border BorderBrush="#8e9cac" BorderThickness="1" CornerRadius="10" Width="130"  Height="200">

                                <StackPanel Margin="0,20" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center" >
                                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                                        <TextBlock x:Name="txtTeamCount" FontSize="23" Foreground="#8e9cac" Margin="0,6" HorizontalAlignment="Center" Text="77.58"></TextBlock>
                                        <TextBlock  FontSize="23" Foreground="#8e9cac" Margin="0,6" HorizontalAlignment="Center" Text="t"></TextBlock>
                                    </StackPanel>
                                    
                                    <TextBlock FontSize="14" Foreground="#8e9cac" Margin="0,6" HorizontalAlignment="Center"> 当前班组累计</TextBlock>
                                    <Border BorderBrush="#8e9cac" Width="100" BorderThickness="1" Margin="0,6"></Border>
                                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                                        <TextBlock x:Name="txtDailyCount" FontSize="23" Foreground="#8e9cac" Margin="0,6" HorizontalAlignment="Center" Text="77.58"></TextBlock>
                                        <TextBlock  FontSize="23" Foreground="#8e9cac" Margin="0,6" HorizontalAlignment="Center" Text="t"></TextBlock>
                                    </StackPanel>
                                    <TextBlock FontSize="14" Foreground="#8e9cac" Margin="0,6" HorizontalAlignment="Center"> 今日全部累计</TextBlock>
                                </StackPanel>
                            </Border>
                        </StackPanel>

                    </StackPanel>

                </Grid>
                <Grid Grid.Row="1" Grid.Column="1" Background="#d1dde6" Margin="0,60,0,0" HorizontalAlignment="Right" VerticalAlignment="Top" Width="1720"  >

                    <StackPanel  Width="1720"  Orientation="Vertical">
                        <StackPanel Orientation="Horizontal" Name="subNavigation" MenuItem.Click="SubMemu_Click" Height="75" HorizontalAlignment="Left" VerticalAlignment="Center">
                            <Menu  Height="45" x:Name="subMenu" Background="{x:Null}" Margin="0,0,0,0" ItemsSource="{Binding }" >
                            </Menu>
                        </StackPanel>

                        <StackPanel  >
                            <Frame   x:Name="mainFrame"    Source="{x:Null}" NavigationUIVisibility="Hidden"/>
                        </StackPanel>

                    </StackPanel>

                    <!--<UserControls:MainTabControl />-->
                </Grid>

            </Grid>
        </materialDesign:DrawerHost>
    </materialDesign:DialogHost>
</Window>