<Window x:Class="Khd.Core.Wpf.TaskForm.MenuList"
        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:Khd.Core.Wpf.TaskForm"
        mc:Ignorable="d"
        Background="#333333"
        Loaded="Window_Loaded"
        WindowStyle="None"
        WindowStartupLocation="CenterScreen"
         Height="600" Width="400">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <!--<hc:ThemeResources/>
               <hc:Theme/>-->
                <ResourceDictionary Source="/CSS/SearchBtnClass.xaml" />
                <ResourceDictionary Source="/CSS/SearchTextClass.xaml" />
            </ResourceDictionary.MergedDictionaries>
            <Style x:Key="dgCell" TargetType="TextBlock" BasedOn="{x:Null}">
                <Setter Property="TextAlignment" Value="Center" />
                <Setter Property="HorizontalAlignment" Value="Center" />
                <Setter Property="VerticalAlignment" Value="Center" />
            </Style>
        </ResourceDictionary>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="auto" />
        </Grid.RowDefinitions>
        <DataGrid Background="Transparent" x:Name="MenuListData" 
               AlternationCount="2"
               AutoGenerateColumns="False"
               CanUserAddRows="False"
               CanUserReorderColumns="False"
               CanUserResizeColumns="False"
               CanUserResizeRows="False"
               Focusable="False"
               HeadersVisibility="Column"
               IsReadOnly="True"
               RowHeaderWidth="0"
               SelectionMode="Single"
            MinRowHeight="50" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                  >
            <DataGrid.Columns>
                <DataGridTemplateColumn Width="130*" Header="选择">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Grid>
                                <Grid.Tag>
                                    <Binding Path="IsSeleted"/>
                                </Grid.Tag>
                                <CheckBox 
                                  IsChecked="{Binding Tag, RelativeSource={RelativeSource AncestorType=Grid}}"
                                  Click="CheckBox_Click"
                                  VerticalAlignment="Center"
                                  HorizontalAlignment="Center"
                                  Width="40"
                                  Height="40" />
                            </Grid>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTextColumn
                    Width="200*"
                    Binding="{Binding MenuIcon}"
                    CanUserSort="False"
                    FontSize="20"
                    ElementStyle="{StaticResource dgCell}"
                    Header="菜单名称"
                    IsReadOnly="True" />

            </DataGrid.Columns>
            <DataGrid.CellStyle>
                <Style TargetType="{x:Type DataGridCell}">
                    <Setter Property="Foreground" Value="White" />
                    <Setter Property="Background" Value="#333333" />
                    <Setter Property="HorizontalContentAlignment" Value="Center" />
                </Style>
            </DataGrid.CellStyle>
            <DataGrid.RowStyle>
                <Style TargetType="{x:Type DataGridRow}">
                    <Setter Property="Foreground" Value="White" />
                    <Setter Property="Background" Value="#333333" />
                </Style>
            </DataGrid.RowStyle>
            <DataGrid.RowHeaderStyle>
                <Style TargetType="{x:Type DataGridRowHeader}">
                    <Setter Property="Foreground" Value="White" />
                    <Setter Property="Background" Value="#333333" />
                    <Setter Property="HorizontalContentAlignment" Value="Center" />
                </Style>
            </DataGrid.RowHeaderStyle>
            <DataGrid.ColumnHeaderStyle>
                <Style TargetType="{x:Type DataGridColumnHeader}">
                    <Setter Property="Foreground" Value="White" />
                    <Setter Property="Background" Value="#333333" />
                    <Setter Property="HorizontalContentAlignment" Value="Center" />
                    <Setter Property="Margin" Value="0,0,0,0" />
                    <Setter Property="BorderThickness" Value="5" />
                    <Setter Property="BorderBrush" Value="Transparent" />
                    <Setter Property="FontSize" Value="30" />
                </Style>
            </DataGrid.ColumnHeaderStyle>
        </DataGrid>
        <StackPanel Grid.Row="1" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
            <Button Content="保存" Background="#346DFF" Foreground="White" Width="100" Height="40" FontSize="25" Click="Button_Click"/>
            <Button Content="取消" Click="Button1_Click" Margin="50,20,20,20" Background="#346DFF" Foreground="White" Width="100" Height="40" FontSize="25"/>
        </StackPanel>
    </Grid>
</Window>
