<localSchView:AbstractAppointmentEditForm x:Class="BeWo.Scheduler.View.ResourceAppointmentEditForm"
                                          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:localSchView="clr-namespace:BeWo.Scheduler.View"
                                          xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
                                          xmlns:dxschint="http://schemas.devexpress.com/winfx/2008/xaml/scheduler/internal"
                                          xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
                                          xmlns:dxsch="http://schemas.devexpress.com/winfx/2008/xaml/scheduler"
                                          xmlns:converter="clr-namespace:BeWo.Scheduler.Converter"
                                          xmlns:search="clr-namespace:BeWo.View.Search"
                                          xmlns:controls="clr-namespace:BeWo.Controls;assembly=BeWo.Controls"
                                          mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300" MinWidth="460">
	<localSchView:AbstractAppointmentEditForm.Resources>
		<dxschint:TimeSpanToDateTimeConverter x:Key="TimeSpanToDateTimeConverter"/>
		<converter:Recurrence2GermanConverter x:Key="Recurrence2GermanConverter"/>
	</localSchView:AbstractAppointmentEditForm.Resources>
	<Grid>
		<Border CornerRadius="0 0 4 4" BorderThickness="1" BorderBrush="#FF86878F">
			<Grid HorizontalAlignment="Stretch" Background="#0C000000">
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
				</Grid.RowDefinitions>
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="Auto" />
					<ColumnDefinition Width="*" />
					<ColumnDefinition Width="150" />
				</Grid.ColumnDefinitions>

				<Label Grid.Row="0" Grid.Column="0" VerticalAlignment="Center">Kategorie</Label>
				<dxe:ComboBoxEdit Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="2" Name="ResourceCategoryComboBoxEdit" DisplayMember="TypeDescription" Height="23" Margin="3" EditValueChanged="ResourceCategoryComboBoxEdit_OnEditValueChanged" />

				<Label Grid.Row="1" Grid.Column="0" VerticalAlignment="Center">Ressource</Label>
				<dxe:ComboBoxEdit IsTextEditable="False" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="2" Name="ResourceComboBoxEdit" Padding="4,0,0,0" Height="23" Margin="3" EditValueChanged="ResourceComboBoxEdit_OnEditValueChanged" ApplyItemTemplateToSelectedItem="True">
					<dxe:ComboBoxEdit.ItemTemplate>
						<DataTemplate>
							<Grid>
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="Auto" />
									<ColumnDefinition Width="*" />
								</Grid.ColumnDefinitions>
								<Border CornerRadius="2" BorderBrush="Black" BorderThickness="1" Width="16" Height="16" Background="{Binding Path=Color, Converter={StaticResource StringBrushConverter}}" />
								<Label Grid.Column="1" Content="{Binding Name}" />
							</Grid>
						</DataTemplate>
					</dxe:ComboBoxEdit.ItemTemplate>
				</dxe:ComboBoxEdit>
				
				<Label Grid.Row="2" Grid.Column="0" VerticalAlignment="Center">Start</Label>
				<Label Grid.Row="3" Grid.Column="0" VerticalAlignment="Center">Ende</Label>

				<dxe:DateEdit MaskType="DateTimeAdvancingCaret" Grid.Row="2" Grid.Column="1" Background="White" Height="23" MinWidth="80" Margin="3" EditValue="{Binding Controller.DisplayStartDate}" />
					
				<Grid Grid.Column="2" Grid.Row="2">
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="*" />
						<ColumnDefinition Width="Auto" />
					</Grid.ColumnDefinitions>
					<dxe:TextEdit Grid.Column="0" MaskType="DateTime" Mask="t" MaskUseAsDisplayFormat="True" Margin="3" Height="23" EditValue ="{Binding Controller.DisplayStartTime, Converter={StaticResource TimeSpanToDateTimeConverter}}"/>
					<dxe:CheckEdit Grid.Column="1" Content="Ganztägig" EditValue ="{Binding Controller.AllDay}" HorizontalAlignment="Right" Margin="3" />
				</Grid>
				
				<dxe:DateEdit MaskType="DateTimeAdvancingCaret" Grid.Column="1" Grid.Row="3" MinWidth="80" Height="23" Margin="3" EditValue="{Binding Controller.DisplayEndDate}" />
				<dxe:TextEdit Grid.Column="2" Grid.Row="3" MaskType="DateTime" Mask="t" MaskUseAsDisplayFormat="True" Margin="3" Height="23" EditValue ="{Binding Controller.DisplayEndTime, Converter={StaticResource TimeSpanToDateTimeConverter}}"/>

				<Label Grid.Row="4" Grid.Column="0" Content="Mitarbeiter" />
				<dxe:ComboBoxEdit Height="23" Margin="3" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="2" IsTextEditable="False" />
				<controls:PopUpEdit Height="23" Margin="3" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="2" DeleteButtonVisibility="Collapsed" HorizontalAlignment="Stretch"
                                                IsReadOnly="True" Name="PopupeditEmployee" PopUpClick="popupedit_employee_PopUpClick" />
				<Popup Margin="10" Grid.Row="4" Grid.Column="0" Name="PopupEmployee" StaysOpen="False"
                                        Placement="MousePoint" Width="370" Height="300" >
					<search:EmployeeSearchView ItemSelected="EmployeeSearchView_EmployeeSelected" />
				</Popup>
				<Label Grid.Row="5" Grid.Column="0" Content="Notiz" />

				<TextBox Grid.Column="1" Grid.Row="5" Grid.ColumnSpan="2" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" 
                         HorizontalScrollBarVisibility="Auto" Height="45" Margin="3" 
                         Text="{Binding Path=Controller.Description, UpdateSourceTrigger=PropertyChanged}" />
				<dxe:ComboBoxEdit Grid.Row="7" Grid.Column="1" Grid.ColumnSpan="2" x:Name="EdtRecurrenceType" Margin="3"
                    ItemsSource="{Binding RecurrenceVisualController.RecurrenceElements}" 
                    EditValue="{Binding RecurrenceVisualController.RecurrenceElement, UpdateSourceTrigger=PropertyChanged}" IsTextEditable="False">
					<dxe:ComboBoxEdit.ItemTemplate>
						<DataTemplate>
							<TextBlock Text="{Binding Description, Converter={StaticResource Recurrence2GermanConverter}}" />
						</DataTemplate>
					</dxe:ComboBoxEdit.ItemTemplate>
				</dxe:ComboBoxEdit>
				<Grid Grid.Row="8" Grid.ColumnSpan="3" Grid.Column="0" Visibility="{Binding RecurrenceVisualController.EnableRecurrence, Converter={StaticResource BoolVisibilityConverter}}">
					<StackPanel >
						<dx:GroupFrame Header="Serienmuster" Margin="3">
							<StackPanel>
								<dxsch:DailyRecurrenceControl
                            Visibility="{Binding RecurrenceVisualController.IsDailyRecurrence, Converter={dxschint:BoolToVisibilityConverter}}" RecurrenceInfo="{Binding RecurrenceVisualController.RecurrenceInfo}"  />
								<dxsch:WeeklyRecurrenceControl
                            Visibility="{Binding RecurrenceVisualController.IsWeeklyRecurrence, Converter={dxschint:BoolToVisibilityConverter}}" RecurrenceInfo="{Binding RecurrenceVisualController.RecurrenceInfo}" />
								<dxsch:MonthlyRecurrenceControl x:Name="MonthlyRecurrenceControl" Visibility="{Binding RecurrenceVisualController.IsMonthlyRecurrence, Converter={dxschint:BoolToVisibilityConverter}}" RecurrenceInfo="{Binding RecurrenceVisualController.RecurrenceInfo}" />
								<dxsch:YearlyRecurrenceControl x:Name="YearlyRecurrenceControl" Visibility="{Binding RecurrenceVisualController.IsYearlyRecurrence, Converter={dxschint:BoolToVisibilityConverter}}" RecurrenceInfo="{Binding RecurrenceVisualController.RecurrenceInfo}" />
							</StackPanel>
						</dx:GroupFrame>
						<dx:GroupFrame  Header="Seriendauer" Margin="3" >
							<dxsch:RecurrenceRangeControl 
                                RecurrenceInfo="{Binding RecurrenceVisualController.RecurrenceInfo}"
                                TimeZoneHelper="{Binding ElementName=AptForm, Path=TimeZoneHelper, Mode=OneTime}"
                                Pattern="{Binding Controller.PatternCopy}" />
						</dx:GroupFrame>
					</StackPanel>
				</Grid>
				<StackPanel Grid.Row="9" Grid.ColumnSpan="3" Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,8,0,3">
					<Button Margin="3" Click="button_ok_Click" Height="25" Width="80">OK</Button>
					<Button Margin="3" Click="button_cancel_Click" Height="25" Width="80">Abbrechen</Button>
					<Button Margin="3" Click="button_delete_Click" Height="25" Width="80">Löschen</Button>
				</StackPanel>
			</Grid>
		</Border>
	</Grid>
</localSchView:AbstractAppointmentEditForm>
