<fw:BaseWindow x:Class="Com.FirmLib.UI.Maintainer.WinMaintainerSaveEnsure"
             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"
             xmlns:dgx="urn:tom-englert.de/DataGridExtensions"
             Name="this" Title="确认提示"
            Height="350" Width="500" WindowStartupLocation="CenterOwner">
    <Grid Margin="5">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition></RowDefinition>
            <RowDefinition Height="30"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid Grid.Row="0">
            <Grid.RowDefinitions>
                <RowDefinition></RowDefinition>
                <RowDefinition></RowDefinition>
            </Grid.RowDefinitions>
            <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=Upadte, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></RadioButton>
            <RadioButton x:Name="RdoCorrect" Grid.Row="0" Grid.Column="1"  VerticalAlignment="Center" GroupName="EditorType" Content="因业务变更更新维修商" Margin="5" IsChecked="{Binding Path=EditType,Converter={x:Static fw:EnumBoolConverter.Instance},ConverterParameter=Correct, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></RadioButton>

            <fw:LabelEditor Grid.Row="1" Grid.Column="1" Header="业务变更生效时间：" Orientation="Horizontal" IsEnabled="{Binding IsChecked,ElementName=RdoCorrect}">
                <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>
        </Grid>

        <GroupBox Grid.Row="1">
            <GroupBox.Header>
                <TextBlock Text="维修商变化的资产"></TextBlock>
            </GroupBox.Header>
            <DataGrid   Margin="0,5,0,5" AutoGenerateColumns="False" SelectionMode="Single"  FrozenColumnCount="1" ItemsSource="{Binding ChangedAssetItems}"
                  CanUserAddRows="False"
                  CanUserDeleteRows="False"
                  VerticalScrollBarVisibility="Auto"
                  HorizontalScrollBarVisibility="Auto"
                  SelectionUnit="FullRow"
                  HeadersVisibility="Column" 
                  CanUserSortColumns="True"      dgx:DataGridFilter.IsAutoFilterEnabled="True"
                  CellStyle="{StaticResource ResourceKey={x:Static uc:CommonStyles.DataGridCellKey}}"
                  AlternationCount="2"
        >
                <DataGrid.RowStyle>
                    <Style TargetType="DataGridRow">
                        <Setter Property="Height" Value="30"></Setter>
                        <Style.Triggers>
                            <Trigger Property="ItemsControl.AlternationIndex"
                                 Value="0">
                                <Setter Property="Background" Value="White" />
                            </Trigger>
                            <Trigger Property="ItemsControl.AlternationIndex"
                                 Value="1">
                                <Setter Property="Background" Value="#FFE6E3DD" />
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </DataGrid.RowStyle>
                <DataGrid.Columns>
                    <fw:TDataGridTextColumn Header="资产本地编码" Width="100" IsReadOnly="True"  Binding="{Binding Path=LocalNode}"></fw:TDataGridTextColumn>
                    <fw:TDataGridTextColumn Header="资产本地名称" Width="100" IsReadOnly="True"  Binding="{Binding Path=LocalName}"></fw:TDataGridTextColumn>
                    <fw:TDataGridTextColumn Header="品牌" Width="100" IsReadOnly="True"  Binding="{Binding Path=Brand}"></fw:TDataGridTextColumn>
                    <fw:TDataGridTextColumn Header="产品名" Width="100" IsReadOnly="True"  Binding="{Binding Path=Product}"></fw:TDataGridTextColumn>
                    <fw:TDataGridTextColumn Header="型号" Width="100" IsReadOnly="True"  Binding="{Binding Path=Type}"></fw:TDataGridTextColumn>
                    <fw:TDataGridTextColumn Header="原维修商名称" Width="100" IsReadOnly="True"  Binding="{Binding Path=MaintainerName}"></fw:TDataGridTextColumn>
             
                    <fw:TDataGridTextColumn Header="原维修截止日期" Width="100" IsReadOnly="True"  Binding="{Binding Path=Name}"></fw:TDataGridTextColumn>
                </DataGrid.Columns>

            </DataGrid>
        </GroupBox>

        <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center" >
            <Button Command="{Binding Commands.EnsureCommand}" CommandParameter="{Binding ElementName=this}"  Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.ButtonKey}}"  Height="23" Width="60"   Content="确定" Click="btnOK_Click">

            </Button>

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