<flyctrllib:WindowBigClose x:Class="FLY.Thick.FilmCasting.UI.UiModule.WdCompareGraphConfig"
        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/Converter/Converters.xaml"/>
            </ResourceDictionary.MergedDictionaries>

        </ResourceDictionary>
    </Window.Resources>

    <StackPanel Margin="{StaticResource ControlMargin}" >
        <Grid Height="20" x:Name="grid_scanGraphVm"/>
        <Grid Height="20" x:Name="grid_graphParam"/>
        <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="记录点1" />
                                    <!--当不是最新, 弹出 自动按[最新] 倒计时-->
                                    <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}"/>
                                    <Button Style="{StaticResource Styles.Button.Empty}" Click="btnResetNumberClick">
                                        <TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}" DataContext="{Binding ElementName=grid_graphParam,Path=DataContext}">
                                        默认值:<Run Text="{Binding Number}"/>
                                        </TextBlock>
                                    </Button>
                                </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 Orientation="Horizontal" DataContext="{Binding ElementName=grid_scanGraphVm,Path=DataContext}">
                        <StackPanel Orientation="Horizontal">
                            <Button Style="{StaticResource Styles.Button.Icon}" Click="btnLock2Click" >
                                <iconPacks:PackIconMaterial >
                                    <iconPacks:PackIconMaterial.Style>
                                        <Style TargetType="iconPacks:PackIconMaterial" BasedOn="{StaticResource Styles.Icon.Base}">
                                            <Setter Property="Kind" Value="Lock"/>
                                            <Style.Triggers>
                                                <DataTrigger Binding="{Binding IsLocked2}" 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="记录点2" />
                                    <!--当不是最新, 弹出 自动按[最新] 倒计时-->
                                    <Button Style="{StaticResource Styles.Button.Empty}" Click="btnResetNumber2Click" 
                                            VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0,0,-10,-10" 
                                            Visibility="{Binding IsNewest2, Converter={StaticResource visbilityconv}, ConverterParameter=HiddenWhenTrue}">
                                        <Grid Width="20" Height="20" >
                                            <Ellipse  Fill="{StaticResource Brushes.Highlight}" />
                                            <TextBlock Text="{Binding AutoKeepNewestTimeRemaining2}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White"/>
                                        </Grid>
                                    </Button>
                                </Grid>
                                <StackPanel Orientation="Horizontal">
                                    <TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding Number2}"  />
                                    <TextBlock Style="{StaticResource Styles.Text.FieldContent.Separator}"/>
                                    <Button Style="{StaticResource Styles.Button.Empty}" Click="btnResetNumber2Click">
                                        <TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}">
                                        默认值:0
                                        </TextBlock>
                                    </Button>
                                </StackPanel>
                            </StackPanel>
                            <Button Style="{StaticResource Styles.Button.Icon.Rectangle}" Click="btnPre2Click">
                                <iconPacks:PackIconMaterial Kind="ArrowLeft" />
                            </Button>
                            <Button Style="{StaticResource Styles.Button.Icon.Rectangle}" Click="btnNext2Click">
                                <iconPacks:PackIconMaterial Kind="ArrowRight" />
                            </Button>
                        </StackPanel>
                    </StackPanel>
                </StackPanel>
            </TabItem>
            <TabItem Header="视图">
                <StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <StackPanel Margin="{StaticResource ControlMargin}" >
                            <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="默认记录点1" />
                            <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>
                    <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 Margin="{StaticResource ControlMargin}">
                            <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable.Row2}" Text="隐藏数据&#13;范围外数据" />
                            <StackPanel Orientation="Horizontal">
                                <ToggleButton Style="{StaticResource Styles.ToggleButton.YESNO}" IsChecked="{Binding IsSideCutHidden}"/>
                            </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 IsSaveLock}"/>
                            </StackPanel>
                        </StackPanel>
                    </StackPanel>

                    <Button Style="{StaticResource Styles.Button.Apply}" Click="btnOkClick"/>
                </StackPanel>
            </TabItem>
        </TabControl>
    </StackPanel>

</flyctrllib:WindowBigClose>
