WinRoleAddOrEdit.xaml 3.88 KB
<Window
        x:Class="HHECS.View.UserOperation.WinRoleAddOrEdit"
        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.View.UserOperation"
        xmlns:model="clr-namespace:HHECS.Model.Entities;assembly=HHWCS.Model"
        mc:Ignorable="d"
        Title="RoleAddOrEdit" Height="331.019" Width="388.983"  ResizeMode="NoResize">
    <Window.Resources>
        <Style TargetType="StackPanel">
            <Setter Property="Orientation" Value="Horizontal"/>
            <Setter Property="HorizontalAlignment" Value="Right"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="Margin" Value="0,0,10,0"/>
        </Style>
        <Style TargetType="TextBlock">
            <Setter Property="HorizontalAlignment" Value="Center"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
        </Style>
        <Style TargetType="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 Height="50"></RowDefinition>
            <RowDefinition Height="50"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
            <RowDefinition Height="50"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0">
            <TextBlock HorizontalAlignment="Left"  TextWrapping="Wrap" Text="角色名:" VerticalAlignment="Top"/>
            <TextBox x:Name="TxtName" Text="{Binding RoleName}" HorizontalAlignment="Left" TextWrapping="Wrap"  VerticalAlignment="Top" />
        </StackPanel>
        <StackPanel Grid.Row="1">
            <TextBlock HorizontalAlignment="Left"  TextWrapping="Wrap" Text="备注:" VerticalAlignment="Top" />
            <TextBox x:Name="TxtRemark" Text="{Binding Remark}" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Top"/>

        </StackPanel>
        <TreeView x:Name="treeMain" Grid.Row="2" TreeViewItem.Selected="treeMain_Selected">
            <TreeView.ItemTemplate>
                <HierarchicalDataTemplate DataType="{x:Type model:MenuOperation}" ItemsSource="{Binding Path=Children}">
                    <StackPanel Orientation="Horizontal">
                        <CheckBox IsChecked="{Binding HasPerm,Mode=TwoWay}" Tag="{Binding Id}" Click="CheckBox_Click"></CheckBox>
                        <Image VerticalAlignment="Center" Source="{Binding Icon}" Width="16" Height="16" Margin="0,0,2,2"></Image>
                        <TextBlock VerticalAlignment="Center" Text="{Binding MenuName}"></TextBlock>
                        <Image VerticalAlignment="Center" Source="{Binding EditIcon}" Margin="2,0,0,0"></Image>
                        <StackPanel.ToolTip>
                            <TextBlock VerticalAlignment="Center" Text="{Binding Remark}" TextWrapping="Wrap" MaxWidth="200" ></TextBlock>
                        </StackPanel.ToolTip>
                    </StackPanel>
                </HierarchicalDataTemplate>
            </TreeView.ItemTemplate>
        </TreeView>
        <StackPanel Grid.Row="3" HorizontalAlignment="Right">
            <Button x:Name="BtnUpdate" Click="BtnUpdate_Click" Content="刷新" HorizontalAlignment="Left"  VerticalAlignment="Top"/>
            <Button x:Name="BtnSave" Click="BtnSave_Click" Content="保存" HorizontalAlignment="Left"  VerticalAlignment="Top"/>
            <Button x:Name="BtnCancel" Click="BtnCancel_Click" Content="取消" HorizontalAlignment="Left"  VerticalAlignment="Top"/>
        </StackPanel>
    </Grid>
</Window>