WinRoleAddOrEdit.xaml
3.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<base:BaseWindow
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:base ="clr-namespace:HHECS.View.Win"
xmlns:model="clr-namespace:HHECS.Model;assembly=HHECS.Model"
mc:Ignorable="d"
Title="RoleAddOrEdit" Height="331.019" Width="388.983" Closing="Window_Closing" 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>
</base:BaseWindow>