<dialog:CustomDialog x:Class="FLY.Thick.FilmCasting.UI.DbViewer.DgSelectMonth"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
        xmlns:dialog="clr-namespace:MahApps.Metro.Controls.Dialogs;assembly=MahApps.Metro"
      xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
        mc:Ignorable="d"
        >
    <dialog:CustomDialog.Resources>

    </dialog:CustomDialog.Resources>
    <Grid >
        <Grid.Resources>
            <Style TargetType="TextBlock" x:Key="ItemHeaderStyle" BasedOn="{StaticResource ItemHeaderStyle}">
                <Setter Property="Width" Value="100"/>
                <Setter Property="Background" Value="{StaticResource MahApps.Brushes.Highlight}"/>
                <Setter Property="Foreground" Value="{StaticResource MahApps.Brushes.IdealForeground}"/>
                <Setter Property="Padding" Value="2"/>
                <Setter Property="FontSize" Value="20"/>
            </Style>
            <Style TargetType="Viewbox" x:Key="ItemContentViewboxStyle">
                <Setter Property="Width" Value="180"/>
                <Setter Property="Height" Value="30"/>
                <Setter Property="HorizontalAlignment" Value="Left"/>
            </Style>
            <Style TargetType="TextBlock" x:Key="ItemContentStyle" BasedOn="{StaticResource ItemContentStyle}">
                <Setter Property="FontSize" Value="24"/>
            </Style>

        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition/>
            <RowDefinition Height="auto"/>
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal">
            <TextBlock Text="选择数据源" Style="{StaticResource Styles.TitleBar.Text.Sub}" Foreground="Black" />
        </StackPanel>
        <StackPanel Margin="{StaticResource ControlMargin}" Grid.Row="1">
            <RadioButton Style="{StaticResource MahApps.Styles.RadioButton}" 
                         Margin="{StaticResource ControlMargin}"
                         Content="最近2个月" 
                         IsChecked="{Binding IsRecent}" 
                         GroupName="GW"/>
            <RadioButton Style="{StaticResource MahApps.Styles.RadioButton}" 
                         Margin="{StaticResource ControlMargin}"
                         Content="更早前数据" 
                         IsChecked="{Binding IsRecent, Converter={StaticResource brconv}}" 
                         GroupName="GW"/>
            <ListBox 
                Visibility="{Binding IsRecent,Converter={StaticResource visbilityconv},ConverterParameter=CollapsedWhenTrue}"
                ItemsSource="{Binding MonthPaths}" SelectedItem="{Binding Selected}" MaxHeight="100"
                />
        </StackPanel>
        <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right">

            <Button Content="取消" Command="{Binding CancelCmd}" Style="{StaticResource Styles.Button.Square2}"/>
            <Button Content="确定" Command="{Binding OkCmd}" Style="{StaticResource Styles.Button.Square.Accent2}"/>
        </StackPanel>

    </Grid>
    </dialog:CustomDialog>