Context Menu nur wenn commands vorhanden

This commit is contained in:
2026-06-12 12:13:46 +02:00
parent 5f0358f424
commit 42ae76db4b
5 changed files with 540 additions and 263 deletions

View File

@@ -1,5 +1,7 @@
using System;
using System.Collections;
using System.Globalization;
using System.Linq;
using System.Windows;
using System.Windows.Data;
@@ -11,7 +13,22 @@ namespace BeWo.Converter
{
try
{
var count = (int) value;
int count;
switch (value)
{
case int i:
count = i;
break;
case ICollection collection:
count = collection.Count;
break;
case IEnumerable enumerable:
count = enumerable.Cast<object>().Count();
break;
default:
return false;
}
if (parameter is string s && s == "reverse")
{

View File

@@ -1,5 +1,7 @@
using System;
using System.Collections;
using System.Globalization;
using System.Linq;
using System.Windows;
using System.Windows.Data;
@@ -11,7 +13,22 @@ namespace BeWo.Converter
{
try
{
var count = (int)value;
int count;
switch (value)
{
case int i:
count = i;
break;
case ICollection collection:
count = collection.Count;
break;
case IEnumerable enumerable:
count = enumerable.Cast<object>().Count();
break;
default:
return Visibility.Collapsed;
}
if (parameter is string s && s == "reverse")
{

View File

@@ -151,7 +151,8 @@
<Grid
Margin="0,0,60,0"
HorizontalAlignment="Left"
Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType=ItemsControl}}">
Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType=ItemsControl}}"
ContextMenuService.IsEnabled="{Binding DataContext.AssistentCommands, Converter={StaticResource CollectionCountToBoolConverter}, RelativeSource={RelativeSource AncestorType=ItemsControl}}">
<Grid.ContextMenu>
<ContextMenu ItemsSource="{Binding PlacementTarget.Tag.AssistentCommands, RelativeSource={RelativeSource Self}}">
<ContextMenu.ItemContainerStyle>

View File

@@ -1,114 +1,211 @@
<localView:BeWoView x:Class="BeWo.View.Detail.SendMailView" 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:proxy="clr-namespace:BeWo.ServiceProxy" xmlns:uc="clr-namespace:BeWo.Controls;assembly=BeWo.Controls" xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" Height="Auto" Width="Auto" HorizontalAlignment="Stretch" xmlns:s="clr-namespace:System;assembly=mscorlib" VerticalAlignment="Stretch" Focusable="True" xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" xmlns:localSearchView="clr-namespace:BeWo.View.Search">
<localView:BeWoView.Resources>
<Style x:Key="ButtonFocusVisual">
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="2" SnapsToDevicePixels="true" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="WarningButton" TargetType="{x:Type Button}">
<Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}" />
<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}" />
<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Padding" Value="1" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Image Width="16" Height="16" Source="..\..\Ressources\Icons\warning-16x16.png" />
<ControlTemplate.Triggers>
<Trigger Property="IsKeyboardFocused" Value="true" />
<Trigger Property="ToggleButton.IsChecked" Value="true" />
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="#ADADAD" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<localView:BeWoView
x:Class="BeWo.View.Detail.SendMailView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:localSearchView="clr-namespace:BeWo.View.Search"
xmlns:localView="clr-namespace:BeWo.View"
xmlns:proxy="clr-namespace:BeWo.ServiceProxy"
xmlns:s="clr-namespace:System;assembly=mscorlib"
xmlns:uc="clr-namespace:BeWo.Controls;assembly=BeWo.Controls"
xmlns:val="clr-namespace:BeWo.Validation"
Width="Auto"
Height="Auto"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Focusable="True">
<localView:BeWoView.Resources>
<Style x:Key="ButtonFocusVisual">
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle
Margin="2"
SnapsToDevicePixels="true"
Stroke="Black"
StrokeDashArray="1 2"
StrokeThickness="1" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="WarningButton" TargetType="{x:Type Button}">
<Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}" />
<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}" />
<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Padding" Value="1" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Image
Width="16"
Height="16"
Source="..\..\Ressources\Icons\warning-16x16.png" />
<ControlTemplate.Triggers>
<Trigger Property="IsKeyboardFocused" Value="true" />
<Trigger Property="ToggleButton.IsChecked" Value="true" />
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="#ADADAD" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</localView:BeWoView.Resources>
<Grid Width="Auto" Height="Auto">
<!--uc:ShadowChrome-->
<GroupBox Style="{StaticResource PopUpWindowStyle}">
<GroupBox.Header>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,0,0">
<Image Source="..\..\Ressources\Icons\Email.png" RenderTransformOrigin="0.5,0.5" Width="Auto" Height="28" Margin="0,0,0,0">
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Image.RenderTransform>
</Image>
<TextBox Text="Mail senden" Margin="10,4,0,0" Background="{x:Null}" Foreground="{DynamicResource MainGroupBoxForegroundBrush}" FontSize="20" BorderBrush="{x:Null}" VerticalAlignment="Stretch" BorderThickness="0,0,0,0" Padding="0,0,0,0" />
</StackPanel>
</GroupBox.Header>
<Grid Margin="0,3,0,0" Background="{StaticResource ObjectEditBackgroundBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Rectangle Fill="{DynamicResource ServiceRecordContentBrush}" Height="6" />
<Grid x:Name="rootGrid" Grid.Row="1" Margin="10,10,10,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<!--<ColumnDefinition Width="Auto"/>-->
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
</localView:BeWoView.Resources>
<Grid Width="Auto" Height="Auto">
<!-- uc:ShadowChrome -->
<GroupBox Style="{StaticResource PopUpWindowStyle}">
<GroupBox.Header>
<StackPanel
Margin="0,0,0,0"
VerticalAlignment="Center"
Orientation="Horizontal">
<Image
Width="Auto"
Height="28"
Margin="0,0,0,0"
RenderTransformOrigin="0.5,0.5"
Source="..\..\Ressources\Icons\Email.png">
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Image.RenderTransform>
</Image>
<TextBox
Margin="10,4,0,0"
Padding="0,0,0,0"
VerticalAlignment="Stretch"
Background="{x:Null}"
BorderBrush="{x:Null}"
BorderThickness="0,0,0,0"
FontSize="20"
Foreground="{DynamicResource MainGroupBoxForegroundBrush}"
Text="Mail senden" />
</StackPanel>
</GroupBox.Header>
<Grid Margin="0,3,0,0" Background="{StaticResource ObjectEditBackgroundBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Rectangle Height="6" Fill="{DynamicResource ServiceRecordContentBrush}" />
<Grid
x:Name="rootGrid"
Grid.Row="1"
Margin="10,10,10,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<!--<ColumnDefinition Width="Auto"/>-->
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<!--<Label Content="An:" HorizontalAlignment="Left" Grid.Column="0" Grid.Row="0" Margin="0 0 0 10" />-->
<Button Content="An:" HorizontalAlignment="Left" Grid.Column="0" Grid.Row="0" Margin="0 0 0 10" Click="AddButton_Click" />
<!--<TextBox x:Name="receiverTextBox" VerticalAlignment="Stretch" Grid.Column="1" Grid.Row="0" PreviewKeyDown="receiverTextBox_KeyDown"/>-->
<WrapPanel Name="receiverWrapPanel" VerticalAlignment="Stretch" Grid.Column="1" Grid.Row="0" />
<!--<Button Content="Hinzufügen" HorizontalAlignment="Right" Grid.Column="2" Grid.Row="0" Margin="10,0,0,0" Click="AddButton_Click"/>-->
<!--<Label Content="An:" HorizontalAlignment="Left" Grid.Column="0" Grid.Row="0" Margin="0 0 0 10" />-->
<Button
Grid.Row="0"
Grid.Column="0"
Margin="0,0,0,10"
HorizontalAlignment="Left"
Click="AddButton_Click"
Content="An:" />
<!--<TextBox x:Name="receiverTextBox" VerticalAlignment="Stretch" Grid.Column="1" Grid.Row="0" PreviewKeyDown="receiverTextBox_KeyDown"/>-->
<WrapPanel
Name="receiverWrapPanel"
Grid.Row="0"
Grid.Column="1"
VerticalAlignment="Stretch" />
<!--<Button Content="Hinzufügen" HorizontalAlignment="Right" Grid.Column="2" Grid.Row="0" Margin="10,0,0,0" Click="AddButton_Click"/>-->
<!--<uc:PopUpEdit Margin="3" Grid.Column="3" DeleteButtonVisibility="Collapsed" HorizontalAlignment="Stretch" IsReadOnly="True" Name="popupedit_employee" PopUpClick="popupedit_employee_PopUpClick" />-->
<!--<uc:PopUpEdit Margin="3" Grid.Column="3" DeleteButtonVisibility="Collapsed" HorizontalAlignment="Stretch" IsReadOnly="True" Name="popupedit_employee" PopUpClick="popupedit_employee_PopUpClick" />-->
<Label Content="Betreff:" HorizontalAlignment="Left" Grid.Column="0" Grid.Row="1" />
<TextBox x:Name="subjectTextBox" VerticalAlignment="Stretch" Grid.Column="1" Grid.Row="1" />
<Label
Grid.Row="1"
Grid.Column="0"
HorizontalAlignment="Left"
Content="Betreff:" />
<TextBox
x:Name="subjectTextBox"
Grid.Row="1"
Grid.Column="1"
VerticalAlignment="Stretch" />
</Grid>
<WrapPanel Margin="0 10 0 10">
<RadioButton GroupName="priorityGroup" IsChecked="False" Name="lowPriorityRadioButton">Nidrige Priorität</RadioButton>
<RadioButton GroupName="priorityGroup" IsChecked="True" Name="normalPriorityRadioButton" Margin="10 0 10 0">Normale Priorität</RadioButton>
<RadioButton GroupName="priorityGroup" IsChecked="False" Name="highPriorityRadioButton">Hohe Priorität</RadioButton>
</WrapPanel>
</Grid>
<WrapPanel Margin="0,10,0,10">
<RadioButton
Name="lowPriorityRadioButton"
GroupName="priorityGroup"
IsChecked="False">
Nidrige Priorität
</RadioButton>
<RadioButton
Name="normalPriorityRadioButton"
Margin="10,0,10,0"
GroupName="priorityGroup"
IsChecked="True">
Normale Priorität
</RadioButton>
<RadioButton
Name="highPriorityRadioButton"
GroupName="priorityGroup"
IsChecked="False">
Hohe Priorität
</RadioButton>
</WrapPanel>
</StackPanel>
</StackPanel>
<Popup Margin="10" Grid.Row="2" Name="popup_employee" StaysOpen="False" Placement="MousePoint" Width="370" Height="250" Closed="popup_Closed" Opened="popup_Opened">
<localSearchView:EmployeeSearchView ItemSelected="EmployeeSearchView_EmployeeSelected" />
</Popup>
<Popup
Name="popup_employee"
Grid.Row="2"
Width="370"
Height="250"
Margin="10"
Closed="popup_Closed"
Opened="popup_Opened"
Placement="MousePoint"
StaysOpen="False">
<localSearchView:EmployeeSearchView ItemSelected="EmployeeSearchView_EmployeeSelected" />
</Popup>
<TextBox Grid.Row="1" HorizontalAlignment="Stretch" x:Name="mailTextBox" VerticalAlignment="Stretch" AcceptsReturn="True" AcceptsTab="True" />
<TextBox
x:Name="mailTextBox"
Grid.Row="1"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
AcceptsReturn="True"
AcceptsTab="True" />
<GroupBox Padding="7" Style="{StaticResource ObjectEditGroupBox}" Header="Anhang Hinzufügen" Grid.Row="2">
<!--<Grid>
<GroupBox
Grid.Row="2"
Padding="7"
Header="Anhang Hinzufügen"
Style="{StaticResource ObjectEditGroupBox}">
<!--<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
@@ -131,64 +228,124 @@
<ListBox VerticalAlignment="Bottom" Height="48" IsSynchronizedWithCurrentItem="True" Name="attachmentList" Grid.Row="2" Grid.ColumnSpan="5"/>
</Grid>-->
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid Grid.Column="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid Grid.Column="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0" Content="Datei" />
<uc:PopUpEdit IsReadOnly="True" Name="popupedit_file" Grid.Row="0" Grid.Column="1" Margin="3" Height="23" DeleteButtonVisibility="Collapsed" PopUpClick="popupedit_file_PopUpClick" />
<Label
Grid.Row="0"
Grid.Column="0"
Content="Datei" />
<uc:PopUpEdit
Name="popupedit_file"
Grid.Row="0"
Grid.Column="1"
Height="23"
Margin="3"
DeleteButtonVisibility="Collapsed"
IsReadOnly="True"
PopUpClick="popupedit_file_PopUpClick" />
<Label Grid.Row="1" Grid.Column="0" Content="Beschreibung" />
<TextBox Name="fileNoticeTextbox" Margin="3" Height="23" Grid.Row="1" Grid.Column="1" />
<Label
Grid.Row="1"
Grid.Column="0"
Content="Beschreibung" />
<TextBox
Name="fileNoticeTextbox"
Grid.Row="1"
Grid.Column="1"
Height="23"
Margin="3" />
<Grid Grid.Row="2" Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Button HorizontalAlignment="Left" Name="button_uploadDocument" Margin="3" Height="25" Grid.Column="0" Click="button_uploadDocument_Click" Content="Datei hinzufügen" />
<Button HorizontalAlignment="Left" Name="button_removeAttachment" Margin="3" Height="25" Grid.Column="1" Click="button_removeAttachment_Click" Content="Anhang entfernen" />
</Grid>
</Grid>
<Grid Grid.Row="2" Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Button
Name="button_uploadDocument"
Grid.Column="0"
Height="25"
Margin="3"
HorizontalAlignment="Left"
Click="button_uploadDocument_Click"
Content="Datei hinzufügen" />
<Button
Name="button_removeAttachment"
Grid.Column="1"
Height="25"
Margin="3"
HorizontalAlignment="Left"
Click="button_removeAttachment_Click"
Content="Anhang entfernen" />
</Grid>
</Grid>
<ListBox MinWidth="128" IsSynchronizedWithCurrentItem="True" Name="attachmentList" Grid.Column="1" />
<ListBox
Name="attachmentList"
Grid.Column="1"
MinWidth="128"
IsSynchronizedWithCurrentItem="True" />
</Grid>
</Grid>
</GroupBox>
</Grid>
</GroupBox>
</Grid>
</Grid>
<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>
</Grid>
<Border
Grid.Row="2"
Grid.ColumnSpan="3"
Height="40"
Margin="0,10,0,0"
VerticalAlignment="Stretch"
Background="#FF000000">
<Border.OpacityMask>
<LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
<GradientStop Offset="0" Color="#19000000" />
<GradientStop Offset="1" Color="#33FFFFFF" />
</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="Senden und schließen" Margin="0,0,3,0" Command="ApplicationCommands.Save" Height="25" />
<Button x:Name="btnClose" Content="Abbrechen" Margin="0,0,3,0" Command="ApplicationCommands.Close" Height="25" />
</StackPanel>
</Grid>
</GroupBox>
</Border>
<StackPanel
Grid.Row="2"
Grid.ColumnSpan="3"
Height="Auto"
Margin="5,10,0,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Orientation="Horizontal">
<Button
x:Name="btnSave"
Height="25"
Margin="0,0,3,0"
Command="ApplicationCommands.Save"
Content="Senden und schließen" />
<Button
x:Name="btnClose"
Height="25"
Margin="0,0,3,0"
Command="ApplicationCommands.Close"
Content="Abbrechen" />
</StackPanel>
</Grid>
</GroupBox>
<!--/uc:ShadowChrome-->
</Grid>
<!-- /uc:ShadowChrome -->
</Grid>
</localView:BeWoView>

