Files
BeWoPlaner/BeWo/View/Controls/CompactAdditionalServiceGroupControl.xaml
2016-06-27 01:45:38 +02:00

126 lines
7.5 KiB
XML

<UserControl x:Class="BeWo.View.Controls.CompactAdditionalServiceGroupControl"
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:localsearch="clr-namespace:BeWo.View.Search" mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<UserControl.Resources>
<Style x:Key="MultiSupportConceptSelectionControlStyle" 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" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock x:Name="txtDetail1" Grid.Column="0" Grid.Row="0" Text="{Binding Path=FullName}" FontSize="12" Foreground="#FFD2D2D2" FontFamily="Microsoft Sans Serif" />
<!--<CheckBox x:Name="participatingCheckBox" Grid.Column="1" Grid.RowSpan="2" ToolTip="Anwesenheit des Klienten" Margin="3,0,20,0" VerticalAlignment="Center" />-->
<Button x:Name="btnRemoveCustomer" Grid.Column="2" Grid.RowSpan="2" Width="20" Height="20" ToolTip="Klienten aus der Gruppe entfernen" Tag="{Binding}" Style="{DynamicResource CloseButtonStyle}" Click="btnRemoveCustomer_Click" Margin="3,0,0,0" />
</Grid>
</Border>
</Grid>
<ControlTemplate.Triggers>
<DataTrigger Binding="{Binding Path=IsArchived}" Value="True">
<Setter Property="Foreground" TargetName="txtDetail1" Value="#FF808080" />
</DataTrigger>
<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>
</Style>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Label x:Name="labelTitle" Content="Gruppendetails" FontSize="12" FontWeight="Bold" />
<Button x:Name="btnAddCustomer" HorizontalAlignment="Right" Click="btnAddCustomer_Click" Height="21" Width="45" Margin="0,0,0,3" ToolTip="Neuen Klienten hinzufügen">
<StackPanel Orientation="Horizontal">
<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>
<Image Width="20" Source="/BeWoPlaner;component/Ressources/Icons/AnonymousUserDisabled.png" />
</StackPanel>
</Button>
<ListBox Background="{DynamicResource CustomerListBrush}" Padding="2,0,2,2" Grid.Row="1" x:Name="listBoxCustomers"
IsSynchronizedWithCurrentItem="True" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
HorizontalContentAlignment="Stretch" ItemContainerStyle="{DynamicResource MultiSupportConceptSelectionControlStyle}"
SelectionMode="Single" SelectionChanged="listBoxCustomers_SelectionChanged">
<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="popupCustomers" StaysOpen="False" Placement="MousePoint" Width="400" Grid.Row="2" Height="400">
<localsearch:CustomerSearchView x:Name="SearchView" ItemSelected="CustomerSearchView_ItemSelected" />
</Popup>
</Grid>
</UserControl>