<flyctrllib:WindowBigClose  x:Class="FLY.Thick.FilmCasting.UI.UiModule.TrendGraph2Config"
        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"
        mc:Ignorable="d" 
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
        xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
        xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
        SizeToContent="WidthAndHeight"  MinHeight="450" MinWidth="450"
        >
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Converter/Converters.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>

    <Grid Background="White">
        <Grid x:Name="grid_trend"/>
        <StackPanel Margin="{StaticResource ControlMargin}">
            <Grid Height="20"/>
            <GroupBox>
                <GroupBox.Header>
                    <TextBlock Style="{StaticResource Styles.Text.FieldHeader}" Text="纵向图"/>
                </GroupBox.Header>
                <StackPanel>
                    <StackPanel Orientation="Horizontal" Margin="{StaticResource ControlMargin}" DataContext="{Binding DataContext,ElementName=grid_trend}">
                        <DatePicker 
                            Width="200"
                            Margin="{StaticResource ControlMargin}"
                            Height="auto"
                            HorizontalAlignment="Center"
                            HorizontalContentAlignment="Stretch"
                            controls:TextBoxHelper.UseFloatingWatermark="True"
                            controls:TextBoxHelper.Watermark="开始日期"
                            controls:TextBoxHelper.WatermarkAlignment="Right" 
                                        SelectedDate="{Binding SearchTime}"/>
                        <Button Style="{StaticResource Styles.Button.Icon.Rectangle}" Click="btnSeachClick">
                            <iconPacks:PackIconMaterial Kind="Magnify" />
                        </Button>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" DataContext="{Binding DataContext,ElementName=grid_trend}">

                        <Button Style="{StaticResource Styles.Button.Icon.Rectangle}" Click="btnPreClick">
                            <iconPacks:PackIconMaterial Kind="ArrowLeft" />
                        </Button>
                        <StackPanel VerticalAlignment="Center">
                            <TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}" >
                        <Run Text="最新ID:"/><Run Text="{Binding NewestId,Mode=OneWay}"/>
                            </TextBlock>
                            <TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}" >
                        <Run Text="当前ID:"/><Run Text="{Binding Id,Mode=OneWay}"/>
                            </TextBlock>
                        </StackPanel>
                        <Button Click="btnNextClick">
                            <Button.Style>
                                <Style TargetType="Button" BasedOn="{StaticResource Styles.Button.Icon.Rectangle}">
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding IsNewest}" Value="True">
                                            <Setter Property="Foreground" Value="Gray"/>
                                            <Setter Property="IsEnabled" Value="False"/>
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </Button.Style>
                            <iconPacks:PackIconMaterial Kind="ArrowRight" />
                        </Button>
                        <Button Click="btnNewestClick">
                            <Button.Style>
                                <Style TargetType="Button" BasedOn="{StaticResource Styles.Button.Icon.Rectangle}">
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding IsNewest}" Value="True">
                                            <Setter Property="Foreground" Value="Gray"/>
                                            <Setter Property="IsEnabled" Value="False"/>
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </Button.Style>
                            <Grid>
                                <iconPacks:PackIconMaterial Kind="ArrowCollapseRight" />
                                <!--当不是最新, 弹出 自动按[最新] 倒计时-->
                                <Grid Width="20" Height="20" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0,0,-5,-5" >
                                    <Grid.Style>
                                        <Style TargetType="Grid">
                                            <Style.Triggers>
                                                <DataTrigger Binding="{Binding IsNewest}" Value="True">
                                                    <Setter Property="Visibility" Value="Hidden"/>
                                                </DataTrigger>
                                            </Style.Triggers>
                                        </Style>
                                    </Grid.Style>
                                    <Ellipse  Fill="#FFFF3535" />
                                    <TextBlock Text="{Binding AutoKeepNewestTimeRemaining}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White"/>
                                </Grid>
                            </Grid>
                        </Button>
                        <TextBlock Style="{StaticResource Styles.Text.FieldContent}" Text="更新中" Visibility="{Binding IsLoading,Converter={StaticResource visbilityconv}}"/>
                        <Button Click="btnLastClick">
                            <Button.Style>
                                <Style TargetType="Button" BasedOn="{StaticResource Styles.Button.Icon}">
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding IsNewest}" Value="False">
                                            <Setter Property="Foreground" Value="Gray"/>
                                            <Setter Property="IsEnabled" Value="False"/>
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </Button.Style>
                            <StackPanel>
                                <iconPacks:PackIconMaterial Kind="AutoFix" />
                                <TextBlock Text="最后一卷"/>
                            </StackPanel>

                        </Button>
                    </StackPanel>
                </StackPanel>
            </GroupBox>

            <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="间隔" />
                    <StackPanel Orientation="Horizontal">
                        <TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding Interval}"  />
                    </StackPanel>
                </StackPanel>
            </StackPanel>

            <Button Style="{StaticResource Styles.Button.Apply}" Click="btnOkClick"/>
            <GroupBox>
                <GroupBox.Header>
                    <TextBlock Style="{StaticResource Styles.Text.FieldHeader}" Text="扫描图"/>
                </GroupBox.Header>
                <StackPanel Orientation="Horizontal" DataContext="{Binding DataContext,ElementName=grid_trend}">

                    <Button Click="btnPreSelectedClick">
                        <Button.Style>
                            <Style TargetType="Button" BasedOn="{StaticResource Styles.Button.Icon.Rectangle}">
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding CanSelested}" Value="False">
                                        <Setter Property="Foreground" Value="Gray"/>
                                        <Setter Property="IsEnabled" Value="False"/>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Button.Style>
                        <iconPacks:PackIconMaterial Kind="ArrowLeft" />
                    </Button>
                    <Button Click="btnNextSelectedClick">
                        <Button.Style>
                            <Style TargetType="Button" BasedOn="{StaticResource Styles.Button.Icon.Rectangle}">
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding CanSelested}" Value="False">
                                        <Setter Property="Foreground" Value="Gray"/>
                                        <Setter Property="IsEnabled" Value="False"/>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Button.Style>
                        <iconPacks:PackIconMaterial Kind="ArrowRight" />
                    </Button>
                </StackPanel>
            </GroupBox>


        </StackPanel>
    </Grid>

</flyctrllib:WindowBigClose >