<Page x:Class="FLY.Thick.Base.UI.PgReject"
      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:local="clr-namespace:FLY.Thick.Base.UI"
      xmlns:Chr="clr-namespace:System.Windows.Forms.DataVisualization.Charting;assembly=System.Windows.Forms.DataVisualization"
      mc:Ignorable="d" 
      d:DesignHeight="768" d:DesignWidth="1024"
      Background="WhiteSmoke"
      d:DataContext="{d:DesignInstance local:PgRejectVm}"
	Title="Page_Reject">
    <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>
        </ResourceDictionary>
    </Page.Resources>
    <Grid >
        <Grid.RowDefinitions>
            <RowDefinition Height="auto" />
            <RowDefinition Height="auto"/>
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid Name="grid_initparam" DataContext="{Binding InitParamService}"/>
        <StackPanel Orientation="Horizontal" Background="{StaticResource Background_Title}">
            <Button Style="{StaticResource ButtonStyle_back2}" Command="BrowseBack"/>
            <TextBlock Style="{StaticResource TextBlockStyle_Title}"  Text="剔除"/>
        </StackPanel>
        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="auto" />
                <ColumnDefinition/>
                <ColumnDefinition Width="auto" />
            </Grid.ColumnDefinitions>
            <Button Style="{StaticResource ButtonStyle_paramSection}" Command="{Binding ApplyCmd}" >
                <TextBlock Text="参数&#x000A;应用" />
            </Button>
            <WrapPanel Orientation="Horizontal" Grid.Column="1">
                <StackPanel Margin="{StaticResource ControlMargin}">
                    <TextBlock Style="{StaticResource TextBlockStyle_FieldHeaderEditable}" Text="使能" />
                    <ToggleButton Style="{StaticResource ToggleButtonStyle1}" IsChecked="{Binding Enable}" />
                </StackPanel>
                <StackPanel Margin="{StaticResource ControlMargin}">
                    <TextBlock Style="{StaticResource TextBlockStyle_FieldHeaderEditable}" Text="剔除阀值" />
                    <StackPanel Orientation="Horizontal">
                        <TextBox Style="{StaticResource TextBoxStyle_FieldContent}" Text="{Binding ThresholdRatio,Converter={StaticResource percentconv}}" />
                        <TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" Text="%"/>
                    </StackPanel>
                </StackPanel>
                <StackPanel Margin="{StaticResource ControlMargin}">
                    <TextBlock Style="{StaticResource TextBlockStyle_FieldHeaderEditable}" Text="剔除系数" />
                    <StackPanel Orientation="Horizontal">
                        <TextBox Style="{StaticResource TextBoxStyle_FieldContent}" Text="{Binding Sigma, Converter={StaticResource thickconv}}" />
                    </StackPanel>
                </StackPanel>
                <StackPanel Margin="{StaticResource ControlMargin}">
                    <TextBlock Style="{StaticResource TextBlockStyle_FieldHeaderEditable}" Text="移动滤波" />
                    <StackPanel Orientation="Horizontal">
                        <TextBox Style="{StaticResource TextBoxStyle_FieldContent}" Text="{Binding Range1}"  />
                        <TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm_interval}" Text="|"/>
                        <TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" >
                                        <Run>
                                            <MultiBinding Converter="{StaticResource p2mconv}" Mode="OneWay" StringFormat="{}{0:F0}">
                                                <Binding Path="Range1" />
                                                <Binding Path="DataContext.Encoder1_mmpp" ElementName="grid_initparam"/>
                                            </MultiBinding>
                                        </Run>
                                        <Run Text="mm"/>
                        </TextBlock>
                    </StackPanel>

                </StackPanel>
                <StackPanel Margin="{StaticResource ControlMargin}">
                    <TextBlock Style="{StaticResource TextBlockStyle_FieldHeaderEditable}" Text="剔除半径" />
                    <StackPanel Orientation="Horizontal">
                        <TextBox Style="{StaticResource TextBoxStyle_FieldContent}" Text="{Binding Range2}" />
                        <TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm_interval}" Text="|"/>
                        <TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" >
                                        <Run>
                                            <MultiBinding Converter="{StaticResource p2mmconv}" Mode="OneWay" StringFormat="{}{0:F0}">
                                                <Binding Path="Range2" />
                                                <Binding Path="DataContext.Encoder1_mmpp" ElementName="grid_initparam"/>
                                            </MultiBinding>
                                        </Run>
                                        <Run Text="mm"/>
                        </TextBlock>
                    </StackPanel>

                </StackPanel>
            </WrapPanel>
        </Grid>
        <Grid Grid.Row="2" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="auto" />
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Border Style="{StaticResource BorderStyle_paramSection}">
                <TextBlock Text="调试" />
            </Border>
            <Grid Grid.Column="1" Margin="{StaticResource ControlMargin}">
                <Grid.RowDefinitions>
                    <RowDefinition Height="auto"/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <WrapPanel Orientation="Horizontal" Grid.Column="1">
                    <Button Content="保存" Style="{StaticResource ButtonStyle2}" Margin="{StaticResource ControlMargin}" Height="75" Width="140" Command="{Binding SaveCmd}"/>
                </WrapPanel>
                <WindowsFormsHost Grid.Row="1" Margin="{StaticResource ControlMargin}">
                    <Chr:Chart x:Name="chart1"/>
                </WindowsFormsHost>
            </Grid>

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