<Page x:Class="FLY.Thick.Base.UI.PgErrorAllTable"
      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="900" d:DesignWidth="960" Background="White"
      Title="Page_ErrorTable">
    <Page.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Dictionary_MyStyle.xaml"/>
                <ResourceDictionary Source="pack://application:,,,/FLY.Thick.Base.UI;component/Converter/Dictionary_MyConv.xaml"/>
            </ResourceDictionary.MergedDictionaries>

            <Style TargetType="DataGridCell" >
                <Setter Property="FontSize" Value="16"/>
            </Style>
        </ResourceDictionary>
    </Page.Resources>
    <Grid Name="root_grid" >
        <Grid.RowDefinitions>
            <RowDefinition Height="auto" />
            <RowDefinition Height="496*" />
        </Grid.RowDefinitions>
        <Grid Background="{StaticResource Background_Title}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="auto"/>
            </Grid.ColumnDefinitions>
            <StackPanel Orientation="Horizontal" >
                <Button Style="{StaticResource ButtonStyle_back2}" Click="button_back_Click" />
                <TextBlock Style="{StaticResource TextBlockStyle_Title}"  Text="报警"/>
            </StackPanel>
            <StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center" >
                <Button Style="{StaticResource ButtonStyle_largeIcon}" Click="button_clear_click" Foreground="White" Margin="20,0">
                    <StackPanel>
                        <Grid Style="{StaticResource GridStyle_ButtonShadow}">
                            <Ellipse Fill="#FFEE3232" Margin="1"/>
                            <iconPacks:PackIconMaterial Kind="CloseCircle" />
                        </Grid>
                        <TextBlock Text="清空" Foreground="White"/>
                    </StackPanel>
                </Button>
            </StackPanel>
        </Grid>
        
        <Grid x:Name="grid_window" Grid.Row="1">

                <Grid.RowDefinitions>
                    <RowDefinition Height="auto"/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <Grid >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition/>
                        <ColumnDefinition Width="auto"/>
                    </Grid.ColumnDefinitions>
                    <StackPanel Orientation="Horizontal" Margin="{StaticResource ControlMargin}">
                        <Button Style="{StaticResource ButtonStyle_icon}" Background="Transparent" Click="button_prepage_Click" >
                            <iconPacks:PackIconMaterial Kind="ArrowLeft"/>
                        </Button>
                        <StackPanel Orientation="Horizontal" Margin="{StaticResource ControlMargin}">
                            <TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" Text="第"/>
                            <TextBlock Style="{StaticResource TextBlockStyle_FieldContent}" Text="{Binding CurrentPage}"/>
                            <TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" Text="页"/>
                            <TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm_interval}" Text="/"/>
                            <TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" Text="共"/>
                            <TextBlock Style="{StaticResource TextBlockStyle_FieldContent}" Text="{Binding TotalPages}"/>
                            <TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" Text="页"/>
                        </StackPanel>
                        <Button Style="{StaticResource ButtonStyle_icon}" Click="button_nextpage_Click" >
                            <iconPacks:PackIconMaterial Kind="ArrowRight"/>
                        </Button>
                        <Button Style="{StaticResource ButtonStyle_icon}" Click="button_newest_Click" >
                            <iconPacks:PackIconMaterial Kind="ArrowCollapseRight"/>
                        </Button>
                        <StackPanel Orientation="Horizontal" Margin="20,5">
                            <TextBlock Style="{StaticResource TextBlockStyle_FieldHeaderEditable}" Text="显示"/>
                            <TextBox Style="{StaticResource TextBoxStyle_FieldContent}" Text="{Binding Size}" MinWidth="40"/>
                            <TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" Text="行"/>
                        </StackPanel>
                    </StackPanel>
                </Grid>

                <DataGrid Grid.Row="1" ItemsSource="{Binding Record}" AutoGenerateColumns="False" IsReadOnly="True" Grid.ColumnSpan="2" 
                          AlternationCount="5" AlternatingRowBackground="LightGray"
                       >
 
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding Time,StringFormat={}{0:MM/dd HH:mm}}" >
                            <DataGridTextColumn.Header>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Style="{StaticResource TextBlockStyle_FieldHeader}" Text="时间" />
                                </StackPanel>
                            </DataGridTextColumn.Header>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding ErrCode}" IsReadOnly="True">
                            <DataGridTextColumn.Header>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Style="{StaticResource TextBlockStyle_FieldHeader}" Text="编码" />
                                </StackPanel>
                            </DataGridTextColumn.Header>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding State}" >
                            <DataGridTextColumn.Header>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Style="{StaticResource TextBlockStyle_FieldHeader}" Text="状态" />
                                </StackPanel>
                            </DataGridTextColumn.Header>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding Description}" >
                            <DataGridTextColumn.Header>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Style="{StaticResource TextBlockStyle_FieldHeader}" Text="报警描述" />
                                </StackPanel>
                            </DataGridTextColumn.Header>
                        </DataGridTextColumn>
                    </DataGrid.Columns>
                </DataGrid>
            </Grid>

        



    </Grid>
</Page>

