<flyctrllib:WindowBigClose x:Class="FLY.Thick.Base.UI.UiModule.FixGraphConfig"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:my="clr-namespace:FLY.ControlLibrary;assembly=FLY.ControlLibrary"
        xmlns:flyctrllib="clr-namespace:FLY.ControlLibrary;assembly=FLY.ControlLibrary"
        xmlns:local="clr-namespace:FLY.Thick.Base.UI.UiModule"
        Title="Window_graphfix"  mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
                           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" SizeToContent="WidthAndHeight"
                           d:DataContext="{d:DesignInstance local:FixGraphItemParam}">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Styles.xaml"/>
                <ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Converter/Converters.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            <local:IntMsConverter x:Key="intmsconv"/>
            <local:TimeLenConverter x:Key="timelenconv"/>

        </ResourceDictionary>
    </Window.Resources>
    <Grid TextBlock.FontSize="24" TextBlock.FontStyle="Normal">
        <Grid x:Name="grid_null" d:DataContext="{d:DesignInstance local:FixGraphConfig}"/>
        <StackPanel Orientation="Vertical" Margin="5,20">
            <StackPanel Orientation="Horizontal">
                <StackPanel Orientation="Vertical" Margin="{StaticResource ControlMargin}">
                    <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="{StaticResource str.Graph.Mix}" />
                    <StackPanel Orientation="Horizontal">
                        <TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding Mix}" />
                    </StackPanel>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <StackPanel Orientation="Vertical" Margin="{StaticResource ControlMargin}">
                        <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="{StaticResource str.Graph.Interval}" />
                        <StackPanel Orientation="Horizontal">
                            <ComboBox x:Name="combox_intervalopt" Width="140" HorizontalAlignment="Left" FontSize="{StaticResource FontSize.FieldContent}" 
                                      ItemsSource="{Binding DataContext.IntervalOpt, ElementName=grid_null}" 
                                      DisplayMemberPath="Title" SelectedValuePath="Interval" 
                                      SelectedValue="{Binding Interval}"/>
                        </StackPanel>
                    </StackPanel>
                    <StackPanel Orientation="Vertical" Margin="{StaticResource ControlMargin}">
                        <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="{StaticResource str.Graph.Count}" />
                        <StackPanel Orientation="Horizontal">
                            <ComboBox x:Name="combox_datalenopt" Width="140" HorizontalAlignment="Left" FontSize="{StaticResource FontSize.FieldContent}" 
                                          ItemsSource="{Binding DataContext.DataLenOpt, ElementName=grid_null}" 
                                          SelectedValue="{Binding Len}"/>
                            <TextBlock Style="{StaticResource Styles.Text.FieldContent.Separator}" />
                            <TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}" >
                                        <Run>
                                            <MultiBinding Converter="{StaticResource timelenconv}" Mode="OneWay" >
                                                <Binding Path="Interval" />
                                                <Binding Path="Len" />
                                            </MultiBinding>
                                        </Run>
                            </TextBlock>
                        </StackPanel>
                    </StackPanel>
                </StackPanel>
            </StackPanel>
            <StackPanel Orientation="Horizontal" >
                <StackPanel Orientation="Vertical" Margin="{StaticResource ControlMargin}">
                    <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="AD" />
                    <ToggleButton Style="{StaticResource Styles.ToggleButton.YESNO}" HorizontalAlignment="Left" IsChecked="{Binding IsADMode}" />
                </StackPanel>
                <StackPanel Orientation="Vertical" Margin="{StaticResource ControlMargin}">
                    <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="{StaticResource str.Graph.AutoYAxis}" />
                    <ToggleButton Style="{StaticResource Styles.ToggleButton.YESNO}" HorizontalAlignment="Left" IsChecked="{Binding IsAutoY}" />
                </StackPanel>
                <StackPanel Orientation="Vertical" Margin="{StaticResource ControlMargin}" Visibility="{Binding IsAutoY,Converter={StaticResource visbilityconv}, ConverterParameter=HiddenWhenTrue}">
                    <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="{StaticResource str.Graph.AutoYAxisCenter}" />
                    <ToggleButton Style="{StaticResource Styles.ToggleButton.YESNO}" HorizontalAlignment="Left" IsChecked="{Binding IsAutoTarget}" />
                </StackPanel>
            </StackPanel>
            <StackPanel Orientation="Horizontal" Visibility="{Binding IsAutoY,Converter={StaticResource visbilityconv}, ConverterParameter=HiddenWhenTrue}">
                <StackPanel Orientation="Vertical" Margin="{StaticResource ControlMargin}" Visibility="{Binding IsAutoTarget,Converter={StaticResource visbilityconv}, ConverterParameter=HiddenWhenTrue}">
                    <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="{StaticResource str.Graph.YAxisCenter}" />
                    <StackPanel Orientation="Horizontal">
                        <TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding YTarget}" />
                    </StackPanel>
                </StackPanel>
                <StackPanel Orientation="Vertical" Margin="{StaticResource ControlMargin}">
                    <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="{StaticResource str.Graph.YAxisRange}" />
                    <StackPanel Orientation="Horizontal">
                        <TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding YRange}" />
                    </StackPanel>
                </StackPanel>
            </StackPanel>
            <Button Style="{StaticResource Styles.Button.Apply}" Click="button_save_Click" />
        </StackPanel>
    </Grid>

</flyctrllib:WindowBigClose>
