forked from emreeren/SambaPOS-3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUserRoleView.xaml
73 lines (71 loc) · 4.85 KB
/
UserRoleView.xaml
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
<UserControl x:Class="SamplePrism.Modules.UserModule.UserRoleView" 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:UIControls="clr-namespace:SamplePrism.Presentation.Controls.UIControls;assembly=SamplePrism.Presentation.Controls"
mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300">
<UserControl.Resources>
<CollectionViewSource x:Key="viewSource" Source="{Binding Permissions}">
<CollectionViewSource.GroupDescriptions>
<PropertyGroupDescription PropertyName="Category" />
</CollectionViewSource.GroupDescriptions>
</CollectionViewSource>
</UserControl.Resources>
<ScrollViewer UIControls:KineticBehaviour.HandleKineticScrolling="True" VerticalScrollBarVisibility="Auto">
<Grid>
<StackPanel>
<Label Content="{LocText UserRoleName, Suffix=':'}" />
<TextBox HorizontalAlignment="Left" MinWidth="200" Text="{Binding Name, Mode=TwoWay}" />
<Label Content="{LocText Department, Suffix=':'}" />
<ComboBox ItemsSource="{Binding Departments}" SelectedValue="{Binding DepartmentId}"
SelectedValuePath="Id" DisplayMemberPath="Name" Width="150" HorizontalAlignment="Left" />
<Label Content="{LocText Permissions,Suffix=':'}"/>
<CheckBox IsChecked="{Binding IsAdmin, Mode=TwoWay}" Content="{LocText Admin}"/>
<Border BorderThickness="1" BorderBrush="Silver" MinWidth="250" HorizontalAlignment="Left">
<ItemsControl ItemsSource="{Binding Source={StaticResource viewSource}}">
<ItemsControl.GroupStyle>
<GroupStyle>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Margin" Value="0,0,0,5" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="False" BorderBrush="#FFA4B97F" BorderThickness="0,0,0,1">
<Expander.Header>
<DockPanel>
<TextBlock FontWeight="Bold" Text="{Binding Path=Name}" Margin="5,0,0,0" Width="150" />
</DockPanel>
</Expander.Header>
<Expander.Content>
<ItemsPresenter />
</Expander.Content>
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
</ItemsControl.GroupStyle>
<ItemsControl.ItemTemplate>
<DataTemplate>
<!--<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<TextBlock VerticalAlignment="Center" Text="{Binding Title}" Grid.Column="0"></TextBlock>
<ComboBox MinWidth="60" Grid.Column="1" SelectedItem="{Binding Value}" ItemsSource="{Binding Values}"/>
</Grid>-->
<CheckBox Margin="5,0,0,0" Content="{Binding Title}" IsChecked="{Binding IsPermitted}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Border>
<Button HorizontalAlignment="Left" Margin="0,10" MinWidth="70" Content="{Binding SaveCommand.Caption}"
Command="{Binding SaveCommand}" />
<Label Content="{Binding Error}" Foreground="Red" />
</StackPanel>
</Grid>
</ScrollViewer>
</UserControl>