<Window x:Class="ProcessManager.MainWindow"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="hMetroWindowttp://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
        xmlns:prism="http://prismlibrary.com/"
        xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
        xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
        xmlns:local="clr-namespace:ProcessManager"
                 mc:Ignorable="d"
                 WindowStyle="None"
                 Title="MainWindow" Height="600" Width="1000">
    <WindowChrome.WindowChrome>
        <WindowChrome GlassFrameThickness="-1" />
    </WindowChrome.WindowChrome>

    <materialDesign:DialogHost x:Name="MainDialogHost">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <materialDesign:ColorZone Mode="PrimaryMid"
                                      Background="#FF6200EE">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="auto" />
                        <ColumnDefinition />
                        <ColumnDefinition Width="auto" />
                    </Grid.ColumnDefinitions>
                    <Menu Grid.Column="0"
                          Background="Transparent"
                          Foreground="White"
                          VerticalAlignment="Center">
                        <MenuItem FontSize="14"
                                  Height="50"
                                  Header="菜单"
                                  Foreground="White"
                                  Command="{Binding DataContext.NavigateToMenuCommand, RelativeSource={RelativeSource AncestorType=Window}}">
                            <MenuItem.Icon>
                                <materialDesign:PackIcon Kind="Menu"
                                                         Foreground="White" />
                            </MenuItem.Icon>
                            <MenuItem.Style>
                                <Style TargetType="MenuItem"
                                       BasedOn="{StaticResource {x:Type MenuItem}}">
                                    <Setter Property="Background"
                                            Value="Transparent" />
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding DataContext.CurrentTag, RelativeSource={RelativeSource AncestorType=Window}}"
                                                     Value="Menu">
                                            <Setter Property="Background"
                                                    Value="#FFBB86FC" />
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </MenuItem.Style>

                        </MenuItem>
                        <MenuItem FontSize="14"
                                  Height="50"
                                  Header="设备一"
                                  Foreground="White"
                                  Command="{Binding DataContext.NavigateToDeviceCommand, RelativeSource={RelativeSource AncestorType=Window}}"
                                  CommandParameter="DeviceOne">
                            <MenuItem.Icon>
                                <materialDesign:PackIcon Kind="Menu"
                                                         Foreground="White" />
                            </MenuItem.Icon>
                            <MenuItem.Style>
                                <Style TargetType="MenuItem"
                                       BasedOn="{StaticResource {x:Type MenuItem}}">
                                    <Setter Property="Background"
                                            Value="Transparent" />
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding DataContext.CurrentTag, RelativeSource={RelativeSource AncestorType=Window}}"
                                                     Value="DeviceOne">
                                            <Setter Property="Background"
                                                    Value="#FFBB86FC" />
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </MenuItem.Style>
                        </MenuItem>
                        <MenuItem FontSize="14"
                                  Height="50"
                                  Header="设备二"
                                  Foreground="White"
                                  Command="{Binding DataContext.NavigateToDeviceCommand, RelativeSource={RelativeSource AncestorType=Window}}"
                                  CommandParameter="DeviceTwo">

                            <MenuItem.Icon>
                                <materialDesign:PackIcon Kind="Menu"
                                                         Foreground="White" />
                            </MenuItem.Icon>
                            <MenuItem.Style>
                                <Style TargetType="MenuItem"
                                       BasedOn="{StaticResource {x:Type MenuItem}}">
                                    <Setter Property="Background"
                                            Value="Transparent" />
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding DataContext.CurrentTag, RelativeSource={RelativeSource AncestorType=Window}}"
                                                     Value="DeviceTwo">
                                            <Setter Property="Background"
                                                    Value="#FFBB86FC" />
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </MenuItem.Style>
                        </MenuItem>
                        <MenuItem FontSize="14"
                                  Height="50"
                                  Header="设备三"
                                  Foreground="White"
                                  Command="{Binding DataContext.NavigateToDeviceCommand, RelativeSource={RelativeSource AncestorType=Window}}"
                                  CommandParameter="DeviceThree">
                            <MenuItem.Icon>
                                <materialDesign:PackIcon Kind="Menu"
                                                         Foreground="White" />
                            </MenuItem.Icon>
                            <MenuItem.Style>
                                <Style TargetType="MenuItem"
                                       BasedOn="{StaticResource {x:Type MenuItem}}">
                                    <Setter Property="Background"
                                            Value="Transparent" />
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding DataContext.CurrentTag, RelativeSource={RelativeSource AncestorType=Window}}"
                                                     Value="DeviceThree">
                                            <Setter Property="Background"
                                                    Value="#FFBB86FC" />
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </MenuItem.Style>
                        </MenuItem>
                        <MenuItem FontSize="14"
                                  Height="50"
                                  Header="水冷机和环境箱"
                                  Foreground="White"
                                  Command="{Binding DataContext.NavigateToDeviceCommand, RelativeSource={RelativeSource AncestorType=Window}}"
                                  CommandParameter="Other">
                            <MenuItem.Icon>
                                <materialDesign:PackIcon Kind="Menu"
                                                         Foreground="White" />
                            </MenuItem.Icon>
                            <MenuItem.Style>
                                <Style TargetType="MenuItem"
                                       BasedOn="{StaticResource {x:Type MenuItem}}">
                                    <Setter Property="Background"
                                            Value="Transparent" />
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding DataContext.CurrentTag, RelativeSource={RelativeSource AncestorType=Window}}"
                                                     Value="Other">
                                            <Setter Property="Background"
                                                    Value="#FFBB86FC" />
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </MenuItem.Style>
                        </MenuItem>

                    </Menu>

                    <Border Grid.Column="1"/>
                    <Menu Grid.Column="2"
                          Margin="0 0 20 0">
                        <MenuItem FontSize="14"
                                  Height="50"
                                  Header="最小化"
                                  Foreground="White"
                                  Command="{Binding MinimizeCommand}"
                                  CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=Window}}">
                            <MenuItem.Icon>
                                <materialDesign:PackIcon Kind="Minimize"
                                                         Foreground="White" />
                            </MenuItem.Icon>
                        </MenuItem>

                        <MenuItem FontSize="14"
                                  Height="50"
                                  Header="最大化"
                                  Foreground="White"
                                  Command="{Binding MaximizeCommand}"
                                  CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=Window}}">
                            <MenuItem.Icon>
                                <materialDesign:PackIcon Kind="Maximize"
                                                         Foreground="White" />
                            </MenuItem.Icon>
                        </MenuItem>

                        <MenuItem FontSize="14"
                                  Height="50"
                                  Header="关闭"
                                  Foreground="White"
                                  Command="{Binding CloseCommand}"
                                  CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=Window}}">
                            <MenuItem.Icon>
                                <materialDesign:PackIcon Kind="Close"
                                                         Foreground="White" />
                            </MenuItem.Icon>
                        </MenuItem>
                    </Menu>
                </Grid>
            </materialDesign:ColorZone>

            <ContentControl Grid.Row="1"
                            prism:RegionManager.RegionName="MainRegion"/>
        </Grid>
        
    </materialDesign:DialogHost>
    
</Window>
