113 lines
5.9 KiB
XML
113 lines
5.9 KiB
XML
<UserControl x:Class="BeWo.View.Controls.MultiEmployeeSelectionControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:localsearch="clr-namespace:BeWo.View.Search">
|
|
<UserControl.Resources>
|
|
<Style x:Key="MultiEmployeeSelectionControlStyle" TargetType="{x:Type ListBoxItem}">
|
|
<Setter Property="HorizontalContentAlignment" Value="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorLevel=1, AncestorType={x:Type ItemsControl}, Mode=FindAncestor}}" />
|
|
<Setter Property="VerticalContentAlignment" Value="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorLevel=1, AncestorType={x:Type ItemsControl}, Mode=FindAncestor}}" />
|
|
<Setter Property="Margin" Value="0,2,0,0" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate>
|
|
<Grid>
|
|
<Border x:Name="ItemBorder" CornerRadius="5" MinHeight="25" Background="#FF000000">
|
|
<Border.OpacityMask>
|
|
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
|
|
<GradientStop Color="#19000000" Offset="0" />
|
|
<GradientStop Color="#26000000" Offset="1" />
|
|
</LinearGradientBrush>
|
|
</Border.OpacityMask>
|
|
|
|
</Border>
|
|
|
|
|
|
<Border x:Name="ItemContent" CornerRadius="5" MinHeight="25">
|
|
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="5,3,5,3" OpacityMask="{x:Null}" SnapsToDevicePixels="True">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<TextBlock VerticalAlignment="Center" Grid.Column="0" Text="{Binding Path=SimpleDescription}" Margin="3,0,0,0" FontSize="14" Foreground="#FFD2D2D2" FontFamily="Microsoft Sans Serif" />
|
|
<Button x:Name="btnRemoveEmployee" Grid.Column="2" Grid.RowSpan="2" Width="20" Height="20" ToolTip="Mitarbeiter aus der Liste entfernen" Tag="{Binding}" Style="{DynamicResource CloseButtonStyle}" Click="btnRemoveEmployee_Click" Margin="3,0,0,0" />
|
|
</Grid>
|
|
</Border>
|
|
|
|
</Grid>
|
|
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter Property="OpacityMask" TargetName="ItemBorder">
|
|
<Setter.Value>
|
|
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
|
|
<GradientStop Color="#33000000" Offset="0" />
|
|
<GradientStop Color="#66000000" Offset="1" />
|
|
</LinearGradientBrush>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Trigger>
|
|
|
|
<Trigger Property="ListBoxItem.IsSelected" Value="True">
|
|
<Setter Property="OpacityMask" TargetName="ItemBorder">
|
|
<Setter.Value>
|
|
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
|
|
<GradientStop Color="#99000000" Offset="0" />
|
|
<GradientStop Color="#CC000000" Offset="1" />
|
|
</LinearGradientBrush>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Trigger>
|
|
<MultiTrigger>
|
|
<MultiTrigger.Conditions>
|
|
<Condition Property="ListBoxItem.IsSelected" Value="True" />
|
|
<Condition Property="Selector.IsSelectionActive" Value="False" />
|
|
</MultiTrigger.Conditions>
|
|
<Setter Property="OpacityMask" TargetName="ItemBorder">
|
|
<Setter.Value>
|
|
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
|
|
<GradientStop Color="#99000000" Offset="0" />
|
|
<GradientStop Color="#B2000000" Offset="1" />
|
|
</LinearGradientBrush>
|
|
</Setter.Value>
|
|
</Setter>
|
|
|
|
</MultiTrigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<EventSetter Event="MouseDoubleClick" Handler="DoubleClickHandler" />
|
|
</Style>
|
|
|
|
</UserControl.Resources>
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
<Label Content="Ausgewählte Mitarbeiter" FontSize="12" FontWeight="Bold" />
|
|
<Button Grid.Row="0" x:Name="btnAddEmployee" HorizontalAlignment="Right" Click="btnAddEmployee_Click" Height="21" Width="21" Margin="0,0,0,3" ToolTip="Neuen Mitarbeiter hinzufügen">
|
|
<Grid Width="18" HorizontalAlignment="Center" VerticalAlignment="Center">
|
|
<Line X1="4" X2="12" Y1="8" Y2="8" Fill="{x:Null}" Stroke="#FFFFFFFF" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeThickness="2" HorizontalAlignment="Center" VerticalAlignment="Center" Width="16" Height="16" />
|
|
<Line X1="8" X2="8" Y1="4" Y2="12" Fill="{x:Null}" Stroke="#FFFFFFFF" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeThickness="2" HorizontalAlignment="Center" VerticalAlignment="Center" Width="16" Height="16" />
|
|
</Grid>
|
|
</Button>
|
|
<ListBox Background="{DynamicResource EmployeeListBrush}" Padding="2,0,2,2"
|
|
Grid.Row="1" x:Name="listBoxEmployees" IsSynchronizedWithCurrentItem="True"
|
|
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
|
|
HorizontalContentAlignment="Stretch" ItemContainerStyle="{DynamicResource MultiEmployeeSelectionControlStyle}" >
|
|
<ListBox.Template>
|
|
<ControlTemplate TargetType="{x:Type ListBox}">
|
|
<Border x:Name="Bd" SnapsToDevicePixels="True" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}">
|
|
<ScrollViewer Focusable="False" Padding="{TemplateBinding Padding}" HorizontalScrollBarVisibility="Disabled">
|
|
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
|
</ScrollViewer>
|
|
</Border>
|
|
</ControlTemplate>
|
|
|
|
</ListBox.Template>
|
|
</ListBox>
|
|
|
|
<Popup x:Name="popupEmployees" StaysOpen="False" Placement="MousePoint" Width="350" Grid.Row="1" Height="400">
|
|
<localsearch:EmployeeSearchView ItemSelected="EmployeeSearchView_ItemSelected" x:Name="employeesearchview" />
|
|
</Popup>
|
|
</Grid>
|
|
</UserControl> |