<Window
    x:Class="BPASmartClient.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:control="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:local="clr-namespace:BPASmartClient"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
    xmlns:vm="clr-namespace:BPASmartClient.ViewModel;assembly=BPASmartClient.ViewModel"
    Title="MainWindow"
    Width="1300"
    Height="800"
    AllowsTransparency="True"
    Background="{x:Null}"
    Topmost="False"
    WindowStartupLocation="CenterScreen"
    WindowStyle="None"
    mc:Ignorable="d">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml" />
                <ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>

    <Border x:Name="br" Style="{DynamicResource border主窗体背景}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="60" />
                <RowDefinition />
            </Grid.RowDefinitions>

            <!--  标题  -->
            <Grid Grid.Row="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="300" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Border
                    Grid.ColumnSpan="2"
                    Height="52"
                    VerticalAlignment="Top"
                    Style="{DynamicResource bordertop矩形}" />
                <Border Style="{DynamicResource bordertopL}" />
                <Image
                    Margin="20,0,0,0"
                    VerticalAlignment="Center"
                    Style="{DynamicResource imagetop_Title}" />
                <Grid Grid.Column="1"  >
                    <Menu x:Name="myMenu">
                        <MenuItem Header="功能列表">
                            <MenuItem
                                Click="MenuItem_Click"
                                FontSize="12"
                                Header="加盟商管理"
                                Tag="BatchingAddView" />
                            <Separator />
                            <MenuItem
                                Click="MenuItem_Click"
                                FontSize="12"
                                Header="业务编排"
                                Tag="BusinessOrchestrationView" />
                            <Separator />
                            <MenuItem
                                Click="MenuItem_Click"
                                FontSize="12"
                                Header="大屏导航"
                                Tag="IOT" />
                            <Separator />
                            <MenuItem
                                Click="MenuItem_Click"
                                FontSize="12"
                                Header="店铺设备配置"
                                Tag="ShopDeviceConfigView" />
                            <Separator />
                            <MenuItem
                                Click="MenuItem_Click"
                                FontSize="12"
                                Header="阿里连接维护"
                                Tag="DataVView" />
                            <Separator />
                            <MenuItem
                                Click="MenuItem_Click"
                                FontSize="12"
                                Header="调试界面"
                                Tag="MorkT_DebugView" />
                        </MenuItem>
                        <MenuItem Header="状态监视">
                            <MenuItem
                                Click="MenuItem_Click"
                                FontSize="12"
                                Header="日志监视"
                                Tag="LogView" />
                            <Separator />
                            <MenuItem
                                Click="MenuItem_Click"
                                FontSize="12"
                                Header="订单监视"
                                Tag="OrderStatusView" />
                            <Separator />
                            <MenuItem
                                Click="MenuItem_Click"
                                FontSize="12"
                                Header="设备监视"
                                Tag="DeviceMonitorView" />
                            <Separator />
                            <MenuItem
                                Click="MenuItem_Click"
                                FontSize="12"
                                Header="报警监视"
                                Tag="AlarmView" />
                            <Separator />
                            <MenuItem
                                Click="MenuItem_Click"
                                FontSize="12"
                                Header="IOT监视"
                                Tag="IOTView" />
                            <Separator />
                        </MenuItem>
                        <MenuItem Header="综合查询">
                            <MenuItem
                                Click="MenuItem_Click"
                                FontSize="12"
                                Header="本地日志查询"
                                Tag="LogOrAlarmView" />
                            <Separator />
                            <MenuItem
                                Click="MenuItem_Click"
                                FontSize="12"
                                Header="云端日志下载"
                                Tag="LogOrAlarmIOTView" />
                        </MenuItem>
                        <MenuItem Header="参数配置">
                            <MenuItem
                                Click="MenuItem_Click"
                                FontSize="12"
                                Header="参数设置"
                                Tag="SystemSetView" />
                        </MenuItem>
                        <MenuItem Header="系统帮助">
                            <MenuItem
                                Click="MenuItem_Click"
                                FontSize="12"
                                Header="版本更新历史"
                                Tag="VersionView" />
                            <Separator />
                            <MenuItem
                                Click="MenuItem_Click"
                                FontSize="12"
                                Header="帮助文档"
                                Tag="SystemParameterControl" />
                            <Separator />
                            <MenuItem
                                Click="MenuItem_Click"
                                FontSize="12"
                                Header="退出程序"
                                Tag="Close" />
                        </MenuItem>
                    </Menu>
                </Grid>

                <StackPanel
                    Grid.Column="4"
                    Height="50"
                    HorizontalAlignment="Right"
                    VerticalAlignment="Top"
                    Orientation="Horizontal">
                    <Border Style="{DynamicResource border竖线}" />
                    <StackPanel
                        Margin="5"
                        HorizontalAlignment="Center"
                        VerticalAlignment="Center">
                        <TextBlock FontSize="12">网</TextBlock>
                        <TextBlock FontSize="12">络</TextBlock>
                    </StackPanel>
                    <ToggleButton
                        Margin="5"
                        HorizontalAlignment="Center"
                        VerticalAlignment="Center"
                        Cursor="Hand"
                        IsChecked="{Binding NetworkConnectState}"
                        Style="{DynamicResource StatusBtnStyle网络连接状态}"
                        ToolTip="网络连接状态" />
                    <Border Style="{DynamicResource border竖线}" />
                    <ToggleButton
                        HorizontalAlignment="Center"
                        VerticalAlignment="Center"
                        Cursor="Hand"
                        DataContext="{Binding IsAlarm}"
                        Style="{DynamicResource StatusBtnStyle告警}"
                        ToolTip="告警消息" />
                    <Border Style="{DynamicResource border竖线}" />
                    <control:DateTimeUI Margin="10,0,10,0" VerticalAlignment="Center" />
                    <Border Style="{DynamicResource border竖线}" />
                    <Button
                        x:Name="ButClose"
                        Grid.Column="4"
                        Margin="10,0,20,0"
                        VerticalAlignment="Center"
                        Content="退出"
                        Cursor="Hand"
                        Style="{DynamicResource CommonBtn_返回}"
                        ToolTip="退出程序" />

                </StackPanel>
            </Grid>

            <!--  底部窗体  -->
            <Grid Grid.Row="1" Margin="10">
                <Grid.RowDefinitions>
                    <RowDefinition Height="45" />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <!--  顶部装饰  -->
                <Border
                    Grid.Row="0"
                    Grid.RowSpan="2"
                    Style="{DynamicResource border右下}" />
                
                <Border
                    Grid.Row="0"
                    Grid.RowSpan="2"
                    Style="{DynamicResource border左下}" />
                
                <Border
                    Grid.Row="0"
                    Grid.RowSpan="2"
                    Style="{DynamicResource border右上}" />
                
                <Border
                    Grid.Row="0"
                    Grid.RowSpan="2"
                    Style="{DynamicResource border左上}" />
                
                <Grid Margin="10">
                    <Border Width="600" Style="{DynamicResource borderFromTitle}" />
                   
                    <StackPanel Orientation="Horizontal" >
                        <CheckBox
                        Content="开机启动" Margin="5,0,5,0"
                        IsChecked="{Binding AutoStart}" />
                        <Button
                        Name="init" Margin="5,0,5,0"
                        Grid.Row="0"
                        Width="90"
                        HorizontalAlignment="Left"
                        VerticalAlignment="Top"
                        Click="init_Click"
                        Content="初始化设备"
                        Cursor="Hand" />
                        <Button
                        Grid.Row="0" Margin="5,0,5,0"
                        HorizontalAlignment="Left"
                        VerticalAlignment="Top"
                        Click="Button_Click"
                        Content="测试"
                        Cursor="Hand" />
                    </StackPanel>

                    <TextBlock
                        x:Name="Title"
                        HorizontalAlignment="Center"
                        FontSize="18"
                        Foreground="#feffff">
                        日志监控界面
                    </TextBlock>

                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                        <Button
                        Name="login" Margin="5,0,5,0"
                        Grid.Row="0"
                        Width="45"
                        HorizontalAlignment="Right"
                        VerticalAlignment="Top"
                        Click="Button_Login"
                        Content="登录"
                        Cursor="Hand"/>
                        <Button
                        Name="logout"
                        Grid.Row="0"
                        Width="45"
                        HorizontalAlignment="Right"
                        VerticalAlignment="Top"
                        Click="Button_LogOut"
                        Command="{Binding LogoutCommand}"
                        Content="注销"
                        Cursor="Hand" />
                    </StackPanel>
                    
                </Grid>
                
                <!--#region 底部窗体栏-->
                <ContentControl x:Name="contentRegion" Grid.Row="1" />
                <!--#endregion-->
            </Grid>


        </Grid>
    </Border>
</Window>
