<Page x:Class="ThickTcpUiInWindow.Page_Reject"
      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:Chr="clr-namespace:System.Windows.Forms.DataVisualization.Charting;assembly=System.Windows.Forms.DataVisualization"
      mc:Ignorable="d" 
      d:DesignHeight="768" d:DesignWidth="1024"
      Loaded="Page_Loaded" Unloaded="Page_Unloaded" Background="White"
	Title="Page_Reject">
    <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 />
        </Grid.RowDefinitions>
        <Grid Name="grid_null"/>
        <StackPanel Orientation="Horizontal" Background="{StaticResource Background_Title}">
            <Button Style="{StaticResource ButtonStyle_back2}" Command="BrowseBack"/>
            <TextBlock Style="{StaticResource TextBlockStyle_Title}"  Text="{DynamicResource strReject}"/>
        </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 strRejectThreshold}" />
                    <StackPanel Orientation="Horizontal">
                        <TextBox Style="{StaticResource ResourceKey=TextBoxStyle_FieldContent}" Text="{Binding ThresholdRatio,Converter={StaticResource percentconv}}" HorizontalAlignment="Left"/>
                        <TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldContent_mm}" Text="%"/>
                    </StackPanel>
                </StackPanel>
                <StackPanel Orientation="Vertical" Margin="5">
                    <TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="{DynamicResource strRejectSigma}" />
                    <StackPanel Orientation="Horizontal">
                        <TextBox Style="{StaticResource ResourceKey=TextBoxStyle_FieldContent}" Text="{Binding Sigma, Converter={StaticResource thickconv}}" />
                    </StackPanel>
                </StackPanel>
                <StackPanel Orientation="Vertical" Margin="5">
                    <TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="{DynamicResource strMovingAverageFilters}" />
                    <StackPanel Orientation="Horizontal">
                        <TextBox Style="{StaticResource ResourceKey=TextBoxStyle_FieldContent}" Text="{Binding Range1}"  />
                        <TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldContent_mm_interval}" Text="|"/>
                        <TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldContent_mm}" >
                                        <Run>
                                            <MultiBinding Converter="{StaticResource p2mmconv}" Mode="OneWay" StringFormat="{}{0:F0}">
                                                <Binding Path="Range1" />
                                                <Binding Path="DataContext.Encoder1_mmpp" ElementName="grid_null"/>
                                            </MultiBinding>
                                        </Run>
                                        <Run Text="mm"/>
                        </TextBlock>
                    </StackPanel>

                </StackPanel>
                <StackPanel Orientation="Vertical" Margin="5">
                    <TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="{DynamicResource strRejectRadius}" />
                    <StackPanel Orientation="Horizontal">
                        <TextBox Style="{StaticResource ResourceKey=TextBoxStyle_FieldContent}" Text="{Binding Range2}" />
                        <TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldContent_mm_interval}" Text="|"/>
                        <TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldContent_mm}" >
                                        <Run>
                                            <MultiBinding Converter="{StaticResource p2mmconv}" Mode="OneWay" StringFormat="{}{0:F0}">
                                                <Binding Path="Range2" />
                                                <Binding Path="DataContext.Encoder1_mmpp" ElementName="grid_null"/>
                                            </MultiBinding>
                                        </Run>
                                        <Run Text="mm"/>
                        </TextBlock>
                    </StackPanel>

                </StackPanel>
            </WrapPanel>
        </Grid>
        <Grid Grid.Row="2" Margin="0,5,0,5">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="auto" />
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Border Width="150" Background="{StaticResource Color_theme_activity}" Margin="0,5,5,5" >
                <TextBlock Style="{StaticResource TextBlockStyle_ItemHeader}" Text="{DynamicResource strDebug}" />
            </Border>
            <Grid Grid.Column="1" Margin="5">
                <Grid.RowDefinitions>
                    <RowDefinition Height="auto"/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <WrapPanel Orientation="Horizontal" Grid.Column="1">
                    <Button Content="{DynamicResource strSave}" Style="{StaticResource ResourceKey=ButtonStyle2}" Margin="5" Height="75" Width="140" Click="button_save_Click"/>
                </WrapPanel>
                <WindowsFormsHost Grid.Row="1" Margin="5">
                    <Chr:Chart x:Name="chart1"/>
                </WindowsFormsHost>
            </Grid>

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