<Page x:Class="FLY.Thick.Base.UI.PgPwManager"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
      mc:Ignorable="d" 
      d:DesignHeight="800" d:DesignWidth="1024"
      Background="WhiteSmoke"
	Title="PgCustomSections">
    <Page.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/FLY.Thick.Base.UI;component/Themes/Styles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Page.Resources>
    <Grid >
        <Grid.RowDefinitions>
            <RowDefinition Height="auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal"  Background="{StaticResource Brush_theme_bar}" >
            <Button Style="{StaticResource ButtonStyle_back2}" Command="BrowseBack"/>
            <TextBlock Style="{StaticResource TextBlockStyle_Title}" Text="密码管理"/>
        </StackPanel>
        <ScrollViewer  PanningMode="Both" Grid.Row="1" >
            <StackPanel>
                <DataGrid AlternationCount ="2" AlternatingRowBackground="LightGray"  AutoGenerateColumns="False" Margin="{StaticResource ControlMargin}" 
                          ItemsSource="{Binding Pws}" >
                    <DataGrid.CellStyle>
                        <Style TargetType="DataGridCell">
                            <Setter Property="FontSize" Value="20"/>
                        </Style>
                    </DataGrid.CellStyle>
                    <DataGrid.Columns>
                        <DataGridTextColumn CanUserReorder="False" Binding="{Binding Level}" >
                            <DataGridTextColumn.Header>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Style="{StaticResource TextBlockStyle_FieldHeader}" 
                                       Text="级别"/>
                                    <TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" 
                                       Text="(0-10)"/>
                                </StackPanel>
                            </DataGridTextColumn.Header>
                        </DataGridTextColumn>
                        <DataGridTextColumn CanUserSort="False" CanUserReorder="False" Binding="{Binding Password}" >
                            <DataGridTextColumn.Header>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Style="{StaticResource TextBlockStyle_FieldHeader}" 
                                       Text="密码"/>
                                </StackPanel>
                            </DataGridTextColumn.Header>
                        </DataGridTextColumn>
                    </DataGrid.Columns>
                </DataGrid>
                <DataGrid AlternationCount ="2" AlternatingRowBackground="LightYellow"  AutoGenerateColumns="False" Margin="{StaticResource ControlMargin}" 
                         ItemsSource="{Binding UiLvs}" >
                    <DataGrid.CellStyle>
                        <Style TargetType="DataGridCell">
                            <Setter Property="FontSize" Value="20"/>
                        </Style>
                    </DataGrid.CellStyle>
                    <DataGrid.Columns>
                        <DataGridTextColumn CanUserReorder="False" Binding="{Binding UiName}" >
                            <DataGridTextColumn.Header>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Style="{StaticResource TextBlockStyle_FieldHeader}" 
                                       Text="名称"/>
                                </StackPanel>
                            </DataGridTextColumn.Header>
                        </DataGridTextColumn>
                        <DataGridTextColumn CanUserReorder="False" Binding="{Binding Description}" >
                            <DataGridTextColumn.Header>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Style="{StaticResource TextBlockStyle_FieldHeader}" 
                                       Text="描述"/>
                                </StackPanel>
                            </DataGridTextColumn.Header>
                        </DataGridTextColumn>
                        <DataGridTextColumn CanUserReorder="False" Binding="{Binding Level}" >
                            <DataGridTextColumn.Header>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Style="{StaticResource TextBlockStyle_FieldHeader}" 
                                       Text="级别"/>
                                    <TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" 
                                       Text="(0-10)"/>
                                </StackPanel>
                            </DataGridTextColumn.Header>
                        </DataGridTextColumn>
                    </DataGrid.Columns>
                </DataGrid>
            </StackPanel>
        </ScrollViewer>

        <Button Grid.Row="0" Style="{StaticResource ButtonStyle_apply}" VerticalAlignment="Bottom" Margin="0,0,20,-45" 
                Command="{Binding ApplyCmd}"/>
    </Grid>
</Page>