<Page x:Class="FLY.Thick.Base.UI.PgErrorTable"
      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="768" d:DesignWidth="1024"
      Background="White"
	Title="Page_WarningSystem">
    <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="Control" x:Key="iconPackStyle">
                <Setter Property="Width" Value="25"/>
                <Setter Property="Height" Value="auto"/>
                <Setter Property="MaxHeight" Value="25"/>
                <Setter Property="VerticalAlignment" Value="Center"/>
                <Setter Property="HorizontalAlignment" Value="Center"/>
            </Style>
            <Style TargetType="Ellipse" x:Key="backPackStyle">
                <Setter Property="Width" Value="50"/>
                <Setter Property="Height" Value="50"/>
                <Setter Property="Fill" Value="{StaticResource Color_theme_static}"/>
            </Style>
            <Style TargetType="TextBlock" x:Key="titlePackStyle">
                <Setter Property="Margin" Value="2"/>
                <Setter Property="FontSize" Value="16"/>
                <Setter Property="HorizontalAlignment" Value="Center"/>
                <Setter Property="Foreground" Value="White"/>
            </Style>
            <Style TargetType="Button" x:Key="buttonStyle" BasedOn="{StaticResource Styles.Button.Empty}">
                <Setter Property="Margin" Value="20,0"/>
                <Setter Property="Foreground" Value="White"/>
            </Style>
        </ResourceDictionary>
    </Page.Resources>

    <Grid >
        <Grid.RowDefinitions>
            <RowDefinition Height="auto" />
            <RowDefinition Height="496*" />
        </Grid.RowDefinitions>
        <Grid Background="{StaticResource Brushes.TitleBar.Background}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="auto"/>
            </Grid.ColumnDefinitions>
            <StackPanel Orientation="Horizontal" >
                <Button Style="{StaticResource Styles.TitleBar.BackButton2}" Click="button_back_Click" />
                <TextBlock Style="{StaticResource Styles.TitleBar.Text}"  Text="报警"/>
                <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="60,0,0,0">
                    <Button Style="{StaticResource buttonStyle}" Click="button_iotip_click" >
                        <StackPanel>
                            <Grid Style="{StaticResource Styles.Shadow}">
                                <Ellipse Style="{StaticResource backPackStyle}" />
                                <iconPacks:PackIconMaterial Kind="AlphaI" Style="{StaticResource iconPackStyle}"/>
                            </Grid>
                            <TextBlock Text="IO信息" Style="{StaticResource titlePackStyle}"/>
                        </StackPanel>
                    </Button>
                    <Button Style="{StaticResource buttonStyle}" Click="button_access_click" >
                        <StackPanel>
                            <Grid Style="{StaticResource Styles.Shadow}">
                                <Ellipse Style="{StaticResource backPackStyle}" />
                                <iconPacks:PackIconMaterial Kind="LockOpen" Style="{StaticResource iconPackStyle}"/>
                            </Grid>
                            <TextBlock Text="授权" Style="{StaticResource titlePackStyle}"/>
                        </StackPanel>
                    </Button>
                    <Button Style="{StaticResource buttonStyle}" Click="button_database_click" >
                        <StackPanel>
                            <Grid Style="{StaticResource Styles.Shadow}">
                                <Ellipse Style="{StaticResource backPackStyle}" />
                                <iconPacks:PackIconMaterial Kind="DatabaseSearch" Style="{StaticResource iconPackStyle}"/>
                            </Grid>
                            <TextBlock Text="查询" Style="{StaticResource titlePackStyle}"/>
                        </StackPanel>
                    </Button>
                    <Button Style="{StaticResource buttonStyle}" Click="button_reset_click">
                        <StackPanel>
                            <Grid Style="{StaticResource Styles.Shadow}">
                                <Ellipse Style="{StaticResource backPackStyle}" Fill="#FFEE3232" />
                                <iconPacks:PackIconMaterial Kind="RestartAlert" Style="{StaticResource iconPackStyle}" />
                            </Grid>
                            <TextBlock Text="复位" Style="{StaticResource titlePackStyle}"/>
                        </StackPanel>
                    </Button>
                </StackPanel>

            </StackPanel>
            <StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center" >
                <Button Style="{StaticResource buttonStyle}" Click="button_silence_click" Foreground="#FFEE3232">
                    <StackPanel >
                        <Grid Style="{StaticResource Styles.Shadow}">
                            <Ellipse Style="{StaticResource backPackStyle}" Fill="White"/>
                            <iconPacks:PackIconMaterial Kind="VolumeMute" Style="{StaticResource iconPackStyle}"  />
                        </Grid>
                        <TextBlock Text="消音" Style="{StaticResource titlePackStyle}"/>
                    </StackPanel>
                </Button>
            </StackPanel>
        </Grid>
        <DataGrid Grid.Row="1" ItemsSource="{Binding ReasonList}" AutoGenerateColumns="False" IsReadOnly="True" Margin="{StaticResource ControlMargin}"
                      AlternationCount ="2"
                      AlternatingRowBackground="LightGray" 
                      RowHeaderWidth="0"
                      Style="{DynamicResource MahApps.Styles.DataGrid.Azure}"
                      FontSize="20"
                        
                      >
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Time,StringFormat={}{0:MM/dd HH:mm}}" Header="时间" />
                <DataGridTextColumn Binding="{Binding ErrCode}" Header="代码"/>
                <DataGridTextColumn Binding="{Binding Description}" Header="描述"/>
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</Page>

