<fw:BaseWindow x:Class="Com.FirmLib.UI.Insuer.WinPolicyEnsure"
             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:fw="http://schemas.FWind/xaml"
             xmlns:uc="clr-namespace:Com.FirmLib.UI.Common"
             Name="this" Title="确认提示"
            Width="450" SizeToContent="Height" ResizeMode="NoResize" WindowStartupLocation="CenterOwner">
    <Grid Margin="5">
        <Grid.RowDefinitions>
            <RowDefinition Height="40"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="100"></RowDefinition>
            <RowDefinition Height="30"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <RadioButton x:Name="RdoDefault" GroupName="EditorType" VerticalAlignment="Center" Content="信息点修正值（默认）" Margin="15,5,5,5" IsChecked="{Binding Path=EditType,Converter={x:Static fw:EnumBoolConverter.Instance},ConverterParameter=Update, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
              
            </RadioButton>
            <RadioButton VerticalAlignment="Center" GroupName="EditorType" Grid.Column="1" Content="因业务或工程更新信息点值" Margin="5" IsChecked="{Binding Path=EditType,Converter={x:Static fw:EnumBoolConverter.Instance},ConverterParameter=Correct, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></RadioButton>
        </Grid>
       
        <Border Grid.Row="1" BorderBrush="Black" BorderThickness="1" Margin="3"></Border>

        <StackPanel Margin="10,0" Grid.Row="2" Visibility="{Binding IsChecked,ElementName=RdoDefault,Converter={x:Static fw:ConverterFactory.BooleanToVisibility}}">
            <TextBlock Text="值填写错误，修改当前值" TextWrapping="Wrap"></TextBlock>
        </StackPanel>
        <StackPanel Margin="10,0" Grid.Row="2" Visibility="{Binding IsChecked,ElementName=RdoDefault,Converter={x:Static fw:ConverterFactory.BoolOppositionVisibility}}">
            <TextBlock  Text="因业务变更，需更新信息点值并保存原有值，请设置新数值的生效时间" TextWrapping="Wrap"></TextBlock>

            <fw:LabelEditor Header="信息点生效时间：" Orientation="Horizontal">
                <DatePicker    Margin="5">
                    <DatePicker.SelectedDate>
                        <Binding Path="CorrectEndDate" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged" Converter="{x:Static fw:DateTimeConverter.Date}">
                            <Binding.ValidationRules>
                                <fw:RequireValidationRule ValidationStep="ConvertedProposedValue"></fw:RequireValidationRule>
                            </Binding.ValidationRules>
                        </Binding>
                    </DatePicker.SelectedDate>
                </DatePicker>
            </fw:LabelEditor>
          
        </StackPanel>
        <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Center" >
            <Button x:Name="BtnEnsure" Command="{Binding Commands.EnsureCommand}" CommandParameter="{Binding ElementName=this}"   Height="23" Padding="5,0,5,0" MinWidth="60"   Content="确定" Click="btnOK_Click">
                <Button.Style >
                    <Style TargetType="Button" BasedOn="{StaticResource ResourceKey={x:Static uc:CommonStyles.ButtonKey}}">
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding ElementName=RdoDefault,Path=IsChecked}" Value="False">

                                <Setter Property="Content"  Value="新数值即将生效，确认更新"></Setter>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>
            </Button>

        </StackPanel>
    </Grid>
</fw:BaseWindow>