View File

@@ -1,130 +1,215 @@
<localView:BeWoView x:Class="BeWo.View.Detail.ViewMailView" 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:proxy="clr-namespace:BeWo.ServiceProxy" xmlns:uc="clr-namespace:BeWo.Controls;assembly=BeWo.Controls" xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" Height="Auto" Width="Auto" HorizontalAlignment="Stretch" xmlns:s="clr-namespace:System;assembly=mscorlib" VerticalAlignment="Stretch" Focusable="True" xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" xmlns:localSearchView="clr-namespace:BeWo.View.Search">
<localView:BeWoView.Resources>
<Style x:Key="ButtonFocusVisual">
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="2" SnapsToDevicePixels="true" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="WarningButton" TargetType="{x:Type Button}">
<Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}" />
<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}" />
<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Padding" Value="1" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Image Width="16" Height="16" Source="..\..\Ressources\Icons\warning-16x16.png" />
<ControlTemplate.Triggers>
<Trigger Property="IsKeyboardFocused" Value="true" />
<Trigger Property="ToggleButton.IsChecked" Value="true" />
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="#ADADAD" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<localView:BeWoView
x:Class="BeWo.View.Detail.ViewMailView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:localSearchView="clr-namespace:BeWo.View.Search"
xmlns:localView="clr-namespace:BeWo.View"
xmlns:proxy="clr-namespace:BeWo.ServiceProxy"
xmlns:s="clr-namespace:System;assembly=mscorlib"
xmlns:uc="clr-namespace:BeWo.Controls;assembly=BeWo.Controls"
xmlns:val="clr-namespace:BeWo.Validation"
Width="Auto"
Height="Auto"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Focusable="True">
<localView:BeWoView.Resources>
<Style x:Key="ButtonFocusVisual">
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle
Margin="2"
SnapsToDevicePixels="true"
Stroke="Black"
StrokeDashArray="1 2"
StrokeThickness="1" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="WarningButton" TargetType="{x:Type Button}">
<Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}" />
<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}" />
<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Padding" Value="1" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Image
Width="16"
Height="16"
Source="..\..\Ressources\Icons\warning-16x16.png" />
<ControlTemplate.Triggers>
<Trigger Property="IsKeyboardFocused" Value="true" />
<Trigger Property="ToggleButton.IsChecked" Value="true" />
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="#ADADAD" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</localView:BeWoView.Resources>
<Grid Width="Auto" Height="Auto">
<!--uc:ShadowChrome-->
<GroupBox Style="{StaticResource PopUpWindowStyle}">
<GroupBox.Header>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,0,0">
<Image Source="..\..\Ressources\Icons\Email.png" RenderTransformOrigin="0.5,0.5" Width="Auto" Height="28" Margin="0,0,0,0">
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Image.RenderTransform>
</Image>
<TextBox Text="Mail-Ansicht" Margin="10,5,0,0" Background="{x:Null}" Foreground="{DynamicResource MainGroupBoxForegroundBrush}" FontSize="20" BorderBrush="{x:Null}" VerticalAlignment="Stretch" BorderThickness="0,0,0,0" Padding="0,0,0,0" />
</StackPanel>
</GroupBox.Header>
<Grid Margin="0,3,0,0" Background="{StaticResource ObjectEditBackgroundBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Rectangle Fill="{DynamicResource ServiceRecordContentBrush}" Height="6" />
<Grid x:Name="rootGrid" Grid.Row="1" Margin="10,10,10,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
</localView:BeWoView.Resources>
<Grid Width="Auto" Height="Auto">
<!-- uc:ShadowChrome -->
<GroupBox Style="{StaticResource PopUpWindowStyle}">
<GroupBox.Header>
<StackPanel
Margin="0,0,0,0"
VerticalAlignment="Center"
Orientation="Horizontal">
<Image
Width="Auto"
Height="28"
Margin="0,0,0,0"
RenderTransformOrigin="0.5,0.5"
Source="..\..\Ressources\Icons\Email.png">
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Image.RenderTransform>
</Image>
<TextBox
Margin="10,5,0,0"
Padding="0,0,0,0"
VerticalAlignment="Stretch"
Background="{x:Null}"
BorderBrush="{x:Null}"
BorderThickness="0,0,0,0"
FontSize="20"
Foreground="{DynamicResource MainGroupBoxForegroundBrush}"
Text="Mail-Ansicht" />
</StackPanel>
</GroupBox.Header>
<Grid Margin="0,3,0,0" Background="{StaticResource ObjectEditBackgroundBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Rectangle Height="6" Fill="{DynamicResource ServiceRecordContentBrush}" />
<Grid
x:Name="rootGrid"
Grid.Row="1"
Margin="10,10,10,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Label Content="Von:" HorizontalAlignment="Left" Grid.Column="0" Grid.Row="0" />
<TextBox x:Name="senderTextBox" VerticalAlignment="Stretch" Grid.Column="1" Grid.Row="0" IsReadOnly="True" />
<!--<Button Content="Hinzufügen" HorizontalAlignment="Right" Grid.Column="2" Grid.Row="0" Margin="10,0,0,0" Click="AddButton_Click"/>-->
<Label
Grid.Row="0"
Grid.Column="0"
HorizontalAlignment="Left"
Content="Von:" />
<TextBox
x:Name="senderTextBox"
Grid.Row="0"
Grid.Column="1"
VerticalAlignment="Stretch"
IsReadOnly="True" />
<!--<Button Content="Hinzufügen" HorizontalAlignment="Right" Grid.Column="2" Grid.Row="0" Margin="10,0,0,0" Click="AddButton_Click"/>-->
<Label Content="Betreff:" HorizontalAlignment="Left" Grid.Column="0" Grid.Row="1" />
<TextBox x:Name="subjectTextBox" VerticalAlignment="Stretch" Grid.Column="1" Grid.Row="1" IsReadOnly="True" />
<Label
Grid.Row="1"
Grid.Column="0"
HorizontalAlignment="Left"
Content="Betreff:" />
<TextBox
x:Name="subjectTextBox"
Grid.Row="1"
Grid.Column="1"
VerticalAlignment="Stretch"
IsReadOnly="True" />
</Grid>
<!--<WrapPanel Margin="0 10 0 10">
</Grid>
<!--<WrapPanel Margin="0 10 0 10">
<RadioButton GroupName="priorityGroup" IsChecked="False" Name="lowPriorityRadioButton">Nidrige Priorität</RadioButton>
<RadioButton GroupName="priorityGroup" IsChecked="True" Name="normalPriorityRadioButton" Margin="10 0 10 0">Normale Priorität</RadioButton>
<RadioButton GroupName="priorityGroup" IsChecked="False" Name="highPriorityRadioButton">Hohe Priorität</RadioButton>
</WrapPanel>-->
<Label Margin="0 10 0 10" Name="priorityLabel" />
<Label Name="priorityLabel" Margin="0,10,0,10" />
</StackPanel>
</StackPanel>
<TextBox Grid.Row="1" HorizontalAlignment="Stretch" x:Name="mailTextBox" VerticalAlignment="Stretch" IsReadOnly="True" />
<TextBox
x:Name="mailTextBox"
Grid.Row="1"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
IsReadOnly="True" />
<!--<TextBox Grid.Row="2" x:Name="attachmentTextBox" IsReadOnly="True"/>-->
<WrapPanel Grid.Row="2" x:Name="attachmentWrapPanel">
<Label Margin="0 5 5 0">Anhänge:</Label>
</WrapPanel>
</Grid>
<!--<TextBox Grid.Row="2" x:Name="attachmentTextBox" IsReadOnly="True"/>-->
<WrapPanel x:Name="attachmentWrapPanel" Grid.Row="2">
<Label Margin="0,5,5,0">Anhänge:</Label>
</WrapPanel>
</Grid>
</Grid>
<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>
</Grid>
<Border
Grid.Row="2"
Grid.ColumnSpan="3"
Height="40"
Margin="0,10,0,0"
VerticalAlignment="Stretch"
Background="#FF000000">
<Border.OpacityMask>
<LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
<GradientStop Offset="0" Color="#19000000" />
<GradientStop Offset="1" Color="#33FFFFFF" />
</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="Senden und schließen" Margin="0,0,3,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>
</Border>
<StackPanel
Grid.Row="2"
Grid.ColumnSpan="3"
Height="Auto"
Margin="5,10,0,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Orientation="Horizontal">
<!--<Button x:Name="btnSave" Content="Senden und schließen" Margin="0,0,3,0" Command="ApplicationCommands.Save" Height="25" />-->
<Button
x:Name="btnClose"
Height="25"
Margin="0,0,3,0"
Command="ApplicationCommands.Close"
Content="Schließen" />
</StackPanel>
</Grid>
</GroupBox>
<!--/uc:ShadowChrome-->
</Grid>
<!-- /uc:ShadowChrome -->
</Grid>
</localView:BeWoView>