<Page x:Class="ThickTcpUiInWindow.Page_BoltMapEasy"
      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:ThickTcpUiInWindow"
      xmlns:common="clr-namespace:FLY.Thick.Base.Common;assembly=FLY.Thick.Base"
      mc:Ignorable="d" 
      d:DesignHeight="768" d:DesignWidth="1024"
      Loaded="Page_Loaded" Unloaded="Page_Unloaded"
      Background="White"
	Title="Page_Boltmap">
    <Page.Resources>
        <ResourceDictionary>
            <local:BoltCntConverter x:Key="boltcntconv"/>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Dictionary_MyStyle.xaml"/>
                <ResourceDictionary Source="pack://application:,,,/ThickTcpUiInWindow;component/Converter/Dictionary_MyConv.xaml"/>
                
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Page.Resources>
    <Grid >
        <Grid.RowDefinitions>
            <RowDefinition Height="auto" />
            <RowDefinition Height="496*" />
            <RowDefinition Height="auto" />
        </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 strBoltmap}"/>
        </StackPanel>
        <StackPanel Grid.Row="1" Orientation="Vertical" >
            <Grid Margin="0,5">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="auto" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Button Style="{StaticResource ResourceKey=ButtonStyle3}" Width="150" Margin="0,5,5,5" Click="button_apply_Click" >
                    <TextBlock Style="{StaticResource TextBlockStyle_ItemHeader}" >
                        <Run Text="{DynamicResource strParam}"/><Run Text="&#x0a;"/><Run Text="{DynamicResource strApply}"/>

                    </TextBlock>
                </Button>
                <StackPanel Orientation="Vertical" Grid.Column="1">
                    
                    <StackPanel Orientation="Horizontal">
                        <StackPanel Orientation="Vertical" Margin="5">
                            <TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="{DynamicResource strBoltWidth}" />
                            <StackPanel Orientation="Horizontal">
                                <TextBox Style="{StaticResource ResourceKey=TextBoxStyle_FieldContent}" Text="{Binding BoltWidth}" />
                                <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="BoltWidth" />
                                    <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 strBoltCnt}" />
                            <StackPanel Orientation="Horizontal">
                                <TextBox Style="{StaticResource ResourceKey=TextBoxStyle_FieldContent}" Text="{Binding BoltCnt}" />
                                <TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldContent_mm_interval}" Text="|"/>
                                <TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldContent_mm}" >
                                    <Run Text="{DynamicResource strSuggest}"/><Run Text="="/>
                                    <Run >
                                        <MultiBinding Converter="{StaticResource boltcntconv}" Mode="OneWay" StringFormat="{}{0:F0}">
                                            <Binding Path="DataContext.PosLength" ElementName="grid_null"/>
                                            <Binding Path="BoltWidth" />
                                        </MultiBinding>
                                    </Run>
                            
                                </TextBlock>
                            </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}" HorizontalAlignment="Left" Text="{Binding Smooth}"/>
                                <TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldContent_mm}"  Text="{DynamicResource strBolt}" />
                            </StackPanel>
                        </StackPanel>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                    <StackPanel Orientation="Vertical" Margin="5">
                        <TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="{DynamicResource strBorderType}" />
                        <ComboBox Name="comboBox1" MinHeight="45" MinWidth="177">

                                <ComboBoxItem IsSelected="{Binding BorderType, Converter={StaticResource ResourceKey=e2bconv},ConverterParameter={x:Static common:BORDER_TYPE.Begin}}">
                                    <TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldContent}"  FontSize="32" Text="{DynamicResource strAlignAtForw}"/>
                            </ComboBoxItem>
                                <ComboBoxItem IsSelected="{Binding BorderType, Converter={StaticResource ResourceKey=e2bconv},ConverterParameter={x:Static common:BORDER_TYPE.Null}}">
                                <TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldContent}"  FontSize="32" Text="无"/>
                            </ComboBoxItem>
                        </ComboBox>
                    </StackPanel>
                        <StackPanel Orientation="Vertical" Margin="5" Visibility="{Binding BorderType, Converter={StaticResource ResourceKey=e2visconv}, ConverterParameter={x:Static common:BORDER_TYPE.Begin}}">
                            <TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="{DynamicResource strBoltNo}" />
                        <TextBox Style="{StaticResource ResourceKey=TextBoxStyle_FieldContent}" Text="{Binding BorderBoltNo_B}" />
                    </StackPanel>
                        
                    </StackPanel>

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