<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.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>


								<!--<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"/>-->

								<!--<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" />

							</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>

						</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>

						<TextBox Grid.Row="1" HorizontalAlignment="Stretch" x:Name="mailTextBox" VerticalAlignment="Stretch" AcceptsReturn="True" AcceptsTab="True" />

						<GroupBox Padding="7" Style="{StaticResource ObjectEditGroupBox}" Header="Anhang Hinzufügen" Grid.Row="2">
							<!--<Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>

                                <Label Grid.Row="1" Content="Datei"/>
                                <uc:PopUpEdit Name="popupedit_file" Grid.Column="1"  Margin="3" Height="23" Grid.Row="1" DeleteButtonVisibility="Collapsed" PopUpClick="popupedit_file_PopUpClick"/>
                                <Label Grid.Row="1" Grid.Column="2" Content="Beschreibung"/>
                                <TextBox  Name="textbox_fileNotice" Margin="3" Height="23" Grid.Row="1" Grid.Column="3"/>
                                <Button IsEnabled="False"  Name="button_uploadDocument" Margin="3" Height="25" Grid.Row="1" Grid.Column="4" Click="button_uploadDocument_Click" Content="Datei hinzufügen"/>

                                <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.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="1" Grid.Column="0" Content="Beschreibung" />
									<TextBox Name="fileNoticeTextbox" Margin="3" Height="23" Grid.Row="1" Grid.Column="1" />

									<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>

								<ListBox MinWidth="128" IsSynchronizedWithCurrentItem="True" Name="attachmentList" Grid.Column="1" />

							</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>

				</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>

		<!--/uc:ShadowChrome-->
	</Grid>
</localView:BeWoView>