<hc:Window xmlns:View="clr-namespace:智慧物流软件系统"  x:Class="智慧物流软件系统.MainWindow2"
        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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:智慧物流软件系统"
        xmlns:hc="https://handyorg.github.io/handycontrol"
        xmlns:pi="https://github.com/ping9719/wpfex"
        xmlns:md="http://materialdesigninxaml.net/winfx/xaml/themes"
        mc:Ignorable="d"
        Title="{Binding Title}" NonClientAreaBackground="#FFDCEEFF" Height="800" Width="1280" Icon="/Resources/Logo.ico"
        Background="#FFDCEEFF" WindowStartupLocation="CenterScreen" Loaded="load">
    <!--标题栏-->
    <hc:Window.NonClientAreaContent>
        <StackPanel HorizontalAlignment="Right">
            <Menu Height="29" Background="#FFDCEEFF">
                <!--<MenuItem Height="29" Command="{Binding OpenUserCommand}" Visibility="{Binding IsLogin,Converter={StaticResource Boolean2VisibilityConverter}}">-->
                <MenuItem Height="29" Command="{Binding OpenUserCommand}">
                    <MenuItem.Header>
                        <TextBlock Text="{Binding LoginName,Source={x:Static local:UserInfoView.viewModel},TargetNullValue=登录}" Foreground="DimGray" Margin="-5,0"></TextBlock>
                    </MenuItem.Header>
                    <MenuItem.Icon>
                        <TextBlock Text="&#xe649;" FontSize="16" FontFamily="{StaticResource IconFont}"></TextBlock>
                    </MenuItem.Icon>
                </MenuItem>
                <!--<MenuItem Height="29" Width="35" Header="">
                    <MenuItem.Icon>
                        <TextBlock Text="&#xe62b;" FontSize="15" FontFamily="{StaticResource IconFont}"></TextBlock>
                    </MenuItem.Icon>
                    <MenuItem Width="120" Header="蓝色">
                        <MenuItem.Icon>
                            <TextBlock Text="&#xe604;" Foreground="Blue" FontSize="16" FontFamily="{StaticResource IconFont}"></TextBlock>
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Width="120" Header="紫色">
                        <MenuItem.Icon>
                            <TextBlock Text="&#xe604;" Foreground="Purple" FontSize="16" FontFamily="{StaticResource IconFont}"></TextBlock>
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Width="120" Header="黑夜">
                        <MenuItem.Icon>
                            <TextBlock Text="&#xe604;" Foreground="Black" FontSize="16" FontFamily="{StaticResource IconFont}"></TextBlock>
                        </MenuItem.Icon>
                    </MenuItem>
                </MenuItem>-->
                <MenuItem Height="29" Width="35" Header="">
                    <MenuItem.Icon>
                        <TextBlock Text="&#xe609;" FontSize="15" FontFamily="{StaticResource IconFont}"></TextBlock>
                    </MenuItem.Icon>
                    <MenuItem Width="120" Header="日志" Command="{Binding OpenLogCommand}">
                        <MenuItem.Icon>
                            <TextBlock Text="&#xe61d;" FontSize="16" FontFamily="{StaticResource IconFont}"></TextBlock>
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Width="120" Header="帮助" Command="{Binding OpenHelpCommand}">
                        <MenuItem.Icon>
                            <TextBlock Text="&#xe60b;" FontSize="16" FontFamily="{StaticResource IconFont}"></TextBlock>
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Width="120" Header="关于" Command="{Binding OpenWeCommand}">
                        <MenuItem.Icon>
                            <TextBlock Text="&#xe608;" FontSize="16" FontFamily="{StaticResource IconFont}"></TextBlock>
                        </MenuItem.Icon>
                    </MenuItem>
                </MenuItem>
            </Menu>
        </StackPanel>
    </hc:Window.NonClientAreaContent>
    <!--内容-->
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"></RowDefinition>
            <RowDefinition Height="auto"></RowDefinition>
        </Grid.RowDefinitions>
        <!--菜单、内容-->
        <Grid Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="auto"></ColumnDefinition>
                <ColumnDefinition Width="*"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <!--菜单-->
            <Border Margin="5,3" Style="{StaticResource BorderRegion}" Padding="0" BorderThickness="1">
                <hc:TransitioningContentControl TransitionMode="Left2Right">
                    <hc:SideMenu ExpandMode="ShowOne" SelectionChanged="menuSelect">
                        <!--内部资源样式-->
                        <hc:SideMenu.Resources>
                            <ResourceDictionary>
                                <Style TargetType="Image">
                                    <Setter Property="Width" Value="24"></Setter>
                                    <Setter Property="Height" Value="24"></Setter>
                                </Style>
                                <Style TargetType="TextBlock">
                                    <Setter Property="FontFamily" Value="{StaticResource IconFont}"></Setter>
                                    <Setter Property="FontSize" Value="22"></Setter>
                                    <Setter Property="TextAlignment" Value="Center"></Setter>
                                </Style>
                            </ResourceDictionary>
                        </hc:SideMenu.Resources>
                        <!--列表-->
                        <hc:SideMenuItem Header="主页" IsSelected="True" MinWidth="140">
                            <hc:SideMenuItem.Icon>
                                <Image Source="/Resources/主页.png"/>
                            </hc:SideMenuItem.Icon>
                            <hc:SideMenuItem Header="主页" Tag="主页">
                                <hc:SideMenuItem.Icon>
                                    <TextBlock Text="&#xe603;"/>
                                </hc:SideMenuItem.Icon>
                            </hc:SideMenuItem>
                        </hc:SideMenuItem>
                        <hc:SideMenuItem Header="入库"  Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.调试},Converter={StaticResource AuthVisConverter}}">
                            <hc:SideMenuItem.Icon>
                                <Image Source="/Resources/入库.png"/>
                            </hc:SideMenuItem.Icon>
                            <hc:SideMenuItem Header="物料入库" Tag="物料入库">
                                <hc:SideMenuItem.Icon>
                                    <TextBlock Text="&#xe681;"/>
                                </hc:SideMenuItem.Icon>
                            </hc:SideMenuItem>
                        </hc:SideMenuItem>

                        <hc:SideMenuItem Header="出库" >
                            <hc:SideMenuItem.Icon>
                                <Image Source="/Resources/出库.png"/>
                            </hc:SideMenuItem.Icon>
                            <hc:SideMenuItem Header="出库单据" Tag="出库单据">
                                <hc:SideMenuItem.Icon>
                                    <TextBlock Text="&#xe6e2;"/>
                                </hc:SideMenuItem.Icon>
                            </hc:SideMenuItem>
                            <hc:SideMenuItem Header="物料出库" Tag="物料出库">
                                <hc:SideMenuItem.Icon>
                                    <TextBlock Text="&#xe67d;"/>
                                </hc:SideMenuItem.Icon>
                            </hc:SideMenuItem>
                        </hc:SideMenuItem>

                        <hc:SideMenuItem Header="盘点" >
                            <hc:SideMenuItem.Icon>
                                <Image Source="/Resources/盘点.png"/>
                            </hc:SideMenuItem.Icon>
                            <hc:SideMenuItem Header="盘点单据" Tag="盘点单据">
                                <hc:SideMenuItem.Icon>
                                    <TextBlock Text="&#xe65f;"/>
                                </hc:SideMenuItem.Icon>
                            </hc:SideMenuItem>
                            <hc:SideMenuItem Header="物料盘点" Tag="物料盘点">
                                <hc:SideMenuItem.Icon>
                                    <TextBlock Text="&#xe65e;"/>
                                </hc:SideMenuItem.Icon>
                            </hc:SideMenuItem>
                        </hc:SideMenuItem>

                        <hc:SideMenuItem Header="查询" Tag="查询" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.权限},Converter={StaticResource AuthVisConverter}}">
                            <hc:SideMenuItem.Icon>
                                <Image Source="/Resources/查询.png"/>
                            </hc:SideMenuItem.Icon>
                            <hc:SideMenuItem Header="库存查询" Tag="库存查询" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.调试},Converter={StaticResource AuthVisConverter}}">
                                <hc:SideMenuItem.Icon>
                                    <TextBlock Text="&#xe609;"/>
                                </hc:SideMenuItem.Icon>
                            </hc:SideMenuItem>
                            <hc:SideMenuItem Header="出入记录" Tag="出入记录" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.调试},Converter={StaticResource AuthVisConverter}}">
                                <hc:SideMenuItem.Icon>
                                    <TextBlock Text="&#xe60b;"/>
                                </hc:SideMenuItem.Icon>
                            </hc:SideMenuItem>
                        </hc:SideMenuItem>

                        <hc:SideMenuItem Header="库位" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.权限},Converter={StaticResource AuthVisConverter}}">
                            <hc:SideMenuItem.Icon>
                                <Image Source="/Resources/货架.png"/>
                            </hc:SideMenuItem.Icon>
                            <hc:SideMenuItem Header="货架管理" Tag="货架管理" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.调试},Converter={StaticResource AuthVisConverter}}">
                                <hc:SideMenuItem.Icon>
                                    <TextBlock Text="&#xe608;"/>
                                </hc:SideMenuItem.Icon>
                            </hc:SideMenuItem>
                            <hc:SideMenuItem Header="模组管理" Tag="模组管理" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.调试},Converter={StaticResource AuthVisConverter}}">
                                <hc:SideMenuItem.Icon>
                                    <TextBlock Text="&#xe6f1;"/>
                                </hc:SideMenuItem.Icon>
                            </hc:SideMenuItem>
                            <hc:SideMenuItem Header="库位管理" Tag="库位管理" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.调试},Converter={StaticResource AuthVisConverter}}">
                                <hc:SideMenuItem.Icon>
                                    <TextBlock Text="&#xe6d5;"/>
                                </hc:SideMenuItem.Icon>
                            </hc:SideMenuItem>
                        </hc:SideMenuItem>

                        <hc:SideMenuItem Header="物料" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.权限},Converter={StaticResource AuthVisConverter}}">
                            <hc:SideMenuItem.Icon>
                                <Image Source="/Resources/物料.png"/>
                            </hc:SideMenuItem.Icon>

                            <hc:SideMenuItem Header="物料维护" Tag="物料维护" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.调试},Converter={StaticResource AuthVisConverter}}">
                                <hc:SideMenuItem.Icon>
                                    <TextBlock Text="&#xe605;"/>
                                </hc:SideMenuItem.Icon>
                            </hc:SideMenuItem>

                            <hc:SideMenuItem Header="物料明细" Tag="物料明细" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.调试},Converter={StaticResource AuthVisConverter}}">
                                <hc:SideMenuItem.Icon>
                                    <TextBlock Text="&#xe60e;"/>
                                </hc:SideMenuItem.Icon>
                            </hc:SideMenuItem>
                        </hc:SideMenuItem>

                        <hc:SideMenuItem Header="权限" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.权限},Converter={StaticResource AuthVisConverter}}">
                            <hc:SideMenuItem.Icon>
                                <Image Source="/Resources/权限.png"/>
                            </hc:SideMenuItem.Icon>

                            <hc:SideMenuItem Header="角色管理" Tag="角色管理" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.调试},Converter={StaticResource AuthVisConverter}}">
                                <hc:SideMenuItem.Icon>
                                    <TextBlock Text="&#xe60c;"/>
                                </hc:SideMenuItem.Icon>
                            </hc:SideMenuItem>

                            <hc:SideMenuItem Header="用户管理" Tag="用户管理" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.调试},Converter={StaticResource AuthVisConverter}}">
                                <hc:SideMenuItem.Icon>
                                    <TextBlock Text="&#xe61c;"/>
                                </hc:SideMenuItem.Icon>
                            </hc:SideMenuItem>
                        </hc:SideMenuItem>

                        <hc:SideMenuItem Header="调试" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.权限},Converter={StaticResource AuthVisConverter}}">
                            <hc:SideMenuItem.Icon>
                                <Image Source="/Resources/调试.png"/>
                            </hc:SideMenuItem.Icon>
                            <hc:SideMenuItem Header="调试" Tag="调试" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.调试},Converter={StaticResource AuthVisConverter}}">
                                <hc:SideMenuItem.Icon>
                                    <TextBlock Text="&#xe61e;"/>
                                </hc:SideMenuItem.Icon>
                            </hc:SideMenuItem>
                            <hc:SideMenuItem Header="设置" Tag="设置" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.调试},Converter={StaticResource AuthVisConverter}}">
                                <hc:SideMenuItem.Icon>
                                    <TextBlock Text="&#xe601;"/>
                                </hc:SideMenuItem.Icon>
                            </hc:SideMenuItem>
                            <hc:SideMenuItem Header="接口记录" Tag="接口记录" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.调试},Converter={StaticResource AuthVisConverter}}">
                                <hc:SideMenuItem.Icon>
                                    <TextBlock Text="&#xe61f;"/>
                                </hc:SideMenuItem.Icon>
                            </hc:SideMenuItem>
                        </hc:SideMenuItem>

                    </hc:SideMenu>
                </hc:TransitioningContentControl>
            </Border>
            <!--内容-->
            <Border Margin="0,3,5,3" Grid.Column="1" Style="{StaticResource BorderRegion}" Padding="0" BorderThickness="1">
                <TabControl Style="{x:Null}" Margin="1,-3,1,1" BorderThickness="0" SelectedValue="{Binding SelectedValue}" SelectedValuePath="Header" PreviewKeyDown="tabControl_PreviewKeyDown">
                    <TabItem Header="主页" IsSelected="True"  Height="{Binding TabItemHeight}">
                        <hc:TransitioningContentControl TransitionMode="Fade">
                            <View:HomeView />
                        </hc:TransitioningContentControl>
                    </TabItem>

                    <TabItem Header="物料入库" Height="{Binding TabItemHeight}">
                        <hc:TransitioningContentControl TransitionMode="Fade">
                            <View:InInventoryView />
                        </hc:TransitioningContentControl>
                    </TabItem>

                    <TabItem Header="出库单据" Height="{Binding TabItemHeight}">
                        <hc:TransitioningContentControl TransitionMode="Fade">
                            <View:OutInventoryDocumentView/>
                        </hc:TransitioningContentControl>
                    </TabItem>
                    <TabItem Header="物料出库" IsSelected="{Binding GoToOutVentoryView}" Height="{Binding TabItemHeight}">
                        <hc:TransitioningContentControl TransitionMode="Fade">
                            <View:OutVentoryView/>
                        </hc:TransitioningContentControl>
                    </TabItem>

                    <TabItem Header="盘点单据" Height="{Binding TabItemHeight}">
                        <hc:TransitioningContentControl TransitionMode="Fade">
                            <View:StocktakingDocumentView/>
                        </hc:TransitioningContentControl>
                    </TabItem>
                    <TabItem Header="物料盘点" Height="{Binding TabItemHeight}">
                        <hc:TransitioningContentControl TransitionMode="Fade">
                            <View:StockTakingView/>
                        </hc:TransitioningContentControl>
                    </TabItem>

                    <TabItem Header="库存查询" Height="{Binding TabItemHeight}">
                        <hc:TransitioningContentControl TransitionMode="Fade">
                            <View:MatInventoryDetailView/>
                        </hc:TransitioningContentControl>
                    </TabItem>
                    <TabItem Header="出入记录" Height="{Binding TabItemHeight}">
                        <hc:TransitioningContentControl TransitionMode="Fade">
                            <View:InOutRecordView/>
                        </hc:TransitioningContentControl>
                    </TabItem>
                    <TabItem Header="货架管理"
                             Height="{Binding TabItemHeight}">
                        <hc:TransitioningContentControl TransitionMode="Fade">
                            <View:ShelfInfoView />
                        </hc:TransitioningContentControl>
                    </TabItem>
                    <TabItem Header="物料维护" Height="{Binding TabItemHeight}">
                        <hc:TransitioningContentControl TransitionMode="Fade">
                            <View:MatBaseInfoView/>
                        </hc:TransitioningContentControl>
                    </TabItem>
                    <TabItem Header="物料明细" Height="{Binding TabItemHeight}">
                        <hc:TransitioningContentControl TransitionMode="Fade">
                            <View:MatInfoView/>
                        </hc:TransitioningContentControl>
                    </TabItem>

                    <TabItem Header="角色管理" Height="{Binding TabItemHeight}">
                        <hc:TransitioningContentControl TransitionMode="Fade">
                            <View:RoleView/>
                        </hc:TransitioningContentControl>
                    </TabItem>
                    <TabItem Header="用户管理" Height="{Binding TabItemHeight}">
                        <hc:TransitioningContentControl TransitionMode="Fade">
                            <View:UserView/>
                        </hc:TransitioningContentControl>
                    </TabItem>


                    <TabItem Header="接口记录" Height="{Binding TabItemHeight}">
                        <hc:TransitioningContentControl TransitionMode="Fade">
                            <View:InterfaceRecordView/>
                        </hc:TransitioningContentControl>
                    </TabItem>
                    <TabItem Header="调试" Height="{Binding TabItemHeight}">
                        <hc:TransitioningContentControl TransitionMode="Fade">
                            <View:DeviceView/>
                        </hc:TransitioningContentControl>
                    </TabItem>
                    <TabItem Header="设置" Height="{Binding TabItemHeight}">
                        <hc:TransitioningContentControl TransitionMode="Fade">
                            <View:SetView/>
                        </hc:TransitioningContentControl>
                    </TabItem>

                </TabControl>
            </Border>
        </Grid>
        <!--状态栏-->
        <Border Margin="5,3" Grid.Row="1" Grid.ColumnSpan="2" Background="AliceBlue" CornerRadius="3">
            <hc:TransitioningContentControl TransitionMode="Top2Bottom">
                <Grid>
                    <StackPanel Margin="5" Orientation="Horizontal" HorizontalAlignment="Left">
                    </StackPanel>
                    <StackPanel Margin="5" Orientation="Horizontal" HorizontalAlignment="Right">
                        <TextBlock Margin="0,0" Text="{Binding Time,StringFormat=yyyy-MM-dd HH:mm:ss,FallbackValue=2000-01-01 00:00:00}" Foreground="#FF3A90C1" VerticalAlignment="Center"></TextBlock>
                    </StackPanel>
                </Grid>
            </hc:TransitioningContentControl>
        </Border>
        <!--全局提示-->
        <ScrollViewer Background="{x:Null}" Grid.Row="0" VerticalScrollBarVisibility="Auto" HorizontalAlignment="Right" VerticalAlignment="Top">
            <StackPanel Background="{x:Null}" hc:Growl.GrowlParent="True" VerticalAlignment="Top" Margin="0,10,10,10" HorizontalAlignment="Right"/>
        </ScrollViewer>
    </Grid>
</hc:Window>