WinDictAddOrEdit.xaml 3.2 KB
<win:BaseWindow  
    x:Class="HHECS.WinClient.View.SystemInfo.WinDictAddOrEdit"
    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:local="clr-namespace:HHECS.WinClient.View.SystemInfo"
    xmlns:valuerules="clr-namespace:HHECS.WinCommon.ValueRules;assembly=HHECS.WinCommon"
    xmlns:win="clr-namespace:HHECS.WinCommon.Win;assembly=HHECS.WinCommon" 
    Title="{Binding Title}" 
    Height="250" 
    Width="400" 
    d:DataContext="{d:DesignInstance Type=local:DictAddOrEditVM}"
    ResizeMode="NoResize" 
    SizeToContent="WidthAndHeight"
    mc:Ignorable="d">

    <Window.Resources>
        <Style x:Key="sp" TargetType="StackPanel">
            <Setter Property="Orientation" Value="Horizontal"/>
            <Setter Property="HorizontalAlignment" Value="Right"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="Margin" Value="10,5"/>
        </Style>
        <Style TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}">
            <Setter Property="HorizontalAlignment" Value="Center"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="Width" Value="300"/>
        </Style>
    </Window.Resources>
    <Grid x:Name="GridMain">
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" Style="{StaticResource sp}">
            <TextBlock Text="字典编码:"/>
            <TextBox>
                <TextBox.Text>
                    <Binding Path="Dict.Code">
                        <Binding.ValidationRules>
                            <valuerules:StringNotNullSpaceRule/>
                        </Binding.ValidationRules>
                    </Binding>
                </TextBox.Text>
            </TextBox>
        </StackPanel>
        <StackPanel Grid.Row="1" Style="{StaticResource sp}">
            <TextBlock Text="字典名称:"/>
            <TextBox>
                <TextBox.Text>
                    <Binding Path="Dict.Name">
                        <Binding.ValidationRules>
                            <valuerules:StringNotNullSpaceRule/>
                        </Binding.ValidationRules>
                    </Binding>
                </TextBox.Text>
            </TextBox>
        </StackPanel>
        <StackPanel Grid.Row="2" Style="{StaticResource sp}">
            <TextBlock Text="备注:"/>
            <TextBox Text="{Binding Dict.Remark}"/>
        </StackPanel>
        <StackPanel  
            Grid.Row="3" 
            Style="{StaticResource sp}">
            <Button 
                x:Name="BtnSave" 
                Content="保存" 
                Margin="0,0,10,0"
                Click="BtnSave_Click" 
                IsEnabled="{Binding Enable}"/>
            <Button 
                x:Name="BtnCancel" 
                Content="取消" 
                Click="BtnCancel_Click"/>
        </StackPanel>
    </Grid>
</win:BaseWindow>