<UserControl x:Class="DBInStudio.Desktop.View.PermissionGroupManagerView"
             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:local="clr-namespace:DBInStudio.Desktop"
             mc:Ignorable="d" Height="436" Width="716"  >
    <UserControl.Resources>
        
       
        <DataTemplate x:Key="ListBoxItemTemplate1">
            <Label Content="{Binding Name}"/>
        </DataTemplate>
        <Style x:Key="FocusVisual">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Rectangle Margin="2" StrokeDashArray="1 2" SnapsToDevicePixels="true" StrokeThickness="1" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <SolidColorBrush x:Key="Item.MouseOver.Background" Color="#1F26A0DA"/>
        <SolidColorBrush x:Key="Item.MouseOver.Border" Color="#a826A0Da"/>
        <SolidColorBrush x:Key="Item.SelectedActive.Background" Color="#3D26A0DA"/>
        <SolidColorBrush x:Key="Item.SelectedActive.Border" Color="#FF26A0DA"/>
        <SolidColorBrush x:Key="Item.SelectedInactive.Background" Color="#3DDADADA"/>
        <SolidColorBrush x:Key="Item.SelectedInactive.Border" Color="#FFDADADA"/>
        <Style x:Key="ListBoxItemContainerStyle1" TargetType="{x:Type ListBoxItem}">
            <Setter Property="SnapsToDevicePixels" Value="True"/>
            <Setter Property="Padding" Value="4,1"/>
            <Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
            <Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderBrush" Value="Transparent"/>
            <Setter Property="IsSelected" Value="{Binding IsSelected,Mode=TwoWay}"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ListBoxItem}">
                        <Border x:Name="Bd" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="IsMouseOver" Value="True"/>
                                </MultiTrigger.Conditions>
                                <Setter Property="Background" TargetName="Bd" Value="#1FFFFFFF"/>
                                <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Item.MouseOver.Border}"/>
                            </MultiTrigger>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="Selector.IsSelectionActive" Value="False"/>
                                    <Condition Property="IsSelected" Value="True"/>
                                </MultiTrigger.Conditions>
                                <Setter Property="Background" TargetName="Bd" Value="#5FFFFFFF"/>
                                <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Item.SelectedInactive.Border}"/>
                            </MultiTrigger>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="Selector.IsSelectionActive" Value="True"/>
                                    <Condition Property="IsSelected" Value="True"/>
                                </MultiTrigger.Conditions>
                                <Setter Property="Background" TargetName="Bd" Value="#5FFFFFFF"/>
                                <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Item.SelectedActive.Border}"/>
                            </MultiTrigger>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter Property="TextElement.Foreground" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="32"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <ListBox Background="Transparent" SelectionMode="Extended" ItemContainerStyle="{DynamicResource ListBoxItemContainerStyle1}" Grid.Row="1" Margin="9,6,0,12" HorizontalAlignment="Left" Width="300" ItemsSource="{Binding SelectGroups}">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Label Content="{Binding Name}"  Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}"/>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        <ListBox  Background="Transparent" SelectionMode="Extended"  ItemContainerStyle="{DynamicResource ListBoxItemContainerStyle1}"  Grid.Row="1" Margin="408,6,0,12" HorizontalAlignment="Left" Width="300" ItemsSource="{Binding AllGroups}">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Label Content="{Binding Name}"  Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}"/>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        <Button Style="{DynamicResource ButtonStyle1}" BorderThickness="0,0,0,2" BorderBrush="Green" Content="&lt;" Command="{Binding AddCommand}" HorizontalAlignment="Left" Margin="323,104,0,0" Grid.Row="1" Width="70" VerticalAlignment="Top"/>
        <Button Style="{DynamicResource ButtonStyle1}" BorderThickness="0,0,0,2" BorderBrush="Green" Content="&lt;&lt;" Command="{Binding AddAllCommand}" HorizontalAlignment="Left" Margin="323,146,0,0" Grid.Row="1" Width="70" VerticalAlignment="Top" />
        <Button Style="{DynamicResource ButtonStyle1}" BorderThickness="0,0,0,2" BorderBrush="IndianRed" Content="&gt;" Command="{Binding RemoveCommand}" HorizontalAlignment="Left" Margin="323,186,0,0" Grid.Row="1" Width="70" VerticalAlignment="Top"/>
        <Button Style="{DynamicResource ButtonStyle1}" BorderThickness="0,0,0,2" BorderBrush="IndianRed" Content="&gt;&gt;" Command="{Binding RemoveAllCommand}" HorizontalAlignment="Left" Margin="323,221,0,0" Grid.Row="1" Width="70" VerticalAlignment="Top"/>
        <Label Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" Content="{local:ResMarker SelectGroup}" HorizontalAlignment="Left" Margin="11,0,0,0" VerticalAlignment="Center"/>
        <Label Foreground="{Binding Foreground,RelativeSource={RelativeSource AncestorType=UserControl}}" Content="{local:ResMarker AllGroup}" HorizontalAlignment="Left" Margin="410,0,0,0" VerticalAlignment="Center"/>

    </Grid>
</UserControl>
