WinUserAddOrEdit.xaml
6.05 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<Window
x:Class="HHECS.View.UserOperation.WinUserAddOrEdit"
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"
mc:Ignorable="d"
Title="UserAddOrEdit" Height="381.2" Width="388.105" ResizeMode="NoResize">
<Window.Resources>
<Style TargetType="StackPanel">
<Setter Property="Margin" Value="10,0,20,0"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Orientation" Value="Horizontal"/>
</Style>
<Style TargetType="TextBox" BasedOn="{StaticResource TextBoxStyle}">
<Setter Property="Width" Value="80"/>
</Style>
<DataTemplate x:Key="select">
<CheckBox x:Name="ch" IsChecked="{Binding Selected}"/>
</DataTemplate>
</Window.Resources>
<Grid x:Name="GridMain">
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" Grid.Row="0" >
<TextBlock>用户编码:</TextBlock>
<TextBox x:Name="TxtUserCode" Text="{Binding UserCode,Mode=TwoWay}">
<TextBox.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="5"></Setter>
</Style>
</TextBox.Resources>
</TextBox>
</StackPanel>
<StackPanel Grid.Column="1" Grid.Row="0" >
<TextBlock>用户名:</TextBlock>
<TextBox x:Name="TxtUserName" Text="{Binding UserName,Mode=TwoWay}">
<TextBox.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="5"></Setter>
</Style>
</TextBox.Resources>
</TextBox>
</StackPanel>
<StackPanel Grid.Column="0" Grid.Row="1" >
<TextBlock>密码:</TextBlock>
<TextBox Text="{Binding Password,Mode=TwoWay}">
<TextBox.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="5"></Setter>
</Style>
</TextBox.Resources>
</TextBox>
</StackPanel>
<StackPanel Grid.Column="1" Grid.Row="1" >
<TextBlock>部门:</TextBlock>
<TextBox Text="{Binding Department,Mode=TwoWay}">
<TextBox.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="5"></Setter>
</Style>
</TextBox.Resources>
</TextBox>
</StackPanel>
<StackPanel Grid.Column="0" Grid.Row="2" >
<TextBlock>地址:</TextBlock>
<TextBox Text="{Binding Address,Mode=TwoWay}">
<TextBox.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="5"></Setter>
</Style>
</TextBox.Resources>
</TextBox>
</StackPanel>
<StackPanel Grid.Column="1" Grid.Row="2" >
<TextBlock>电话:</TextBlock>
<TextBox Text="{Binding Phone,Mode=TwoWay}">
<TextBox.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="5"></Setter>
</Style>
</TextBox.Resources>
</TextBox>
</StackPanel>
<StackPanel Grid.Column="0" Grid.Row="3" >
<TextBlock>备注:</TextBlock>
<TextBox Text="{Binding Remark,Mode=TwoWay}">
<TextBox.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="5"></Setter>
</Style>
</TextBox.Resources>
</TextBox>
</StackPanel>
<StackPanel Grid.Column="1" Grid.Row="3" >
<TextBlock>禁用:</TextBlock>
<CheckBox IsChecked="{Binding Disable,Mode=TwoWay}"></CheckBox>
</StackPanel>
<GroupBox Grid.Row="4" Grid.RowSpan="3" Grid.Column="0" Grid.ColumnSpan="2" Header="角色" Padding="5" HorizontalAlignment="Left" VerticalAlignment="Top" Width="{Binding ElementName=GridMain,Path=ActualWidth}">
<ListView x:Name="ListViewMain">
<ListView.View>
<GridView>
<GridView.Columns>
<GridViewColumn Header="选择" CellTemplate="{StaticResource select}" Width="40"/>
<GridViewColumn Header="Id" DisplayMemberBinding="{Binding Id}" Width="100"/>
<GridViewColumn Header="角色名" DisplayMemberBinding="{Binding RoleName}" Width="100"/>
</GridView.Columns>
</GridView>
</ListView.View>
</ListView>
</GroupBox>
<StackPanel Orientation="Horizontal" Grid.Row="7" Grid.Column="1">
<Button x:Name="BtnSave" Click="BtnSave_Click">保存</Button>
<Button x:Name="BtnCancel" Click="BtnCancel_Click">取消</Button>
</StackPanel>
</Grid>
</Window>