<My:MWindow  xmlns:My="clr-namespace:MyWPFControl.Controls;assembly=MyWPFControl"
                 x:Class="B20UVLog.Windows.DictionarySet"
        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:B20UVLog.Windows" xmlns:viewmodels="clr-namespace:B20UVLog.ViewModels"
             mc:Ignorable="d"
             WindowStyle="ToolWindow"
        Title="字典配置" Height="650" Width="800">
    <Window.DataContext>
        <viewmodels:DictionarySetViewModel/>
    </Window.DataContext>
    <Grid>
        <DockPanel LastChildFill="True" Margin="20">
            <StackPanel DockPanel.Dock="Top" Orientation="Horizontal">
                <My:MComboBox Title="选择字典种类">
                    <ComboBoxItem>常规</ComboBoxItem>
                    <ComboBoxItem>警告</ComboBoxItem>
                    <ComboBoxItem>报警</ComboBoxItem>
                </My:MComboBox>
                <My:MButton Type="Primary">新增</My:MButton>
                <My:MButton Type="Warning">导入</My:MButton>
            </StackPanel>
            <My:MPagination DockPanel.Dock="Bottom"/>
            <My:MDataGrid ItemsSource="{Binding Dicts}" DockPanel.Dock="Top">
                <DataGrid.Columns>
                    <DataGridTextColumn Header="类型" Binding="{Binding Type}" Width="100"></DataGridTextColumn>
                    <DataGridTextColumn Header="编码" Binding="{Binding Code}" Width="100"></DataGridTextColumn>
                    <DataGridTextColumn Header="键" Binding="{Binding Key}" Width="100"></DataGridTextColumn>
                    <DataGridTextColumn Header="值" Binding="{Binding Value}" Width="100"></DataGridTextColumn>
                    <DataGridTextColumn Header="备注" Binding="{Binding Mask}" Width="100"></DataGridTextColumn>
                    <DataGridTemplateColumn>
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                    <My:MButton IsText="True" Icon="{StaticResource Icon-edit}">编辑</My:MButton>
                                    <My:MButton IsText="True" Icon="{StaticResource Icon-trash-alt}">删除</My:MButton>
                                </StackPanel>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                </DataGrid.Columns>
            </My:MDataGrid>
        </DockPanel>
    </Grid>
</My:MWindow>
