Files
BeWoPlaner/BeWo/View/Controls/ServiceRecordPopUp.xaml

198 lines
11 KiB
XML

<UserControl
x:Class="BeWo.View.Controls.ServiceRecordPopUp"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:localViewModel="clr-namespace:BeWo.ViewModel">
<Grid>
<TextBlock
Name="tb_nodata"
Padding="20"
Background="White"
FontSize="14"
Foreground="Black"
Text="Keine Eintragungen vorhanden" />
<ListBox
x:Name="serviceRecordGrid"
Grid.Row="0"
Grid.Column="1"
HorizontalContentAlignment="Stretch"
AlternationCount="-1"
Background="{x:Null}"
IsSynchronizedWithCurrentItem="True"
ItemContainerStyle="{DynamicResource serviceRecordListBoxItemStyle}"
ItemTemplate="{DynamicResource serviceRecordListBoxItemTemplate}"
ItemsSource="{Binding}"
ScrollViewer.CanContentScroll="True"
Style="{DynamicResource ServiceRecordListStyle}"
TabIndex="1">
<ListBox.Resources>
<ControlTemplate x:Key="ServiceRecordListBoxTemplate" TargetType="{x:Type ListBox}">
<Border
x:Name="Bd"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
SnapsToDevicePixels="True">
<ScrollViewer
Padding="{TemplateBinding Padding}"
Focusable="False"
HorizontalScrollBarVisibility="Disabled">
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</ScrollViewer>
</Border>
</ControlTemplate>
<Style x:Key="ServiceRecordListStyle" TargetType="{x:Type ListBox}">
<Setter Property="Template" Value="{StaticResource ServiceRecordListBoxTemplate}" />
<Setter Property="Padding" Value="2,0,2,2" />
</Style>
<Style x:Key="serviceRecordListBoxItemStyle" TargetType="{x:Type ListBoxItem}">
<Setter Property="Background" Value="#00FFFFFF" />
<Setter Property="HorizontalContentAlignment" Value="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ItemsControl}}}" />
<Setter Property="VerticalContentAlignment" Value="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ItemsControl}}}" />
<Setter Property="Padding" Value="2,0,0,0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Border
x:Name="Bd"
Padding="{TemplateBinding Padding}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
SnapsToDevicePixels="True">
<ContentPresenter
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding Content}"
ContentStringFormat="{TemplateBinding ContentStringFormat}"
ContentTemplate="{TemplateBinding ContentTemplate}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<DataTemplate x:Key="serviceRecordListBoxItemTemplate" DataType="{x:Type localViewModel:ServiceRecordVM}">
<Grid
x:Name="template"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<Border
x:Name="ItemBorder"
Width="Auto"
Height="Auto"
Margin="0,0,0,3"
Padding="6"
Background="{Binding Path=BackgroundBrush}"
BorderBrush="#FF7E7E7E"
BorderThickness="1,1,1,1"
CornerRadius="4,4,4,4">
<Grid TextBlock.Foreground="{Binding Path=TextBlock.Foreground, RelativeSource={RelativeSource TemplatedParent}}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="12" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="12" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="17" />
<RowDefinition Height="14" />
<RowDefinition Height="14" />
<RowDefinition Height="14" />
<RowDefinition Height="14" />
<RowDefinition Height="14" />
<RowDefinition Height="24" />
</Grid.RowDefinitions>
<TextBlock
Grid.Row="1"
Grid.Column="0"
Text="Minuten (gerundet):" />
<TextBlock
Grid.Row="2"
Grid.Column="0"
Text="Leistungskategorie:" />
<TextBlock
Grid.Row="3"
Grid.Column="0"
Text="Leistung:" />
<TextBlock
Grid.Row="4"
Grid.Column="0"
Text="Angelegt von:" />
<TextBlock
Grid.Row="5"
Grid.Column="0"
Text="Angelegt am:" />
<TextBlock
Grid.Row="0"
Grid.Column="0"
Grid.ColumnSpan="5"
FontSize="13"
FontWeight="Bold"
Foreground="#FF494949"
Text="{Binding Path=LongDateString}" />
<TextBlock
Grid.Row="1"
Grid.Column="2"
Background="{x:Null}"
FontWeight="Bold"
Foreground="#FF4E7BC4"
Text="{Binding Path=DurationAndRoundedDuration}" />
<TextBlock
Grid.Row="2"
Grid.Column="2"
Text="{Binding Path=Category}" />
<TextBlock
Grid.Row="3"
Grid.Column="2"
Text="{Binding Path=ServiceDescription}" />
<TextBlock
Grid.Row="4"
Grid.Column="2"
Text="{Binding Path=EmployeeName}" />
<TextBlock
Grid.Row="5"
Grid.Column="2"
Text="{Binding Path=InsertedOn}" />
<TextBox
Grid.Row="1"
Grid.RowSpan="6"
Grid.Column="4"
MaxHeight="200"
Margin="0,0,0,0"
HorizontalAlignment="Stretch"
AutoWordSelection="True"
Background="{x:Null}"
BorderBrush="{x:Null}"
BorderThickness="0"
Focusable="True"
HorizontalScrollBarVisibility="Hidden"
IsEnabled="True"
IsReadOnly="True"
SnapsToDevicePixels="True"
Tag="{Binding}"
Text="{Binding Path=Notice}"
TextWrapping="Wrap"
VerticalScrollBarVisibility="Auto" />
</Grid>
</Border>
</Grid>
<DataTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="ItemBorder" Property="Background" Value="{Binding Path=MouseOverBackgroundBrush}" />
</Trigger>
</DataTemplate.Triggers>
</DataTemplate>
</ListBox.Resources>
</ListBox>
</Grid>
</UserControl>