<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:localView="clr-namespace:BeWo.View" xmlns:val="clr-namespace:BeWo.Validation" xmlns:uc="clr-namespace:BeWo.Controls;assembly=BeWo.Controls" Height="Auto" Width="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Focusable="True">
	<Grid>
		<uc:ShadowChrome>
			<GroupBox Style="{StaticResource MainContentGroupBoxStyle}">
				<GroupBox.Header>
					<StackPanel Orientation="Horizontal" VerticalAlignment="Bottom">
						<Image Source="..\..\Ressources\Icons\UserGroupBusinessDisabled.png" RenderTransformOrigin="0.5,0.5" Stretch="Uniform" Width="32">
							<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 Text="{Binding Path=Name, Mode=OneWay}" Margin="10,0,0,0" Background="{x:Null}" Foreground="#FFFFFFFF" FontSize="22" BorderBrush="{x:Null}" VerticalAlignment="Bottom" Padding="0,0,0,0" />
					</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 Fill="{DynamicResource UserGroupContentBrush}" Height="6" />
					<TabControl x:Name="root" Grid.Row="1" Style="{StaticResource ObjectEditTabControl}" BorderThickness="0,0,0,0" Padding="4,4,4,4">
						<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 AcceptsReturn="True" AcceptsTab="True" Grid.Row="1" Grid.Column="1" Height="80" VerticalScrollBarVisibility="Auto" Margin="3" Text="{Binding Path=Description, UpdateSourceTrigger=PropertyChanged}" />
									</Grid>
								</GroupBox>
								<GroupBox Grid.Row="1" Header="Rechte" Margin="0 20 0 0" 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 Content="zugeordnete Rechte" HorizontalAlignment="Center" Margin="0" Padding="0" VerticalAlignment="Bottom" />
										<Label Grid.Column="2" Content="verfügbare Rechte" HorizontalAlignment="Center" Margin="0" Padding="0" VerticalAlignment="Bottom" />
										<ListBox DisplayMemberPath="Value" SelectedValuePath="Key" IsSynchronizedWithCurrentItem="True" Name="listbox_rights" Grid.Row="1" Grid.RowSpan="2" Margin="3" ItemsSource="{Binding Path=Rights, Converter={StaticResource UserRightTypeConverter}}" SelectionMode="Extended" />
                                        <Button Grid.Column="1" Grid.Row="1" VerticalAlignment="Bottom" Content="&lt;" FontWeight="Bold" Width="25" Margin="3,3,3,3" Name="button_addRight" Click="button_addRight_Click" Tag="{Binding ElementName=listbox_possibleRights, Path=SelectedValues}" IsEnabled="{Binding ElementName=listbox_possibleRights, Path=SelectedValue, Converter={StaticResource ObjectBoolConverter}}" Height="25" />
                                        <Button Grid.Column="1" Grid.Row="2" VerticalAlignment="Top" Content="&gt;" FontWeight="Bold" Width="25" Margin="3" Name="button_removeRight" Click="button_removeRight_Click" Tag="{Binding ElementName=listbox_rights, Path=SelectedValues}" IsEnabled="{Binding ElementName=listbox_rights, Path=SelectedValue, Converter={StaticResource ObjectBoolConverter}}" Height="25" />
										<ListBox DisplayMemberPath="Value" SelectedValuePath="Key" Name="listbox_possibleRights" IsSynchronizedWithCurrentItem="True" Grid.Column="2" Grid.Row="1" Grid.RowSpan="2" Margin="3" ItemsSource="{Binding Path=PossibleRights, Converter={StaticResource UserRightTypeConverter}}" 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 EndPoint="0.5,1" StartPoint="0.5,0">
								<GradientStop Color="#19000000" Offset="0" />
								<GradientStop Color="#33FFFFFF" Offset="1" />
							</LinearGradientBrush>
						</Border.OpacityMask>

					</Border>
					<StackPanel Grid.ColumnSpan="3" Grid.Row="2" Orientation="Horizontal" VerticalAlignment="Center" Height="Auto" Margin="5,10,0,0" HorizontalAlignment="Right">
						<Button x:Name="btnSave" Content="Speichern" Margin="0,0,2,0" Command="ApplicationCommands.Save" Height="25" />
						<Button x:Name="btnClose" Content="Schließen" Margin="0,0,3,0" Command="ApplicationCommands.Close" Height="25" />
					</StackPanel>
				</Grid>
			</GroupBox>
		</uc:ShadowChrome>
	</Grid>
</localView:BeWoView>