<flyctrllib:WindowBigClose  x:Class="FLY.Thick.FilmCasting.UI.UiModule.TrendGraphConfig"
        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/Themes/Dictionary_MyStyle.xaml"/>
                <ResourceDictionary Source="pack://application:,,,/FLY.Thick.Base.UI;component/Converter/Dictionary_MyConv.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>

    <Grid Background="White">
        <Grid x:Name="grid_trend"/>
        <StackPanel Margin="{StaticResource ControlMargin}">
            <Grid Height="20"/>
            <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 Orientation="Horizontal" >

                <StackPanel Margin="5">
                    <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="5">
                    <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="5">
                    <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"/>
        </StackPanel>
    </Grid>

</flyctrllib:WindowBigClose >