<flyctrllib:WindowBigClose x:Class="FLY.Thick.FilmCasting.UI.UiModule.WdScanMmGraphConfig"
        xmlns:flyctrllib="clr-namespace:FLY.ControlLibrary;assembly=FLY.ControlLibrary"
      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" 
            xmlns:uiModule="clr-namespace:FLY.Thick.FilmCasting.UI.UiModule"
        Title="ScanGraphConfig" SizeToContent="WidthAndHeight" d:DataContext="{d:DesignInstance uiModule:ScanGraphItemParam}" MinHeight="450" MinWidth="450" 
                           >
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Dictionary_MyStyle.xaml"/>
                <ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Converter/Dictionary_MyConv.xaml"/>
                <ResourceDictionary Source="pack://application:,,,/FLY.Thick.FilmCasting.UI;component/Themes/Styles.xaml"/>

            </ResourceDictionary.MergedDictionaries>

        </ResourceDictionary>
    </Window.Resources>

    <StackPanel Margin="{StaticResource ControlMargin}" >
        <Grid Height="20" x:Name="grid_scanGraphVm"/>
        <Grid x:Name="grid_params"/>
        <Grid x:Name="grid_param"/>
        <TabControl >
            <TabItem Header="浏览">
                <StackPanel>
                    <StackPanel Orientation="Horizontal" DataContext="{Binding ElementName=grid_scanGraphVm,Path=DataContext}">
                        <StackPanel Orientation="Horizontal">
                            <Button Style="{StaticResource Styles.Button.Icon}" Click="btnLockClick" >
                                <iconPacks:PackIconMaterial >
                                    <iconPacks:PackIconMaterial.Style>
                                        <Style TargetType="iconPacks:PackIconMaterial" BasedOn="{StaticResource Styles.Icon.Base}">
                                            <Setter Property="Kind" Value="Lock"/>
                                            <Style.Triggers>
                                                <DataTrigger Binding="{Binding IsLocked}" Value="False">
                                                    <Setter Property="Foreground" Value="Gray"/>
                                                    <Setter Property="Kind" Value="LockOff"/>
                                                </DataTrigger>
                                            </Style.Triggers>
                                        </Style>
                                    </iconPacks:PackIconMaterial.Style>
                                </iconPacks:PackIconMaterial>
                            </Button>
                            <StackPanel Margin="{StaticResource ControlMargin}">
                                <Grid HorizontalAlignment="Left">
                                    <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="记录点" />
                                    <!--当不是最新, 弹出 自动按[最新] 倒计时-->
                                    <Button Style="{StaticResource Styles.Button.Empty}" Click="btnResetNumberClick" 
                                            VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0,0,-10,-10" 
                                            Visibility="{Binding IsNewest, Converter={StaticResource visbilityconv}, ConverterParameter=HiddenWhenTrue}">
                                        <Grid Width="20" Height="20" >
                                            <Ellipse  Fill="{StaticResource Brushes.Highlight}" />
                                            <TextBlock Text="{Binding AutoKeepNewestTimeRemaining}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White"/>
                                        </Grid>
                                    </Button>
                                </Grid>
                                <StackPanel Orientation="Horizontal">
                                    <TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding Number}"  />
                                    <TextBlock Style="{StaticResource Styles.Text.FieldContent.Separator}"/>

                                    <TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}" DataContext="{Binding ElementName=grid_param,Path=DataContext}">
                                        默认值:<Run Text="{Binding Number}"/>
                                    </TextBlock>
                                </StackPanel>
                            </StackPanel>
                            <Button Style="{StaticResource Styles.Button.Icon.Rectangle}" Click="btnPreClick">
                                <iconPacks:PackIconMaterial Kind="ArrowLeft" />
                            </Button>
                            <Button Style="{StaticResource Styles.Button.Icon.Rectangle}" Click="btnNextClick">
                                <iconPacks:PackIconMaterial Kind="ArrowRight" />
                            </Button>
                            <StackPanel Margin="{StaticResource ControlMargin}" >
                                <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="步进" />
                                <StackPanel Orientation="Horizontal">
                                    <TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding NumberStep}"  />
                                </StackPanel>
                            </StackPanel>
                        </StackPanel>
                    </StackPanel>

                </StackPanel>
            </TabItem>
            <TabItem Header="视图">
                <StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <StackPanel Margin="{StaticResource ControlMargin}" >
                            <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="默认记录点" />
                            <StackPanel Orientation="Horizontal">
                                <TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding Number}"  />
                            </StackPanel>
                        </StackPanel>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" >
                        <StackPanel Margin="{StaticResource ControlMargin}">
                            <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="混合数" />
                            <StackPanel Orientation="Horizontal">
                                <TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding Mix}"  />
                            </StackPanel>
                        </StackPanel>
                        <StackPanel Margin="{StaticResource ControlMargin}">
                            <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="Y轴倍数" />
                            <StackPanel Orientation="Horizontal">
                                <TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding YRangePercent}" />
                            </StackPanel>
                        </StackPanel>
                        <StackPanel Margin="{StaticResource ControlMargin}" >
                            <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="X轴为分区" />
                            <StackPanel Orientation="Horizontal">
                                <ToggleButton Style="{StaticResource Styles.ToggleButton.YESNO}" IsChecked="{Binding IsXShowBoltNo}"/>
                            </StackPanel>
                        </StackPanel>
                        <StackPanel Margin="{StaticResource ControlMargin}" DataContext="{Binding ElementName=grid_params,Path=DataContext}">
                            <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="X轴间隔" />
                            <StackPanel Orientation="Horizontal">
                                <TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding XStep}" />
                                <TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}" Text="分区" />
                            </StackPanel>
                        </StackPanel>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <StackPanel Margin="{StaticResource ControlMargin}">
                            <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="%显示" />
                            <StackPanel Orientation="Horizontal">
                                <ToggleButton Style="{StaticResource Styles.ToggleButton.YESNO}" IsChecked="{Binding IsPercent}"/>
                            </StackPanel>
                        </StackPanel>
                        <StackPanel Margin="{StaticResource ControlMargin}" >
                            <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="自动目标值" />
                            <StackPanel Orientation="Horizontal">
                                <ToggleButton Style="{StaticResource Styles.ToggleButton.YESNO}" IsChecked="{Binding IsAutoTarget}"/>
                            </StackPanel>
                        </StackPanel>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <StackPanel Margin="{StaticResource ControlMargin}">
                            <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="曲线模式" />
                            <StackPanel Orientation="Horizontal">
                                <ToggleButton Style="{StaticResource Styles.ToggleButton.YESNO}" IsChecked="{Binding IsLineMode}"/>
                            </StackPanel>
                        </StackPanel>
                    </StackPanel>
                    <Button Style="{StaticResource Styles.Button.Apply}" Click="btnOkClick"/>
                </StackPanel>
            </TabItem>
        </TabControl>
    </StackPanel>

</flyctrllib:WindowBigClose>
