<bpa:BPAWindow
    x:Class="BPA.SingleDevice.View.MainView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:bpa="http://BPAUIControl.io/winfx/xaml/toolkit"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:local="clr-namespace:BPA.SingleDevice.View"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:vm="clr-namespace:BPA.SingleDevice.ViewModel"
    Title="味魔方自动配料系统"
    Width="1200"
    Height="800"
    Background="Transparent"
    TitleBackground="#2d2d2d"
    TitleHeight="40"
    WindowStartupLocation="CenterScreen"
    mc:Ignorable="d">

    <bpa:BPAWindow.DataContext>
        <vm:MainViewModel />
    </bpa:BPAWindow.DataContext>


    <Grid>
        <!--#region 菜单栏设置-->
        <!--<ui:HamburgerMenu
            ui:ControlHelper.CornerRadius="0"
            ui:ControlHelper.FocusedBrush="{DynamicResource Dark}"
            ui:ControlHelper.FocusedForegroundBrush="{StaticResource WhiteForeground}"
            ui:ControlHelper.MaskOpacity="1"
            ui:ControlHelper.SelectedBrush="{DynamicResource Dark}"
            ui:HeaderHelper.FontSize="16"
            ui:HeaderHelper.Foreground="{StaticResource WhiteForeground}"
            ui:HeaderHelper.Padding="0 13"
            ui:ItemsControlHelper.ItemMargin="5 2"
            ui:ItemsControlHelper.ItemPadding="10 13"
            Background="#2d2d2d"
            BorderThickness="0"
            CollapsedWidth="56"
            CornerRadius="0"
            ExpandedWidth="200"
            FontSize="16"
            Foreground="{StaticResource WhiteForeground}"
            Header="主页"
            IsShowLittleBar="False"
            PaneBackground="#3F000000"
            PaneBorderCornerRadius="0"
            SelectedIndex="0"
            TransitionDuration="0:0:0.5"
            TransitionType="FadeLeft">
            <ui:HamburgerMenuItem
                Command="{Binding SelecteCommand}"
                CommandParameter="RawMaterialManagementView"
                Content="{Binding MainContent}"
                Header="原料管理"
                IconType="ReservedFill" />
            <ui:HamburgerMenuItem
                Command="{Binding SelecteCommand}"
                CommandParameter="DeviceManagementView"
                Content="{Binding MainContent}"
                Header="设备管理"
                IconType="ServerFill" />
            <ui:HamburgerMenuItem
                Command="{Binding SelecteCommand}"
                CommandParameter="RecipeManagementView"
                Content="{Binding MainContent}"
                Header="配方管理"
                IconType="NewspaperFill" />
        -->
        <!--<ui:HamburgerMenuItem
                Command="{Binding SelecteCommand}"
                CommandParameter="{Binding Content, RelativeSource={RelativeSource Self}}"
                Content="自定义"
                Header="自定义">
                <ui:HamburgerMenuItem.Icon>
                    <Image Source="..\rubyer.ico" />
                </ui:HamburgerMenuItem.Icon>
            </ui:HamburgerMenuItem>-->
        <!--
        </ui:HamburgerMenu>-->
        <!--#endregion-->

        <bpa:HamburgerMenu
            bpa:ControlHelper.CornerRadius="0"
            bpa:ControlHelper.FocusedBrush="{DynamicResource Dark}"
            bpa:ControlHelper.SelectedBrush="{DynamicResource Dark}"
            bpa:HeaderHelper.FontSize="{Binding FontSize, RelativeSource={RelativeSource Self}}"
            bpa:HeaderHelper.Foreground="{DynamicResource WhiteForeground}"
            bpa:ItemsControlHelper.ItemMargin="0"
            bpa:ItemsControlHelper.ItemPadding="5 3"
            Background="#2d2d2d"
            ExpandedWidth="170"
            Foreground="{DynamicResource WhiteForeground}"
            Header="菜单"
            ItemsSource="{Binding ViewItems}"
            PaneBackground="{Binding TitleBackground, RelativeSource={RelativeSource AncestorType=bpa:BPAWindow}}"
            SelectedItem="{Binding CurrentViewItem}"
            TransitionDuration="0:0:0.7"
            TransitionType="Fade">
            <bpa:HamburgerMenu.Resources>
                <Grid
                    x:Key="headContent"
                    Height="30"
                    x:Shared="false">
                    <TextBlock Text="{Binding Name}" />
                </Grid>
            </bpa:HamburgerMenu.Resources>
            <bpa:HamburgerMenu.ItemContainerStyle>
                <Style TargetType="bpa:HamburgerMenuItem">
                    <Setter Property="DataContext" Value="{Binding}" />
                    <Setter Property="IconType" Value="{Binding Icon}" />
                    <Setter Property="Header" Value="{StaticResource headContent}" />
                </Style>
            </bpa:HamburgerMenu.ItemContainerStyle>
            <bpa:HamburgerMenu.ContentTemplate>
                <DataTemplate>
                    <Border Background="{DynamicResource DefaultBackground}">
                        <ContentControl Margin="0" Content="{Binding Content}" />
                    </Border>
                </DataTemplate>
            </bpa:HamburgerMenu.ContentTemplate>
        </bpa:HamburgerMenu>



    </Grid>

</bpa:BPAWindow>
