<Page x:Class="ThickTcpUiInWindow.Page_WarningSystem"
      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" 
      mc:Ignorable="d" 
      Loaded="Page_Loaded" Unloaded="Page_Unloaded"
      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:,,,/ThickTcpUiInWindow;component/Converter/Dictionary_MyConv.xaml"/>
                <!--<ResourceDictionary Source="pack://application:,,,/ThickTcpUiInWindow;component/Culture/StringResource.zh-CN.xaml"/>-->
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Page.Resources>
    <Grid >
        <Grid.RowDefinitions>
            <RowDefinition Height="auto" />
            <RowDefinition Height="auto" />
            <RowDefinition Height="auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal" Background="{StaticResource Background_Title}">
            <Button Style="{StaticResource ButtonStyle_back2}" Command="BrowseBack"/>
            <TextBlock Style="{StaticResource TextBlockStyle_Title}"  Text="{DynamicResource strAlarmSystem}"/>
        </StackPanel>
        <Grid Grid.Row="1" Margin="0,5,0,5">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="auto" />
                <ColumnDefinition/>
                <ColumnDefinition Width="auto" />
            </Grid.ColumnDefinitions>
            <Button Style="{StaticResource ResourceKey=ButtonStyle3}" Width="150" Margin="0,5,5,5" Click="button_apply_Click" >
                <StackPanel Orientation="Vertical">
                    <TextBlock Style="{StaticResource TextBlockStyle_ItemHeader}" Text="{DynamicResource strParam}"/>
                    <TextBlock Style="{StaticResource TextBlockStyle_ItemHeader}" Text="{DynamicResource strApply}" Margin="0"/>
                </StackPanel>
                
            </Button>
            <WrapPanel Orientation="Horizontal" Grid.Column="1">
                <StackPanel Orientation="Vertical" Margin="5">
                    <TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="{DynamicResource strEnable}" />
                    <ToggleButton Style="{StaticResource ToggleButtonStyle1}" IsChecked="{Binding Enable}" />
                </StackPanel>
                <StackPanel Orientation="Vertical" Margin="5">
                    <TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="{DynamicResource strDataSave}" />
                    <ToggleButton Style="{StaticResource ToggleButtonStyle1}" IsChecked="{Binding EnSave}" />
                </StackPanel>

                <StackPanel Orientation="Vertical" Margin="5">
                    <TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="{DynamicResource strDuration}" />
                    <StackPanel Orientation="Horizontal">
                        <TextBox Style="{StaticResource ResourceKey=TextBoxStyle_FieldContent}" Text="{Binding Duration}" />
                        <TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldContent_mm}" >
                            <Run Text="s"/>
                        </TextBlock>
                    </StackPanel>
                </StackPanel>
                <StackPanel Orientation="Vertical" Margin="5">
                    <TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="{DynamicResource strWhiteList}" />
                    <StackPanel Orientation="Horizontal">
                        <TextBox Style="{StaticResource ResourceKey=TextBoxStyle_FieldContent}" Text=""  />
                    </StackPanel>
                </StackPanel>
                <StackPanel Orientation="Vertical" Margin="5">
                    <TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="{DynamicResource strBlackList}" />
                    <StackPanel Orientation="Horizontal">
                        <TextBox Style="{StaticResource ResourceKey=TextBoxStyle_FieldContent}" Text=""  />
                    </StackPanel>
                </StackPanel>
            </WrapPanel>
        </Grid>
        <Grid Grid.Row="2" Margin="0,5,0,5">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="auto" />
                <ColumnDefinition/>
                <ColumnDefinition Width="auto" />
            </Grid.ColumnDefinitions>
            <Border Width="150" Background="{StaticResource Color_theme_activity}" Margin="0,5,5,5">
                <TextBlock Style="{StaticResource TextBlockStyle_ItemHeader}"  Text="{DynamicResource strOperation}"/>
            </Border>
            <WrapPanel Orientation="Horizontal" Grid.Column="1">
                <WrapPanel.Resources>
                    <Style TargetType="Button" BasedOn="{StaticResource ResourceKey=ButtonStyle2}">
                        <Setter Property="Margin" Value="5"/>
                        <Setter Property="Height" Value="75"/>
                        <Setter Property="Width" Value="140"/>
                    </Style>
                </WrapPanel.Resources>
                <Button Content="{DynamicResource strReset}" Click="button_reset_Click" />
                <Button FontSize="40" Click="button_access_Click" >
                    <Viewbox>
                        <TextBlock Text="{DynamicResource strAuthorizationCode}"/>
                    </Viewbox>
                </Button>
            </WrapPanel>
        </Grid>
        <Grid Grid.Row="3" Margin="0,5,0,5">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="auto" />
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Border Width="150" Background="{StaticResource Color_theme_activity}" >
                <TextBlock Style="{StaticResource TextBlockStyle_ItemHeader}" Text="{DynamicResource strRecordSheet}"/>
            </Border>

            <DataGrid Grid.Column="1" Margin="5" AutoGenerateColumns="False" Name="datagrid" ItemsSource="{Binding ReasonList}" TextBlock.FontSize="18" TextBlock.FontStyle="Normal" >
                <DataGrid.Columns>
                    <DataGridTextColumn Header="{DynamicResource strTime}" Binding="{Binding Time}" Width="250"/>
                    <DataGridTextColumn Header="{DynamicResource strType}" Binding="{Binding ErrType}" Width="80"/>
                    <DataGridTextColumn Header="{DynamicResource strErrorCode}" Binding="{Binding ErrCode}" Width="80"/>
                    <DataGridTextColumn Header="{DynamicResource strStatus}" Binding="{Binding  State}" Width="80"/>
                    <DataGridTextColumn Header="{DynamicResource strDescription}" Binding="{Binding Description}" Width="400"/>
                </DataGrid.Columns>
            </DataGrid>



        </Grid>
    </Grid>
</Page>
