Files
6098/Cowain.Bake.UI/UserManagerment/Views/AuthorityManagementView.xaml

39 lines
2.3 KiB
XML

<UserControl x:Class="Cowain.Bake.UI.UserManagerment.Views.AuthorityManagementView"
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:Cowain.Bake.UI.UserManagerment.Views"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="180"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<ListBox Grid.Column="0" ItemsSource="{Binding RoleList}" DisplayMemberPath="RoleName" SelectedItem="{Binding SelectedRole,Mode=TwoWay}" SelectedIndex="0">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding ListBoxSelectionChangedCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</ListBox>
<StackPanel Grid.Column="1" Orientation="Vertical" Background="#f1f2f6">
<TreeView ItemsSource="{Binding AuthorityList}" Height="342">
<TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding Children}">
<StackPanel x:Name="stackPanel" Orientation="Horizontal">
<CheckBox FontSize="14" x:Name="checkBox1"
IsChecked="{Binding IsHasAuthority,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Tag="{Binding TargetView}" Visibility="{Binding CheckboxVisibility}"/>
<TextBlock Text="{Binding Header}" FontSize="14" Margin="8,0,0,0"/>
</StackPanel>
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>
</TreeView>
<Button Content="保存" HorizontalAlignment="Left" Style="{StaticResource ButtonInfo}" Width="60" Margin="5" Command="{Binding SaveCommand}"/>
</StackPanel>
</Grid>
</UserControl>