<dx:DXWindow x:Class="BeWo.Scheduler.View.RequestAnswerView"
             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:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
             xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
             xmlns:drawing="http://schemas.devexpress.com/winfx/2008/xaml/scheduler/internal"
             xmlns:view="clr-namespace:BeWo.Scheduler.View"
             xmlns:converter="clr-namespace:BeWo.Converter"
             mc:Ignorable="d" ShowIcon="False" MinHeight="300" MinWidth="500"
             Height="400" Width="650" dx:ThemeManager.ThemeName="Office2010Black" WindowStartupLocation="CenterScreen">
	<dx:DXWindow.Resources>
		<drawing:TimeSpanToDateTimeConverter x:Key="TimeSpanToDateTimeConverter"/>
		<view:LVItemConverter x:Key="LvItemConverter" />
		<view:OriginatorExtraxtor x:Key="OriginatorExtraxtor" />
		<converter:ObjectBoolConverter x:Key="ObjectBoolConverter" />
		<view:Int2VisibilityConverter x:Key="Int2VisibilityConverter" />
		<LinearGradientBrush x:Key="NavigationContentBrush" EndPoint="0.5,1" StartPoint="0.5,0">
			<GradientStop Color="#FF04B4D0" Offset="0" />
			<GradientStop Color="#FF038195" Offset="1" />
		</LinearGradientBrush>
	</dx:DXWindow.Resources>
    <Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="*" />
			<RowDefinition Height="Auto" />
		</Grid.RowDefinitions>
		<Grid Grid.Row="0">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="Auto" />
				<ColumnDefinition Width="*" />
			</Grid.ColumnDefinitions>
			<Grid.RowDefinitions>
				<RowDefinition Height="*" />
			</Grid.RowDefinitions>
			<ListView x:Name="OTListView" Grid.Column="0" MinWidth="120" SelectionMode="Single" Margin="3" ItemsSource="{Binding Path=OffeneTermine, UpdateSourceTrigger=PropertyChanged}" MaxWidth="300" SelectionChanged="Selector_OnSelected" Background="{StaticResource NavigationContentBrush}" SelectedIndex="0">
				<ListView.ItemContainerStyle>
					<Style TargetType="{x:Type ListViewItem}">
						<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,1,0" />
						<Setter Property="Template">
							<Setter.Value>
								<ControlTemplate>
									<Grid>
										<Border CornerRadius="5" MinHeight="20" Background="Transparent" />
										<Border x:Name="ItemBorder" CornerRadius="5" MinHeight="20" 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="20">
											<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="5,3,5,3" OpacityMask="{x:Null}" SnapsToDevicePixels="True">
												<TextBlock VerticalAlignment="Center" Text="{Binding Converter={StaticResource LvItemConverter}, ConverterParameter=LabelId}" FontSize="12" Foreground="#FFD2D2D2" FontFamily="Microsoft Sans Serif" />
											</Grid>
										</Border>
									</Grid>
									<ControlTemplate.Triggers>
										<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>
				</ListView.ItemContainerStyle>
			</ListView>
			<Grid Grid.Column="1" Grid.Row="0">
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="Auto" />
					<ColumnDefinition Width="Auto" />
					<ColumnDefinition Width="*" />
					<ColumnDefinition Width="Auto" />
				</Grid.ColumnDefinitions>
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="*" />
					<RowDefinition Height="Auto" />
				</Grid.RowDefinitions>
				<Label Grid.Column="0" Grid.Row="0" Content="Betreff" Margin="3" />
				<TextBox Grid.Column="1" Grid.ColumnSpan="3" Grid.Row="0" Height="23" Margin="3" Text="{Binding Path=SelektierterTermin.Subject}" IsReadOnly="True" />

				<Label Grid.Column="0" Grid.Row="1" Content="Ort" Margin="3" />
				<TextBox Grid.Column="1" Grid.ColumnSpan="3" Grid.Row="1" Height="23" Margin="3" Text="{Binding Path=SelektierterTermin.Location}" IsReadOnly="True" />

				<Label Grid.Column="0" Grid.Row="2" Content="Organisator" Margin="3" />
				<TextBox Grid.Column="1" Grid.ColumnSpan="3" Grid.Row="2" Height="23" Margin="3" Text="{Binding Path=SelektierterTermin, Converter={StaticResource OriginatorExtraxtor}}" IsReadOnly="True" />

				<Label Grid.Column="0" Grid.Row="3" VerticalAlignment="Center" Content="Start" Margin="3"/>
				<dxe:DateEdit Grid.Column="1" Grid.Row="3" MaskType="DateTimeAdvancingCaret" Background="White" Height="23" MinWidth="80" Margin="3" IsEnabled="False" EditValue="{Binding SelektierterTermin.Start}" IsReadOnly="True" />
				<dxe:TextEdit IsEnabled="False" Grid.Column="2" Grid.Row="3" MaskType="DateTime" Mask="t" MaskUseAsDisplayFormat="True" Margin="3" Height="23" EditValue ="{Binding SelektierterTermin.StartTime, Converter={StaticResource TimeSpanToDateTimeConverter}}" IsReadOnly="True"/>
				<dxe:CheckEdit IsEnabled="False" Grid.Column="3" Grid.Row="3" Content="Ganztägig" EditValue ="{Binding SelektierterTermin.AllDay}" HorizontalAlignment="Right" Margin="3" IsReadOnly="True" />

				<Label Grid.Column="0" Grid.Row="4" VerticalAlignment="Center" Content="Ende" Margin="3"/>
				<dxe:DateEdit IsEnabled="False" Grid.Column="1" Grid.Row="4" MaskType="DateTimeAdvancingCaret" Background="White" Height="23" MinWidth="80" Margin="3" EditValue="{Binding SelektierterTermin.End}" IsReadOnly="True" />
				<dxe:TextEdit IsEnabled="False" Grid.Column="2" Grid.Row="4" MaskType="DateTime" Mask="t" MaskUseAsDisplayFormat="True" Margin="3" Height="23" EditValue ="{Binding SelektierterTermin.EndTime, Converter={StaticResource TimeSpanToDateTimeConverter}}" IsReadOnly="True"/>

				<Label Grid.Column="0" Grid.Row="5" Margin="3" Content="Notiz"/>
				<TextBox Grid.Column="1" Grid.Row="5" Grid.ColumnSpan="3" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" 
						 VerticalAlignment="Stretch" HorizontalScrollBarVisibility="Disabled" Margin="3" TextWrapping="Wrap"
                         Text="{Binding Path=SelektierterTermin.Description}" IsReadOnly="True" />

				<StackPanel Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="4" HorizontalAlignment="Right" Orientation="Horizontal" Visibility="{Binding Path=SelektierterTermin.LabelId, Converter={StaticResource Int2VisibilityConverter}, ConverterParameter=ZusagenStack}">
					<Button Margin="3" Content="Zusagen" Click="Zusagen_OnClick" IsEnabled="{Binding SelektierterTermin, Converter={StaticResource ObjectBoolConverter}}" />
					<Button Margin="3" Content="Mit Vorbehalt" Click="MitVorbehalt_OnClick" IsEnabled="{Binding SelektierterTermin, Converter={StaticResource ObjectBoolConverter}}" />
					<Button Margin="3" Content="Absagen" Click="Absagen_OnClick" IsEnabled="{Binding SelektierterTermin, Converter={StaticResource ObjectBoolConverter}}" />
				</StackPanel>
				<Button Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="4" HorizontalAlignment="Right" Margin="3" Content="OK" Click="OK_OnClick" Visibility="{Binding Path=SelektierterTermin.LabelId, Converter={StaticResource Int2VisibilityConverter}}" />
			</Grid>
		</Grid>
		<Button Grid.Row="1" x:Name="CloseBtn" Content="Schließen" HorizontalAlignment="Right" Margin="3" Click="CloseButton_Click" />
    </Grid>
</dx:DXWindow>
