<UserControl x:Class="MECF.Framework.UI.Client.CenterViews.Maintain.ViewModels.MaintainItemSettingView"
             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:local="clr-namespace:MECF.Framework.UI.Client.CenterViews.Maintain"
             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
             xmlns:micro="clr-namespace:Caliburn.Micro"
             xmlns:diag="clr-namespace:System.Diagnostics;assembly=WindowsBase"
             d:DesignHeight="1024"
             d:DesignWidth="1900"
             mc:Ignorable="d">
    <UserControl.Resources>
    </UserControl.Resources>
    <Border Height="480" Width="1000" BorderBrush="{DynamicResource Color_BD_Logoff}" BorderThickness="5" Background="{DynamicResource Color_BG_Logoff}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="2*"/>
                <RowDefinition Height="2*"/>
                <RowDefinition Height="4*"/>
                <RowDefinition Height="4*"/>
                <RowDefinition Height="2*"/>
                <RowDefinition Height="2*"/>
            </Grid.RowDefinitions>
            <Grid Grid.Row="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"/>
                    <ColumnDefinition Width="2*"/>
                    <ColumnDefinition Width="2*"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" FontSize="24" HorizontalAlignment="Center" VerticalAlignment="Center">
                    <!--不要换行否则文本会有间距-->
                    <Run Text="Item" Typography.Variants="Subscript"/><Run FontSize="16" Text="*" BaselineAlignment="TextTop" Foreground="Red"/><Run Text=":" Typography.Variants="Subscript"/>
                </TextBlock>
                <ComboBox Grid.Column="1" Margin="0,5,0,5" FontSize="24" 
                          Text="{Binding ItemInfo.ParentName,UpdateSourceTrigger=PropertyChanged}"
                          VerticalAlignment="Center" IsEditable="True" 
                          ItemsSource="{Binding ParentNames}">
                    <ComboBox.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding }" FontSize="24" VerticalAlignment="Center"/>
                        </DataTemplate>
                    </ComboBox.ItemTemplate>
                </ComboBox>
                <TextBlock Grid.Column="2" Text="{Binding ItemInfo.UID,StringFormat=UID:{0}}" FontSize="20" HorizontalAlignment="Left" VerticalAlignment="Center"/>
            </Grid>
            <Grid Grid.Row="1" DataContext="{Binding ItemInfo}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="2*"/>
                    <ColumnDefinition Width="3*"/>
                    <ColumnDefinition Width="2*"/>
                    <ColumnDefinition Width="3*"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center">
                    <!--不要换行否则文本会有间距-->
                    <Run Text="Name" Typography.Variants="Subscript"/><Run FontSize="16" Text="*" BaselineAlignment="TextTop" Foreground="Red"/><Run Text=":" Typography.Variants="Subscript"/>
                </TextBlock>
                <TextBox Grid.Column="1" Text="{Binding Name}" Margin="0,10,0,10"
                         Width="{Binding RelativeSource={RelativeSource AncestorType=Grid,AncestorLevel=1},Path=ColumnDefinitions[1].ActualWidth}"
                         Background="White" Foreground="Black" FontSize="16" HorizontalAlignment="Center"/>
                <TextBlock Grid.Column="2" FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center" Text="Index:"/>
                <TextBlock Grid.Column="3" FontSize="20" Width="80" HorizontalAlignment="Left" VerticalAlignment="Center" Text="{Binding Index}"/>
            </Grid>
            <Grid Grid.Row="2" DataContext="{Binding ItemInfo}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="4*"/>
                    <ColumnDefinition Width="1*"/>
                    <ColumnDefinition Width="20*"/>
                    <ColumnDefinition Width="2*"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" Text="Description:" FontSize="20" HorizontalAlignment="Left" VerticalAlignment="Top"/>
                <TextBox Grid.Column="2" Text="{Binding Description,Mode=TwoWay}" 
                         Width="{Binding RelativeSource={RelativeSource AncestorType=Grid,AncestorLevel=1},Path=ColumnDefinitions[2].ActualWidth}" 
                         Background="White" Foreground="Black" FontSize="16" HorizontalAlignment="Right" 
                         TextWrapping="Wrap"
                         VerticalScrollBarVisibility="Auto"
                         AcceptsReturn="True"/>
            </Grid>
            <Grid Grid.Row="3" DataContext="{Binding ItemInfo}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="4*"/>
                    <ColumnDefinition Width="12*"/>
                    <ColumnDefinition Width="5*"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" Text="DefaultRecord:" FontSize="20" HorizontalAlignment="Left" VerticalAlignment="Top"/>
                <TextBox Grid.Column="1" Text="{Binding DefaultRecord,Mode=TwoWay}" 
             Width="{Binding RelativeSource={RelativeSource AncestorType=Grid,AncestorLevel=1},Path=ColumnDefinitions[1].ActualWidth}" 
             Background="White" Foreground="Black" FontSize="16" HorizontalAlignment="Right" 
             TextWrapping="Wrap"
             VerticalScrollBarVisibility="Auto"
             AcceptsReturn="True"/>
            </Grid>
            <Grid Grid.Row="4" DataContext="{Binding ItemInfo}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="auto"/>
                    <ColumnDefinition Width="3*"/>
                    <ColumnDefinition Width="3*"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" Text="FileName(With suffix):" FontSize="20" HorizontalAlignment="Left" VerticalAlignment="Center"/>
                <TextBox Grid.Column="1" Text="{Binding FilePath}" Margin="0,10,0,10"
                         Width="{Binding RelativeSource={RelativeSource AncestorType=Grid,AncestorLevel=1},Path=ColumnDefinitions[1].ActualWidth}"
                         Background="White" Foreground="Black" FontSize="20" HorizontalAlignment="Center"/>
            </Grid>
            <Grid Grid.Row="5">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>
                <Button Content="Cancel" Grid.Column="0" Width="120" Height="50">
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="Click">
                            <micro:ActionMessage MethodName="NGExit">
                            </micro:ActionMessage>
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                </Button>
                <Button Content="OK" Grid.Column="1" Width="120" Height="50">
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="Click">
                            <micro:ActionMessage MethodName="OKExit">
                            </micro:ActionMessage>
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                </Button>
            </Grid>
        </Grid>
    </Border>
</UserControl>
