Files
BeWoPlaner/BeWo/View/Detail/UserGroupView.xaml

221 lines
12 KiB
XML

<localView:BeWoView
x:Class="BeWo.View.Detail.UserGroupView"
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:localView="clr-namespace:BeWo.View"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:uc="clr-namespace:BeWo.Controls;assembly=BeWo.Controls"
xmlns:val="clr-namespace:BeWo.Validation"
xmlns:viewmodel="clr-namespace:BeWo.ViewModel"
Width="Auto"
Height="Auto"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
d:DataContext="{d:DesignInstance Type=viewmodel:UserGroupVM}"
Focusable="True"
mc:Ignorable="d">
<Grid>
<uc:ShadowChrome>
<GroupBox Style="{StaticResource MainContentGroupBoxStyle}">
<GroupBox.Header>
<StackPanel VerticalAlignment="Bottom" Orientation="Horizontal">
<Image
Width="32"
RenderTransformOrigin="0.5,0.5"
Source="..\..\Ressources\Icons\UserGroupBusinessDisabled.png"
Stretch="Uniform">
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="5" />
</TransformGroup>
</Image.RenderTransform>
</Image>
<TextBox
Margin="10,0,0,0"
Padding="0,0,0,0"
VerticalAlignment="Bottom"
Background="{x:Null}"
BorderBrush="{x:Null}"
FontSize="22"
Foreground="#FFFFFFFF"
Text="{Binding Path=Name, Mode=OneWay}" />
</StackPanel>
</GroupBox.Header>
<Grid Margin="0,3,0,0" Background="{DynamicResource ObjectEditBackgroundBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Rectangle Height="6" Fill="{DynamicResource UserGroupContentBrush}" />
<TabControl
x:Name="root"
Grid.Row="1"
Padding="4,4,4,4"
BorderThickness="0,0,0,0"
Style="{StaticResource ObjectEditTabControl}">
<TabItem Header="Details" IsSelected="True">
<Grid Name="grid_root">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<GroupBox Header="Details" Style="{DynamicResource ObjectEditGroupBox}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Label Content="Gruppenname" />
<TextBox
Grid.Column="1"
Height="23"
Margin="3"
Text="{val:ValidationBinding Path=Name,
UpdateSourceTrigger=PropertyChanged}" />
<Label Grid.Row="1" Content="Beschreibung" />
<TextBox
Grid.Row="1"
Grid.Column="1"
Height="80"
Margin="3"
AcceptsReturn="True"
AcceptsTab="True"
Text="{Binding Path=Description, UpdateSourceTrigger=PropertyChanged}"
VerticalScrollBarVisibility="Auto" />
</Grid>
</GroupBox>
<GroupBox
Grid.Row="1"
Margin="0,20,0,0"
Header="Rechte"
Style="{DynamicResource ObjectEditGroupBox}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Label
Margin="0"
Padding="0"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
Content="zugeordnete Rechte" />
<Label
Grid.Column="2"
Margin="0"
Padding="0"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
Content="verfügbare Rechte" />
<ListBox
Name="listbox_rights"
Grid.Row="1"
Grid.RowSpan="2"
Margin="3"
DisplayMemberPath="Value"
IsSynchronizedWithCurrentItem="True"
ItemsSource="{Binding Path=Rights, Converter={StaticResource UserRightTypeConverter}}"
SelectedValuePath="Key"
SelectionMode="Extended" />
<Button
Name="button_addRight"
Grid.Row="1"
Grid.Column="1"
Width="25"
Height="25"
Margin="3,3,3,3"
VerticalAlignment="Bottom"
Click="button_addRight_Click"
Content="&lt;"
FontWeight="Bold"
IsEnabled="{Binding ElementName=listbox_possibleRights, Path=SelectedValue, Converter={StaticResource ObjectBoolConverter}}"
Tag="{Binding ElementName=listbox_possibleRights, Path=SelectedValues}" />
<Button
Name="button_removeRight"
Grid.Row="2"
Grid.Column="1"
Width="25"
Height="25"
Margin="3"
VerticalAlignment="Top"
Click="button_removeRight_Click"
Content="&gt;"
FontWeight="Bold"
IsEnabled="{Binding ElementName=listbox_rights, Path=SelectedValue, Converter={StaticResource ObjectBoolConverter}}"
Tag="{Binding ElementName=listbox_rights, Path=SelectedValues}" />
<ListBox
Name="listbox_possibleRights"
Grid.Row="1"
Grid.RowSpan="2"
Grid.Column="2"
Margin="3"
DisplayMemberPath="Value"
IsSynchronizedWithCurrentItem="True"
ItemsSource="{Binding Path=PossibleRights, Converter={StaticResource UserRightTypeConverter}}"
SelectedValuePath="Key"
SelectionMode="Extended" />
</Grid>
</GroupBox>
</Grid>
</TabItem>
</TabControl>
<Border
Grid.Row="2"
Grid.ColumnSpan="3"
Height="40"
Margin="0,10,0,0"
VerticalAlignment="Stretch"
Background="#FF000000">
<Border.OpacityMask>
<LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
<GradientStop Offset="0" Color="#19000000" />
<GradientStop Offset="1" Color="#33FFFFFF" />
</LinearGradientBrush>
</Border.OpacityMask>
</Border>
<StackPanel
Grid.Row="2"
Grid.ColumnSpan="3"
Height="Auto"
Margin="5,10,0,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Orientation="Horizontal">
<Button
x:Name="btnSave"
Height="25"
Margin="0,0,2,0"
Command="ApplicationCommands.Save"
Content="Speichern" />
<Button
x:Name="btnClose"
Height="25"
Margin="0,0,3,0"
Command="ApplicationCommands.Close"
Content="Schließen" />
</StackPanel>
</Grid>
</GroupBox>
</uc:ShadowChrome>
</Grid>
</localView:BeWoView>