blob: eaeb180ab7a32d6774a3c0b35abf03dca2a0ed42 (
plain)
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
|
<UserControl x:Class="Tango.MachineStudio.UsersAndRoles.Views.UserManagementView"
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:global="clr-namespace:Tango.MachineStudio.UsersAndRoles"
xmlns:vm="clr-namespace:Tango.MachineStudio.UsersAndRoles.ViewModels"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop"
xmlns:autoComplete="clr-namespace:Tango.AutoComplete.Editors;assembly=Tango.AutoComplete"
xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
xmlns:mahApps="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL"
xmlns:local="clr-namespace:Tango.MachineStudio.UsersAndRoles.Views"
xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
mc:Ignorable="d"
d:DesignHeight="1080" d:DesignWidth="1920" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}">
<Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="300"/>
</Grid.ColumnDefinitions>
<Grid Margin="10">
<DockPanel Margin="100" MaxWidth="1200">
<Grid DockPanel.Dock="Top">
<Grid>
<StackPanel>
<StackPanel Orientation="Horizontal">
<Image Source="../Images/user.png" Width="100" RenderOptions.BitmapScalingMode="Fant"></Image>
<TextBlock Text="{Binding ManagedUser.Contact.FullName,FallbackValue='Roy Ben Shabat'}" VerticalAlignment="Center" FontSize="30" Margin="10 0 0 0"></TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0 10 0 0">
<StackPanel>
<TextBlock FontSize="16" FontWeight="SemiBold">ADDRESS</TextBlock>
<Border Width="300" BorderThickness="1" BorderBrush="Gray" Margin="0 5 0 0" Padding="5" Height="300">
<local:AddressView FontSize="10" />
</Border>
</StackPanel>
<StackPanel Margin="10 0 0 0">
<TextBlock FontSize="16" FontWeight="SemiBold">CONTACT</TextBlock>
<Border Width="300" BorderThickness="1" BorderBrush="Gray" Margin="0 5 0 0" Padding="5" Height="300">
<local:ContactView FontSize="10" />
</Border>
</StackPanel>
</StackPanel>
</StackPanel>
</Grid>
</Grid>
<Grid DockPanel.Dock="Bottom">
<Button Margin="0 10 0 0" MinWidth="200" Height="60" Command="{Binding ManageUserCommand}" HorizontalAlignment="Right">
<StackPanel Orientation="Horizontal">
<TextBlock FontSize="18" VerticalAlignment="Center">SAVE</TextBlock>
<materialDesign:PackIcon Margin="5 0 0 0" Kind="ContentSave" Width="30" Height="30" />
</StackPanel>
</Button>
</Grid>
<Grid>
<DockPanel Margin="0 20 0 0">
<TextBlock DockPanel.Dock="Top" FontSize="16" FontWeight="SemiBold">ROLES</TextBlock>
<Grid Margin="0 5 0 0" Style="{StaticResource droppableGrid}" dragAndDrop:DragAndDropService.Drop="OnDropRole">
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Top" Foreground="Silver" FontSize="20">DRAG & DROP ROLES</TextBlock>
<Border BorderBrush="Gray" BorderThickness="1" Padding="10">
<ListBox ItemsSource="{Binding ManagedUserRoles}" ItemContainerStyle="{StaticResource basicListBoxItem}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Disabled">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate DataType="{x:Type entities:Role}">
<Grid Style="{StaticResource draggableGrid}">
<Border Margin="5" CornerRadius="5" Width="100" Height="100" BorderThickness="1" Padding="2" IsHitTestVisible="False">
<Border.Style>
<Style TargetType="Border">
<Setter Property="BorderBrush" Value="Silver"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True">
<Setter Property="BorderBrush" Value="{StaticResource AccentColorBrush}"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<Border.Background>
<LinearGradientBrush>
<GradientStop Color="White"/>
<GradientStop Color="#FFD6D6D6" Offset="1"/>
</LinearGradientBrush>
</Border.Background>
<Grid>
<TextBlock Text="{Binding Name}"></TextBlock>
</Grid>
</Border>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Border>
</Grid>
</DockPanel>
</Grid>
</DockPanel>
</Grid>
<Grid Grid.Column="1" Background="#A9FFFFFF">
<DockPanel Margin="10">
<StackPanel Orientation="Horizontal" DockPanel.Dock="Top">
<Image Source="../Images/roles.png" Width="70" RenderOptions.BitmapScalingMode="Fant"></Image>
<TextBlock FontSize="16" FontWeight="SemiBold" VerticalAlignment="Center" Margin="10 0 0 0">AVAILABLE ROLES</TextBlock>
</StackPanel>
<Grid>
<ListBox ItemsSource="{Binding Roles}" ItemContainerStyle="{StaticResource basicListBoxItem}" HorizontalContentAlignment="Stretch" Background="Transparent">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Background="Transparent" IsHitTestVisible="True" Style="{StaticResource draggableGrid}" dragAndDrop:DragAndDropService.DraggableBorderBrush="{StaticResource AccentColorBrush}" dragAndDrop:DragAndDropService.Draggable="True" dragAndDrop:DragAndDropService.DraggingSurface="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DraggingSurface}">
<DockPanel>
<Border DockPanel.Dock="Left" Width="100" Height="100" IsHitTestVisible="False" BorderBrush="Silver" BorderThickness="1" CornerRadius="5" Margin="5" Padding="2">
<Border.Background>
<LinearGradientBrush>
<GradientStop Color="White"/>
<GradientStop Color="#FFD6D6D6" Offset="1"/>
</LinearGradientBrush>
</Border.Background>
<Grid>
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Image Source="../Images/roles.png" Width="32" RenderOptions.BitmapScalingMode="Fant"></Image>
<TextBlock Text="{Binding Name}" HorizontalAlignment="Center" TextAlignment="Center" FontSize="13" FontWeight="SemiBold" Margin="5"></TextBlock>
</StackPanel>
</Grid>
</Border>
<Grid>
<ItemsControl ItemsSource="{Binding RolesPermissions}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<materialDesign:PackIcon Kind="Security" Width="16" />
<TextBlock Text="{Binding Permission.Name}"></TextBlock>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</DockPanel>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</DockPanel>
</Grid>
</Grid>
<dragAndDrop:DraggingSurface x:Name="dragSurface" />
</Grid>
</UserControl>
|