RoleAddOrEditView.xaml 3.58 KB
<Window
    x:Class="HHECS.RobotTool.View.AccountView.RoleAddOrEditView"
    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:hc="https://handyorg.github.io/handycontrol"
    xmlns:local="clr-namespace:HHECS.RobotTool.View.AccountView"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:viewmodel="clr-namespace:HHECS.RobotTool.ViewModel.AccountVM"
    Title="新增角色"
    Width="800"
    Height="450"
    d:DataContext="{d:DesignInstance Type=viewmodel:RoleAddOrEditVM}"
    WindowStartupLocation="CenterScreen"
    mc:Ignorable="d">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="50" />
        </Grid.RowDefinitions>
        <hc:UniformSpacingPanel
            Grid.Row="0"
            ChildWrapping="Wrap"
            Orientation="Horizontal"
            Spacing="10">
            <TextBox
                MinWidth="260"
                hc:InfoElement.Necessary="True"
                hc:InfoElement.Title="角色编码"
                hc:InfoElement.TitlePlacement="Left"
                hc:InfoElement.TitleWidth="70"
                Style="{StaticResource TextBoxExtend}"
                Text="{Binding Role.Code, UpdateSourceTrigger=PropertyChanged}" />
            <TextBox
                MinWidth="260"
                hc:InfoElement.Necessary="True"
                hc:InfoElement.Title="角色名称"
                hc:InfoElement.TitlePlacement="Left"
                hc:InfoElement.TitleWidth="70"
                Style="{StaticResource TextBoxExtend}"
                Text="{Binding Role.Name, UpdateSourceTrigger=PropertyChanged}" />
            <TextBox
                MinWidth="260"
                hc:InfoElement.Necessary="False"
                hc:InfoElement.Title="备注"
                hc:InfoElement.TitlePlacement="Left"
                hc:InfoElement.TitleWidth="70"
                Style="{StaticResource TextBoxExtend}"
                Text="{Binding Role.Description, UpdateSourceTrigger=PropertyChanged}" />
        </hc:UniformSpacingPanel>
        <GroupBox
            Grid.Row="1"
            Padding="5"
            Header="权限"
            Style="{StaticResource GroupBoxTab.Small}">
            <Border Background="{DynamicResource RegionBrush}" CornerRadius="4">
                <TreeView ItemsSource="{Binding Permissions}" Style="{StaticResource TreeView.Small}">
                    <TreeView.ItemTemplate>
                        <HierarchicalDataTemplate ItemsSource="{Binding Children}">
                            <CheckBox Content="{Binding Name}" IsChecked="{Binding CurrentNodeIsChanged}" />
                        </HierarchicalDataTemplate>
                    </TreeView.ItemTemplate>
                </TreeView>
            </Border>
        </GroupBox>
        <hc:UniformSpacingPanel
            Grid.Row="2"
            HorizontalAlignment="Center"
            Spacing="60">
            <Button
                hc:IconElement.Geometry="{StaticResource SaveGeometry}"
                Command="{Binding SaveCommand}"
                Content="保存"
                Style="{StaticResource ButtonPrimary}" />
            <Button
                hc:IconElement.Geometry="{StaticResource CloseGeometry}"
                Command="{Binding CancelCommand}"
                Content="取消"
                Style="{StaticResource ButtonDefault}" />
        </hc:UniformSpacingPanel>
    </Grid>
</Window>