<localView:BeWoView x:Class="BeWo.View.Detail.ServiceRecordGroupEditView" 
                    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:localViewControls="clr-namespace:BeWo.View.Controls" 
                    xmlns:val="clr-namespace:BeWo.Validation" 
                    xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
                    Height="Auto" Width="Auto" 
                    HorizontalAlignment="Stretch" VerticalAlignment="Stretch" 
                    Focusable="True">
    <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\HistoryDisabled.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="Gruppenbuchung bearbeiten" 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.ColumnDefinitions>
							<ColumnDefinition Width="*" />
						</Grid.ColumnDefinitions>
						<Grid.RowDefinitions>
							<RowDefinition Height="Auto" />
							<RowDefinition Height="*" />
						</Grid.RowDefinitions>

						<Grid>
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="250" />
								<ColumnDefinition Width="250" />
								<ColumnDefinition Width="*" />
							</Grid.ColumnDefinitions>
							<Grid.RowDefinitions>
								<RowDefinition Height="Auto" />
								<RowDefinition Height="*" />
							</Grid.RowDefinitions>

							<localViewControls:MultiSupportConceptSelectionControl Margin="0,3,0,3" x:Name="multiSupportConceptControl" MinHeight="100" MaxHeight="200" />
							<localViewControls:MultiEmployeeSelectionControl Grid.Column="1" Margin="5,3,0,3" x:Name="multiEmployeeControl" MinHeight="100" MaxHeight="200" />

                            <Grid Grid.Column="2" Grid.RowSpan="2" VerticalAlignment="Top" Margin="5,0,0,0">
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="Auto" MinWidth="57" />
									<ColumnDefinition Width="Auto" />
								</Grid.ColumnDefinitions>
								<Grid.RowDefinitions>
									<RowDefinition Height="Auto" />
									<RowDefinition Height="Auto" />
									<RowDefinition Height="Auto" MinHeight="24" />
									<RowDefinition Height="Auto" MinHeight="24" />
									<RowDefinition Height="Auto" />
									<RowDefinition Height="Auto" />
									<RowDefinition Height="Auto" />
                  <RowDefinition Height="Auto" />
                  <RowDefinition Height="Auto" />
								</Grid.RowDefinitions>
								<!--<Label Grid.Column="0" Grid.Row="1" Content="Ziele" Visibility="{Binding Path=IsGoalTreeVisible, Converter={StaticResource BoolVisibilityConverter}}" />
                                <TreeView x:Name="treeview_Goals" Grid.Column="1"  Grid.Row="1" Margin="3,0,3,3" ItemsSource="{Binding Path=GoalTree}" Visibility="{Binding Path=IsGoalTreeVisible, Converter={StaticResource BoolVisibilityConverter}}" ItemContainerStyle="{DynamicResource goal_treeitemstyle}" ItemTemplate="{DynamicResource goal_treeitemtemplate}" Grid.RowSpan="1" MinHeight="24" MaxHeight="100"  >
                                    <TreeView.Resources>
                                        <Style x:Key="goal_treeitemstyle" TargetType="TreeViewItem">
                                            <Setter Property="IsExpanded" Value="{Binding Path=IsExpanded, Mode=TwoWay}" />
                                        </Style>
                                        <HierarchicalDataTemplate x:Key="goal_treeitemtemplate" DataType="{x:Type proxy:SupportConceptGoalDC}" ItemsSource="{Binding Path=Children}" >
                                            <Grid >
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="Auto"/>
                                                    <ColumnDefinition Width="Auto"/>
                                                </Grid.ColumnDefinitions>
                                                <CheckBox x:Name="Bd" Tag="{Binding}" IsChecked="{Binding Path=IsChecked}" Visibility="{Binding Path=HasParent, Converter={StaticResource BoolVisibilityConverter}}" Grid.Column="0" Margin="3 2" VerticalAlignment="Center"/>
                                                <TextBlock x:Name="BdText" Tag="{Binding}" Grid.Column="1" Margin="3 2" Text="{Binding Path=Name}" VerticalAlignment="Center" />
                                            </Grid>
                                        </HierarchicalDataTemplate>
                                    </TreeView.Resources>
                                </TreeView>-->
								<Label Grid.Column="0" Grid.Row="2" Content="Kategorie" />
								<ComboBox Grid.Column="1" Grid.Row="2" SelectedItem="{val:ValidationBinding Path=Category, Mode=TwoWay}" ItemsSource="{Binding Path=SortedCategories}" SelectedIndex="0" x:Name="combobox_category" Margin="3,0,3,3" Height="23" />
								<Label Grid.Column="0" Grid.Row="3" Content="Leistung" />
								<ComboBox Grid.Column="1" Grid.Row="3" SelectedItem="{val:ValidationBinding Path=ServiceDescription, Mode=TwoWay}" ItemsSource="{Binding Path=PossibleServiceDescriptions}" SelectedIndex="0" x:Name="combobox_services" Margin="3,0,3,3" Height="23" />
								<Label Grid.Column="0" Grid.Row="4" Content="Startdatum" />
                                <dxe:DateEdit MaskType="DateTimeAdvancingCaret" Grid.Column="1" Grid.Row="4" EditValue="{val:ValidationBinding Mode=TwoWay, Path=Date}" Height="23" Margin="3,0,3,3" />
							
                <Label Grid.Column="0" Grid.Row="5" Content="Enddatum"  x:Name="EndDateLabel"/>
                                <dxe:DateEdit MaskType="DateTimeAdvancingCaret" x:Name="datepicker_newEndDate" Grid.Column="1" Grid.Row="5" EditValue="{val:ValidationBinding Mode=TwoWay, Path=EditableEndDate}" Height="23" Margin="3,0,3,3" />
								
                              
                <Label Grid.Column="0" Grid.Row="6" Content="Startzeit" />
								<Grid Grid.Column="1" Grid.Row="6">
									<Grid.ColumnDefinitions>
										<ColumnDefinition Width="60" />
										<ColumnDefinition Width="*" />
										<ColumnDefinition Width="60" />
									</Grid.ColumnDefinitions>
                                    <dxe:TextEdit MaskType="RegEx" Mask="(0?\d|1\d|2[0-3]):[0-5]\d" ShowError="False" MaskShowPlaceHolders="True"  MaskUseAsDisplayFormat="True" InvalidValueBehavior="AllowLeaveEditor" EditValue="{Binding Mode=TwoWay, Path=StartTimeEditString, UpdateSourceTrigger=PropertyChanged}" x:Name="startTime" Height="23" Margin="3,0,3,3" />
                                    <Label Grid.Column="1" Content="Endzeit" />
                                    <dxe:TextEdit MaskType="RegEx" Mask="(0?\d|1\d|2[0-3]):[0-5]\d" ShowError="False" MaskShowPlaceHolders="True"  MaskUseAsDisplayFormat="True" InvalidValueBehavior="AllowLeaveEditor" EditValue="{Binding Mode=TwoWay, Path=EndTimeEditString, UpdateSourceTrigger=PropertyChanged}" Grid.Column="2" x:Name="endTime" Height="23" Margin="3,0,3,3" />
								</Grid>
								<Grid Grid.Column="1" Grid.Row="7">
									<Grid.ColumnDefinitions>
										<ColumnDefinition Width="60" />
										<ColumnDefinition Width="*" />
										<ColumnDefinition Width="60" />
									</Grid.ColumnDefinitions>
									<Grid.RowDefinitions>
										<RowDefinition Height="Auto" />
										<RowDefinition Height="Auto" />
									</Grid.RowDefinitions>
									<Label Content="Dauer (min)" Grid.Column="1" />
                                    <dxe:SpinEdit MinValue="0" Increment="5" AllowNullInput="False" x:Name="numerictb_duration" EditValue="{Binding Mode=TwoWay, Path=Duration, Converter={StaticResource Int2DecimalConverter}, UpdateSourceTrigger=PropertyChanged}" Grid.Column="2" Height="23" Margin="3,0,3,3" />
									<Label Grid.Row="1" Content="Gefahrene Kilometer" Grid.Column="0" Grid.ColumnSpan="2" x:Name="lblDistance" HorizontalAlignment="Right"/>
									<dxe:SpinEdit Grid.Row="1" Increment="5" MinValue="0" IsFloatValue="False" AllowNullInput="False" x:Name="numerictb_distance" EditValue="{Binding Mode=TwoWay, Path=DistanceInMeter, Converter={StaticResource Int2DecimalConverter}}" Grid.Column="2" Height="23" Margin="3,0,3,3" />
								</Grid>
                                <CheckBox x:Name="EditOnlyThisRecord" Grid.Row="7" Visibility="Collapsed">Nur diesen Eintrag bearbeiten</CheckBox>
							</Grid>
						</Grid>
						<Grid Grid.Row="1" Margin="0,0,0,0">
							<Grid.RowDefinitions>
								<RowDefinition Height="Auto" />
								<RowDefinition Height="*" />
							</Grid.RowDefinitions>

							<!--<Label Grid.Row="0" VerticalAlignment="Top" Content="Dokumentation" HorizontalAlignment="Left" Margin="0,-5,0,0" x:Name="DokuLabel" />-->

              <TabControl Grid.Row="1" >

                <TabItem Header="Notice1" IsSelected="True" x:Name="TabItem1_Notice">
                  <TextBox x:Name="TextboxNotice"
                              Text="{val:ValidationBinding Path=Notice, UpdateSourceTrigger=PropertyChanged}"
                              VerticalAlignment="Stretch"
                              AcceptsReturn="True" VerticalScrollBarVisibility="Auto"
                              HorizontalScrollBarVisibility="Hidden" TextWrapping="Wrap"
                              AutoWordSelection="True" Visibility="Visible" Language="de-DE" SpellCheck.IsEnabled="True"/>
                </TabItem>

                <TabItem Header="Notice2"  x:Name="TabItem2_Notice">
                  <TextBox    x:Name="TextboxNotice2"
                              VerticalAlignment="Stretch"
                              Text="{val:ValidationBinding Path=Notice2, UpdateSourceTrigger=PropertyChanged}"
                              AcceptsReturn="True" VerticalScrollBarVisibility="Auto"
                              HorizontalScrollBarVisibility="Hidden" TextWrapping="Wrap"
                              AutoWordSelection="True" Visibility="Visible" Language="de-DE" SpellCheck.IsEnabled="True" />
                </TabItem>

                <TabItem Header="Notice3" x:Name="TabItem3_Notice">
                  <TextBox    x:Name="TextboxNotice3"
                              VerticalAlignment="Stretch"
                              Text="{val:ValidationBinding Path=Notice3, UpdateSourceTrigger=PropertyChanged}"
                              AcceptsReturn="True" VerticalScrollBarVisibility="Auto"
                              HorizontalScrollBarVisibility="Hidden" TextWrapping="Wrap"
                              AutoWordSelection="True" Visibility="Visible" Language="de-DE" SpellCheck.IsEnabled="True" />
                </TabItem>

                <TabItem Header="Notice4" x:Name="TabItem4_Notice">
                  <TextBox    x:Name="TextboxNotice4"
                              VerticalAlignment="Stretch"
                              Text="{val:ValidationBinding Path=Notice4, UpdateSourceTrigger=PropertyChanged}"
                              AcceptsReturn="True" VerticalScrollBarVisibility="Auto"
                              HorizontalScrollBarVisibility="Hidden" TextWrapping="Wrap"
                              AutoWordSelection="True" Visibility="Visible" Language="de-DE" SpellCheck.IsEnabled="True" />
                </TabItem>

                <TabItem Header="Notice5" x:Name="TabItem5_Notice">
                  <TextBox   x:Name="TextboxNotice5"
                             VerticalAlignment="Stretch"
                             Text="{val:ValidationBinding Path=Notice5, UpdateSourceTrigger=PropertyChanged}"
                             AcceptsReturn="True" VerticalScrollBarVisibility="Auto"
                             HorizontalScrollBarVisibility="Hidden" TextWrapping="Wrap"
                             AutoWordSelection="True" Visibility="Visible" Language="de-DE" SpellCheck.IsEnabled="True" />
                </TabItem>

              </TabControl>


            </Grid>
					</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="Speichern 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>