<localView:BeWoView x:Class="BeWo.View.Detail.CustomerView"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:uc="clr-namespace:BeWo.Controls;assembly=BeWo.Controls"
                    xmlns:val="clr-namespace:BeWo.Validation"
                    xmlns:localView="clr-namespace:BeWo.View"
                    xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
                    xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
                    xmlns:localSearchView="clr-namespace:BeWo.View.Search"
                    xmlns:r="clr-namespace:BeWo.Security"
                    xmlns:converter="clr-namespace:BeWo.Converter"
                    xmlns:detail="clr-namespace:BeWo.View.Detail"
                    xmlns:core="clr-namespace:BS.Shared.Core;assembly=BS.Shared"
                    xmlns:controls="clr-namespace:BeWo.View.Controls"
                    Height="Auto" Width="Auto" HorizontalAlignment="Stretch"
                    VerticalAlignment="Stretch" Focusable="True" GotFocus="UserControl_GotFocus">
  <localView:BeWoView.Resources>
    <converter:BoolNullCheckConverter x:Key="BoolNullCheckConverter" />
    <detail:MVListConverter x:Key="MVListConverter" />
    <!--<view:NewSchedulerView x:Key="NewSchedulerMain" />-->
  </localView:BeWoView.Resources>
  <localView:BeWoView.Triggers>
    <EventTrigger RoutedEvent="FrameworkElement.Loaded" />
  </localView:BeWoView.Triggers>
  <Grid x:Name="root">
    <Grid.Resources>
      <dxg:GridControl VerticalAlignment="Stretch" x:Key="grid_aktuellemvl" HorizontalAlignment="Stretch"
							 DataSource="{Binding Path=AktuelleMedikamentenverordnungsliste.Medikamentenverordnungen, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
							 CustomColumnSort="Grid_aktuellemedikamentenverordnungsliste_OnCustomColumnSort">
        <dxg:GridControl.Columns>
          <dxg:GridColumn FieldName="Verordnungsdatum" Header="Datum der Verordnung" Width="80" ReadOnly="True" IsEnabled="False">
            <dxg:GridColumn.EditSettings>
              <dxe:DateEditSettings DisplayFormat="d"/>
            </dxg:GridColumn.EditSettings>
          </dxg:GridColumn>
          <dxg:GridColumn FieldName="MedArt.Bezeichnung" Header="Med_Art" ReadOnly="True"/>
          <dxg:GridColumn FieldName="MedName" Header="Med_Name" ReadOnly="True"/>
          <dxg:GridColumn Binding="{Binding Path=RowData.Row.Darreichungsform}" Header="Darr.form" ReadOnly="True"/>
          <dxg:GridColumn FieldName="Morgens" Header="Morgens" ReadOnly="True"/>
          <dxg:GridColumn FieldName="Mittags" Header="Mittags" ReadOnly="True"/>
          <dxg:GridColumn FieldName="Abends" Header="Abends" ReadOnly="True"/>
          <dxg:GridColumn FieldName="Nachts" Header="Nachts" ReadOnly="True"/>
          <dxg:GridColumn FieldName="DepotMenge" Header="Depot_Menge" ReadOnly="True"/>
          <dxg:GridColumn Binding="{Binding Path=RowData.Row.DepotRhythmus}" Header="Depot_Rhythmus" ReadOnly="True"/>
          <dxg:GridColumn FieldName="DepotErsterTag" Header="Depot_ErsterTag" Width="80" ReadOnly="True" IsEnabled="False">
            <dxg:GridColumn.EditSettings>
              <dxe:DateEditSettings DisplayFormat="d"/>
            </dxg:GridColumn.EditSettings>
          </dxg:GridColumn>
          <dxg:GridColumn FieldName="DepotNaechsterTag" Header="Depot_NächsterTag" Width="80" ReadOnly="True" IsEnabled="False">
            <dxg:GridColumn.EditSettings>
              <dxe:DateEditSettings DisplayFormat="d"/>
            </dxg:GridColumn.EditSettings>
          </dxg:GridColumn>
          <dxg:GridColumn FieldName="MedBemerkung" Header="Med_Bemerkung" ReadOnly="True"/>
          <dxg:GridColumn FieldName="MedVerordnet" Header="Med_Verordnet" ReadOnly="True"/>
        </dxg:GridControl.Columns>
        <dxg:GridControl.View>
          <dxg:TableView AutoWidth="true" ShowGroupPanel="False" ShowGroupedColumns="false" ShowTotalSummary="False" NavigationStyle="Cell" />
        </dxg:GridControl.View>
      </dxg:GridControl>
      <dxg:GridControl VerticalAlignment="Stretch" x:Key="grid_bedarfsmvl" HorizontalAlignment="Stretch"
							 DataSource="{Binding Path=Bedarfsmedikamentenverordnungsliste.Medikamentenverordnungen, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}">
        <dxg:GridControl.Columns>
          <dxg:GridColumn FieldName="Verordnungsdatum" Header="Datum der Verordnung" Width="80" ReadOnly="True" IsEnabled="False">
            <dxg:GridColumn.EditSettings>
              <dxe:DateEditSettings DisplayFormat="d"/>
            </dxg:GridColumn.EditSettings>
          </dxg:GridColumn>
          <dxg:GridColumn FieldName="MedArt.Bezeichnung" Header="Med_Art" ReadOnly="True"/>
          <dxg:GridColumn FieldName="MedName" Header="Med_Name" ReadOnly="True"/>
          <dxg:GridColumn Binding="{Binding Path=RowData.Row.Darreichungsform}" Header="Darr.form" ReadOnly="True"/>
          <dxg:GridColumn FieldName="Morgens" Header="Morgens" ReadOnly="True"/>
          <dxg:GridColumn FieldName="Mittags" Header="Mittags" ReadOnly="True"/>
          <dxg:GridColumn FieldName="Abends" Header="Abends" ReadOnly="True"/>
          <dxg:GridColumn FieldName="Nachts" Header="Nachts" ReadOnly="True"/>
          <dxg:GridColumn FieldName="DepotMenge" Header="Depot_Menge" ReadOnly="True"/>
          <dxg:GridColumn Binding="{Binding Path=RowData.Row.DepotRhythmus}" Header="Depot_Rhythmus" ReadOnly="True"/>
          <dxg:GridColumn FieldName="DepotErsterTag" Header="Depot_ErsterTag" Width="80" ReadOnly="True" IsEnabled="False">
            <dxg:GridColumn.EditSettings>
              <dxe:DateEditSettings DisplayFormat="d"/>
            </dxg:GridColumn.EditSettings>
          </dxg:GridColumn>
          <dxg:GridColumn FieldName="DepotNaechsterTag" Header="Depot_NächsterTag" Width="80" ReadOnly="True" IsEnabled="False">
            <dxg:GridColumn.EditSettings>
              <dxe:DateEditSettings DisplayFormat="d"/>
            </dxg:GridColumn.EditSettings>
          </dxg:GridColumn>
          <dxg:GridColumn FieldName="MedBemerkung" Header="Med_Bemerkung" ReadOnly="True"/>
          <dxg:GridColumn FieldName="MedVerordnet" Header="Med_Verordnet" ReadOnly="True"/>
        </dxg:GridControl.Columns>
        <dxg:GridControl.View>
          <dxg:TableView AutoWidth="true" ShowGroupPanel="False" ShowGroupedColumns="false" ShowTotalSummary="False" NavigationStyle="Cell" />
        </dxg:GridControl.View>
      </dxg:GridControl>
      <dxg:GridControl VerticalAlignment="Stretch" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="7" x:Key="grid_medikamentenverordnungshistorie" HorizontalAlignment="Stretch"
							 DataSource="{Binding Path=UngueltigeVerordnungen}" CustomColumnSort="Grid_medikamentenverordnungshistorie_OnCustomColumnSort">
        <dxg:GridControl.DetailDescriptor>
          <dxg:DataControlDetailDescriptor ItemsSourceBinding="{Binding Medikamentenverordnungen}">
            <dxg:GridControl>
              <dxg:GridControl.Columns>
                <dxg:GridColumn FieldName="MedArt.Bezeichnung" Header="Med_Art" ReadOnly="True"/>
                <dxg:GridColumn FieldName="MedName" Header="Med_Name" ReadOnly="True"/>
                <dxg:GridColumn Binding="{Binding Path=RowData.Row.Darreichungsform}" Header="Darr.form" ReadOnly="True"/>
                <dxg:GridColumn FieldName="Morgens" Header="Morgens" ReadOnly="True"/>
                <dxg:GridColumn FieldName="Mittags" Header="Mittags" ReadOnly="True"/>
                <dxg:GridColumn FieldName="Abends" Header="Abends" ReadOnly="True"/>
                <dxg:GridColumn FieldName="Nachts" Header="Nachts" ReadOnly="True"/>
                <dxg:GridColumn FieldName="DepotMenge" Header="Depot_Menge" ReadOnly="True"/>
                <dxg:GridColumn Binding="{Binding Path=RowData.Row.DepotRhythmus}" Header="Depot_Rhythmus" ReadOnly="True"/>
                <dxg:GridColumn IsEnabled="False" FieldName="DepotErsterTag" Header="Depot_ErsterTag" Width="80" ReadOnly="True">
                  <dxg:GridColumn.EditSettings>
                    <dxe:DateEditSettings DisplayFormat="d"/>
                  </dxg:GridColumn.EditSettings>
                </dxg:GridColumn>
                <dxg:GridColumn IsEnabled="False" FieldName="DepotNaechsterTag" Header="Depot_NächsterTag" Width="80" ReadOnly="True">
                  <dxg:GridColumn.EditSettings>
                    <dxe:DateEditSettings DisplayFormat="d"/>
                  </dxg:GridColumn.EditSettings>
                </dxg:GridColumn>
                <dxg:GridColumn FieldName="MedBemerkung" Header="Med_Bemerkung" ReadOnly="True"/>
                <dxg:GridColumn FieldName="MedVerordnet" Header="Med_Verordnet" ReadOnly="True"/>
              </dxg:GridControl.Columns>
              <dxg:GridControl.View>
                <dxg:TableView x:Name="medHistorienTableView" AutoWidth="True" ShowGroupPanel="False" ShowGroupedColumns="false" ShowTotalSummary="False" NavigationStyle="Cell"/>
              </dxg:GridControl.View>
            </dxg:GridControl>
          </dxg:DataControlDetailDescriptor>
        </dxg:GridControl.DetailDescriptor>
        <dxg:GridControl.Columns>
          <dxg:GridColumn FieldName="x" Header="" Width="10">
            <dxg:GridColumn.CellTemplate>
              <DataTemplate>
                <Button Content="r" FontFamily="Webdings" Click="RemoveHistMedVOClick" Width="18" Height="18" VerticalAlignment="Center" />
              </DataTemplate>
            </dxg:GridColumn.CellTemplate>
          </dxg:GridColumn>
          <dxg:GridColumn FieldName="Notice" Header="Liste" ReadOnly="True" AllowEditing="False" />
          <dxg:GridColumn FieldName="Ersteller" Header="Ersteller" ReadOnly="True" AllowEditing="False" />
          <dxg:GridColumn FieldName="X" Header="Drucken" ReadOnly="True">
            <dxg:GridColumn.CellTemplate>
              <DataTemplate>
                <TextBlock x:Name="textblock_link_pdfexport" VerticalAlignment="Center">
                  <Hyperlink x:Name="LinkListeDrucken" Click="MVHistoryEntryHyperlinkClick" TargetName="_NewWindow" Foreground="#FF2B508B" RequestNavigate="LinkListeDrucken_OnRequestNavigate">
                    <Run Text="Drucken" />
                  </Hyperlink>
                </TextBlock>
              </DataTemplate>
            </dxg:GridColumn.CellTemplate>
          </dxg:GridColumn>
        </dxg:GridControl.Columns>
        <dxg:GridControl.View>
          <dxg:TableView AutoWidth="true" ShowGroupPanel="False" ShowGroupedColumns="false" ShowTotalSummary="False" NavigationStyle="Cell" />
        </dxg:GridControl.View>
      </dxg:GridControl>
      <dxg:GridControl x:Key="grid_costBearer" VerticalAlignment="Stretch" DataSource="{Binding Path=CostBearers.VMList}"
			                 HorizontalAlignment="Stretch">
        <dxg:GridControl.Columns>
          <dxg:GridColumn FieldName="Notice" Header="" FixedWidth="True" Width="24" ReadOnly="True">
            <dxg:GridColumn.CellTemplate>
              <DataTemplate>
                <Button Content="r" FontFamily="Webdings" Click="Button_deleteCostBearerClick" Width="18" Height="18" VerticalAlignment="Center" />
              </DataTemplate>
            </dxg:GridColumn.CellTemplate>
          </dxg:GridColumn>
          <dxg:GridColumn x:Name="gridcolumn_costbearer" AllowEditing="False" FieldName="CostBearer" Header="Kostenträger" Width="150" />
          <dxg:GridColumn FieldName="ReferenceNumber" Header="Aktenzeichen des Klienten" Width="200" />
          <dxg:GridColumn FieldName="Notice" Header="Notiz" Width="250" />
        </dxg:GridControl.Columns>
        <dxg:GridControl.View>
          <dxg:TableView AutoWidth="true" ShowGroupPanel="False" ShowGroupedColumns="false" ShowTotalSummary="False"
					               NavigationStyle="Cell" RowDoubleClick="TableView_OnRowDoubleClick" />
        </dxg:GridControl.View>
      </dxg:GridControl>
      <dxg:GridControl VerticalAlignment="Stretch" DataSource="{Binding Path=EmployeeRelations.VMList}" HorizontalAlignment="Stretch" x:Key="datagrid_EmployeeRelation">
        <dxg:GridControl.Columns>
          <dxg:GridColumn FieldName="Notice" Header="" FixedWidth="True" Width="24" ReadOnly="True">
            <dxg:GridColumn.CellTemplate>
              <DataTemplate>
                <Button Content="r" FontFamily="Webdings" Click="button_removeEmployeeRelation_Click" Width="18" Height="18" VerticalAlignment="Center" />
              </DataTemplate>
            </dxg:GridColumn.CellTemplate>
          </dxg:GridColumn>
          <dxg:GridColumn AllowEditing="False" FieldName="Employee" Header="Betreuer(in)" Width="150" />
          <dxg:GridColumn x:Name="gridcolumn_employeerole" FieldName="Role" Header="Rolle" Width="200" />
          <dxg:GridColumn FieldName="Notice" Header="Erläuterung" Width="250" />
        </dxg:GridControl.Columns>
        <dxg:GridControl.View>
          <dxg:TableView AutoWidth="true" ShowGroupPanel="False" ShowGroupedColumns="false" ShowTotalSummary="False" NavigationStyle="Cell" RowDoubleClick="TableView_OnRowDoubleClick" />
        </dxg:GridControl.View>
      </dxg:GridControl>
      <dxg:GridControl VerticalAlignment="Stretch" DataSource="{Binding Path=TeamRelations.VMList}"
			                 HorizontalAlignment="Stretch" x:Key="datagrid_TeamRelation">
        <dxg:GridControl.Columns>
          <dxg:GridColumn FieldName="Notice" Header="" FixedWidth="True" Width="24" ReadOnly="True">
            <dxg:GridColumn.CellTemplate>
              <DataTemplate>
                <Button Content="r" FontFamily="Webdings" Click="button_removeTeamRelation_Click" Width="18" Height="18"
								        VerticalAlignment="Center" />
              </DataTemplate>
            </dxg:GridColumn.CellTemplate>
          </dxg:GridColumn>
          <dxg:GridColumn AllowEditing="False" FieldName="Team" Header="Team" Width="150" />
        </dxg:GridControl.Columns>
        <dxg:GridControl.View>
          <dxg:TableView AutoWidth="true" ShowGroupPanel="False" ShowGroupedColumns="false" ShowTotalSummary="False"
					               NavigationStyle="Cell" RowDoubleClick="TableView_OnRowDoubleClick" />
        </dxg:GridControl.View>
      </dxg:GridControl>
      <dxg:GridControl VerticalAlignment="Stretch" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="7"
			                 DataSource="{Binding Path=AbsenceTimes.VMList}" HorizontalAlignment="Stretch"
			                 x:Key="datagrid_absences">
        <dxg:GridControl.Columns>
          <dxg:GridColumn FieldName="Notice" Header="" FixedWidth="True" Width="24" ReadOnly="True">
            <dxg:GridColumn.CellTemplate>
              <DataTemplate>
                <Button Content="r" Click="button_removeAbsence_Click" FontFamily="Webdings" Width="18" Height="18"
								        VerticalAlignment="Center" />
              </DataTemplate>
            </dxg:GridColumn.CellTemplate>
          </dxg:GridColumn>
          <dxg:GridColumn FieldName="Start" Header="von" Width="150" EditSettings="{dxe:DateSettings DisplayFormat=d}" />
          <dxg:GridColumn FieldName="End" Header="bis" Width="150">
            <dxg:GridColumn.EditSettings>
              <dxe:DateSettings AllowNullInput="True" />
            </dxg:GridColumn.EditSettings>
          </dxg:GridColumn>
          <dxg:GridColumn x:Name="gridcolumn_absencereason" FieldName="Reason" Header="Kategorie" Width="150" />
          <dxg:GridColumn FieldName="Notice" Header="Erläuterung" Width="250" />
        </dxg:GridControl.Columns>
        <dxg:GridControl.View>
          <dxg:TableView AutoWidth="true" ShowGroupPanel="False" ShowGroupedColumns="false" ShowTotalSummary="False"
					               NavigationStyle="Cell" />
        </dxg:GridControl.View>
      </dxg:GridControl>
      <dxg:GridControl VerticalAlignment="Stretch" DataSource="{Binding Path=EnvironmentPersons.VMList}" HorizontalAlignment="Stretch" x:Key="grid_PersonRelations">
        <dxg:GridControl.Columns>
          <dxg:GridColumn FieldName="Notice" Header="" FixedWidth="True" Width="24" ReadOnly="True">
            <dxg:GridColumn.CellTemplate>
              <DataTemplate>
                <Button Content="r" Click="button_environmentPersonDeleteClick" FontFamily="Webdings" Width="18" Height="18" VerticalAlignment="Center" />
              </DataTemplate>
            </dxg:GridColumn.CellTemplate>
          </dxg:GridColumn>
          <dxg:GridColumn FieldName="PersonString" Header="Person" Width="150" AllowEditing="False" />
          <dxg:GridColumn x:Name="gridcolumn_evironmentroleperson" FieldName="Role" Header="Rolle" Width="150" />
          <dxg:GridColumn FieldName="AddressSummaryInfo" Header="Adresse" Width="150" />
          <dxg:GridColumn FieldName="ContactSummaryInfo" Header="Kontaktdaten" Width="150" />
          <dxg:GridColumn FieldName="Notice" Header="Notiz" Width="250" />
        </dxg:GridControl.Columns>
        <dxg:GridControl.View>
          <dxg:TableView AutoWidth="true" ShowGroupPanel="False" ShowGroupedColumns="false" ShowTotalSummary="False" NavigationStyle="Cell" RowDoubleClick="TableView_OnRowDoubleClick" />
        </dxg:GridControl.View>
      </dxg:GridControl>
      <dxg:GridControl VerticalAlignment="Stretch" DataSource="{Binding Path=EnvironmentOrganisations.VMList}" HorizontalAlignment="Stretch" x:Key="grid_OrganisationRelations">
        <dxg:GridControl.Columns>
          <dxg:GridColumn FieldName="Notice" Header="" FixedWidth="True" Width="24" ReadOnly="True">
            <dxg:GridColumn.CellTemplate>
              <DataTemplate>
                <Button Content="r" Click="button_environmentOrganisationDeleteClick" FontFamily="Webdings" Width="18" Height="18" VerticalAlignment="Center" />
              </DataTemplate>
            </dxg:GridColumn.CellTemplate>
          </dxg:GridColumn>
          <dxg:GridColumn FieldName="OrganisationString" Header="Organisation" Width="150" AllowEditing="False" />
          <dxg:GridColumn x:Name="gridcolumn_evironmentroleorganisation" FieldName="Role" Header="Rolle" Width="150" />
          <dxg:GridColumn FieldName="AddressSummaryInfo" Header="Adresse" Width="150" />
          <dxg:GridColumn FieldName="ContactSummaryInfo" Header="Kontaktdaten" Width="150" />
          <dxg:GridColumn FieldName="Info1" Header="Info" Width="200" />
          <dxg:GridColumn FieldName="Notice" Header="Notiz" Width="250" />
        </dxg:GridControl.Columns>
        <dxg:GridControl.View>
          <dxg:TableView AutoWidth="true" ShowGroupPanel="False" ShowGroupedColumns="false" ShowTotalSummary="False" NavigationStyle="Cell" RowDoubleClick="TableView_OnRowDoubleClick" />
        </dxg:GridControl.View>
      </dxg:GridControl>
    </Grid.Resources>
    <uc:ShadowChrome>
      <GroupBox Style="{DynamicResource MainContentGroupBoxStyle}">
        <GroupBox.Header>
          <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom">
            <Image Source="..\..\Ressources\Icons\UserHomeMaleDisabled.png" RenderTransformOrigin="0.5,0.5" Stretch="Uniform"
						       Width="32">
              <Image.RenderTransform>
                <TransformGroup>
                  <ScaleTransform ScaleX="1" ScaleY="1" />
                  <SkewTransform AngleX="0" AngleY="0" />
                  <RotateTransform Angle="0" />
                  <TranslateTransform X="0" Y="5" />
                </TransformGroup>
              </Image.RenderTransform>
            </Image>
            <TextBox Text="{Binding FirstName}" Margin="10,0,0,0" Background="{x:Null}" Foreground="#FFFFFFFF" FontSize="22"
						         BorderBrush="{x:Null}" VerticalAlignment="Bottom" Padding="0,0,0,0" />
            <TextBox Text="{Binding LastName}" Margin="3,0,0,0" Background="{x:Null}" Foreground="#FFFFFFFF" FontSize="22"
         BorderBrush="{x:Null}" VerticalAlignment="Bottom" Padding="0,0,0,0" />
            <TextBox Text="(" IsReadOnly="True" Margin="3,0,0,0" Background="{x:Null}" Foreground="#FFFFFFFF" FontSize="22"
         BorderBrush="{x:Null}" VerticalAlignment="Bottom" Padding="0,0,0,0" Visibility="{Binding Path=CustomerAlias, Converter={StaticResource  ObjectVisibilityConverter}}" />
            <TextBox Text="{Binding CustomerAlias}" Margin="0,0,0,0" Background="{x:Null}" Foreground="#FFFFFFFF" FontSize="22"
        BorderBrush="{x:Null}" VerticalAlignment="Bottom" Padding="0,0,0,0" TextDecorations="" />
            <TextBox Text=")" IsReadOnly="True" Margin="0,0,0,0" Background="{x:Null}" Foreground="#FFFFFFFF" FontSize="22"
         BorderBrush="{x:Null}" VerticalAlignment="Bottom" Padding="0,0,0,0" Visibility="{Binding Path=CustomerAlias, Converter={StaticResource  ObjectVisibilityConverter}}" />
          </StackPanel>
        </GroupBox.Header>
        <Grid Margin="0,3,0,0" Background="{DynamicResource ObjectEditBackgroundBrush}">
          <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
          </Grid.RowDefinitions>
          <Rectangle Fill="{StaticResource CustomerContentBrush}" Height="6" />
          <TabControl x:Name="tabroot" Grid.Row="1" Style="{StaticResource ObjectEditTabControl}" BorderThickness="0,0,0,0"
					            Padding="4,4,4,4">
            <TabItem Header="Details" IsSelected="True" Name="tabitem_details">
              <ScrollViewer VerticalScrollBarVisibility="Auto">
                <Grid x:Name="grid_details">
                  <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="*" />               
                  </Grid.ColumnDefinitions>
                  <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" MinHeight="136" />
                    <RowDefinition Height="*" MinHeight="165" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="*"  MinHeight="165"  />
                  </Grid.RowDefinitions>
              
                  <GroupBox Grid.ColumnSpan="1" Header="Foto" Margin="8 8 0 0" Style="{StaticResource ObjectEditGroupBox}" Grid.Column="0">
                    <Grid>
                      <dxe:ImageEdit MinWidth="250" MaxWidth="300" Height="250" x:Name="Img" Stretch="Uniform"  HorizontalAlignment="Center"  />
                    </Grid>
                    <!--RenderOptions.BitmapScalingMode="Fant"-->
                  </GroupBox>      
                  
                  <GroupBox Grid.ColumnSpan="2" Header="Eigenschaften" Style="{StaticResource ObjectEditGroupBox}" Margin="8 8 0 0" Grid.Column="1">
                    <Grid>
                      <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" SharedSizeGroup="Blubb" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" />
                      </Grid.ColumnDefinitions>
                      <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="*" />
                      </Grid.RowDefinitions>


                      <Label Grid.Column="0" Grid.Row="0" Content="Vorname" />
						<TextBox x:Name="textbox_first" Grid.Column="1" Grid.Row="0" Margin="3" Height="23"
											         Text="{val:ValidationBinding Path=FirstName, UpdateSourceTrigger=PropertyChanged}" />
						
                      <Grid Grid.Column="0" Grid.Row="1" ColumnSpan="2">
                        <Grid.ColumnDefinitions>
                          <ColumnDefinition Width="Auto" SharedSizeGroup="Blubb" />
                          <ColumnDefinition Width="*" />
                          <ColumnDefinition Width="Auto" SharedSizeGroup="Spalte2"/>
                          <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Label Grid.Column="0" Content="Nachname" />
                        <TextBox Grid.Column="1" Margin="3" Height="23"
       Text="{val:ValidationBinding Path=LastName, UpdateSourceTrigger=PropertyChanged}" />

                        <Label Grid.Column="2" Content="Alias" />
                        <TextBox Grid.Column="3" Margin="3" Height="23"
       Text="{val:ValidationBinding Path=CustomerAlias, UpdateSourceTrigger=PropertyChanged}" />
                      </Grid>
                      <!--<Label x:Name="lblAktenzeichen" Grid.Column="0" Grid.Row="2" Content="Aktenzeichen" />-->
                      

                      <Label Grid.Column="0" Grid.Row="2" Content="Geburtstag" />
                      <Label Grid.Column="0" Grid.Row="3" Content="Geschlecht" />
                      <Label Grid.Column="2" Grid.Row="0" Content="Familienstand" />
                      <Label Grid.Column="2" Grid.Row="1" Content="Beruf" />
                      <Label Grid.Column="2" Grid.Row="2" Content="Kinder" />
                      <Label Grid.Column="2" Grid.Row="3" Content="Eigenbeteiligung" />
                      <Label x:Name="lblArchiviert" Grid.Column="2" Grid.Row="4" Content="Archiviert" />
                      <Label Grid.Column="0" Grid.Row="5" Content="Kommentar" />

                      

                      <!--<TextBox x:Name="txtAktenzeichen" Grid.Column="1" Grid.Row="2" Margin="3" Height="23" Text="{val:ValidationBinding Path=ReferenceNumber, UpdateSourceTrigger=PropertyChanged}" />-->

                      <!--<uc:MaskedTextBox Grid.Column="1" Grid.Row="3" Mask="00/00/0000" Margin="3" Height="23" Text="{Binding Path=DateOfBirth, Converter={StaticResource DateConverter}, UpdateSourceTrigger=PropertyChanged}" />-->
                      <dxe:DateEdit AllowNullInput="True" Grid.Column="1" Grid.Row="2" Height="23" Margin="3"
											              EditValue="{Binding Path=DateOfBirth, UpdateSourceTrigger=PropertyChanged}" Width="100"
											              HorizontalAlignment="Left" MaskType="DateTimeAdvancingCaret" />
                      <Grid Grid.Column="1" Grid.Row="3" Height="23" Margin="0,3,0,3">
                        <Grid.ColumnDefinitions>
                          <ColumnDefinition Width="Auto" SharedSizeGroup="RB1" />
                          <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <RadioButton Grid.Column="0" Margin="3" VerticalAlignment="Center" HorizontalAlignment="Left"
												             IsChecked="{Binding Path=IsMale, UpdateSourceTrigger=PropertyChanged}" Content="männlich" />
                        <RadioButton Grid.Column="1" Margin="3" VerticalAlignment="Center" HorizontalAlignment="Left"
												             IsChecked="{Binding Path=IsFemale, UpdateSourceTrigger=PropertyChanged}" Content="weiblich" />
                      </Grid>
						<Grid x:Name="panelDebitor" Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="2">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="Auto" SharedSizeGroup="Blubb"/>
								<ColumnDefinition Width="*" />
								<ColumnDefinition Width="Auto" SharedSizeGroup="Spalte2"/>
								<ColumnDefinition Width="*" />
							</Grid.ColumnDefinitions>
							<Label x:Name="lblDebitorNumber" Content="Debitor Nr." />
							<TextBox x:Name="txtDebitorNumber" Grid.Column="1" Margin="3" Height="23"
															 Text="{val:ValidationBinding Path=DebitorNumber, UpdateSourceTrigger=PropertyChanged}" />
							<Label x:Name="lblCostCenter" Grid.Column="2" Content="Kostenstelle" />
							<TextBox x:Name="txtCostCenter" Grid.Column="3" Margin="3" Height="23"
															 Text="{val:ValidationBinding Path=CostCenter, UpdateSourceTrigger=PropertyChanged}" />
						</Grid>
                      <uc:NullItemComboBox Grid.Column="3" Grid.Row="0" Margin="3" Height="23"
											                     ItemsSource="{x:Static core:EnumTranslations.FamilyStatusTranslations}"
											                     SelectedValue="{Binding Path=FamilyStatus}" DisplayMemberPath="Value"
											                     SelectedValuePath="Key" />

                      <TextBox Grid.Column="3" Grid.Row="1" Margin="3" Height="23"
											         Text="{Binding Path=Profession, UpdateSourceTrigger=PropertyChanged}" />
                      <TextBox Grid.Column="3" Grid.Row="2" Margin="3" Height="23"
											         Text="{Binding Path=Childs, UpdateSourceTrigger=PropertyChanged}" />
                      <TextBox Grid.Column="3" Grid.Row="3" Margin="3" Height="23"
											         Text="{Binding Path=EquityContribution, UpdateSourceTrigger=PropertyChanged}" />
                      <CheckBox x:Name="chkArchiviert" Grid.Column="3" Grid.Row="4" Margin="3" Height="23"
											          IsChecked="{Binding Path=IsArchived, UpdateSourceTrigger=PropertyChanged}" />
                      <TextBox Margin="3" Grid.Column="1" Grid.ColumnSpan="3" Grid.Row="5"
											         Text="{Binding Path=Notice, UpdateSourceTrigger=PropertyChanged}" Height="100"
											         VerticalAlignment="Stretch" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Left"
											         ScrollViewer.CanContentScroll="False" VerticalScrollBarVisibility="Auto"
											         HorizontalScrollBarVisibility="Hidden" TextWrapping="Wrap" AcceptsReturn="True"
											         AutoWordSelection="True" Language="de-DE" SpellCheck.IsEnabled="True"/>
                    </Grid>
                  </GroupBox>


                  <GroupBox Grid.Column="0" Grid.Row="1" Margin="0 8 0 0" Header="Adresse" Style="{StaticResource ObjectEditGroupBox}">
                    <Grid>
                      <Grid.RowDefinitions>
                        <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="*" />
                      </Grid.ColumnDefinitions>

                      <Label Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" Content="Adresszusatz" />
                      <Label Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" Content="Strasse" />
                      <Label Grid.Column="0" Grid.Row="2" VerticalAlignment="Center" Content="Postleitzahl" />
                      <Label Grid.Column="0" Grid.Row="3" VerticalAlignment="Center" Content="Ort" />
                      <Label x:Name="lblDistance" Grid.Column="0" Grid.Row="4" VerticalAlignment="Center" Content="Entfernung in km" />

                      
                      <TextBox Grid.Column="1" Grid.Row="0" Margin="3" Height="23" Text="{Binding Path=AddressLine1, UpdateSourceTrigger=PropertyChanged}" />
                      <TextBox Grid.Column="1" Grid.Row="1" Margin="3" Height="23" Text="{Binding Path=Street, UpdateSourceTrigger=PropertyChanged}" />
                      <TextBox Grid.Column="1" Grid.Row="2" Margin="3" Height="23" Text="{Binding Path=PostalCode, UpdateSourceTrigger=PropertyChanged}" />
                      <TextBox Grid.Column="1" Grid.Row="3" Margin="3" Height="23" Text="{Binding Path=Town, UpdateSourceTrigger=PropertyChanged}" />
                      <dxe:SpinEdit MinValue="0" Increment="5" IsFloatValue="False" AllowNullInput="True" x:Name="txtDistance"
                                                                      EditValue="{Binding Path=DistanceInMeter, Mode=TwoWay, Converter={StaticResource Int2DecimalConverter}, UpdateSourceTrigger=PropertyChanged}"
                                                                      Grid.Column="1" Grid.Row="4"
                                                                      Height="23" Margin="3"/>

                    </Grid>
                  </GroupBox>
                  <GroupBox Grid.Column="1" Grid.Row="1" Margin="8 8 0 0" Header="Rechnungsadresse"
									          Style="{StaticResource ObjectEditGroupBox}">
                    <Grid>
                      <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                      </Grid.RowDefinitions>
                      <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="80" />
                        <ColumnDefinition Width="*" />
                      </Grid.ColumnDefinitions>

                      <Label Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" Content="Name" />
                      <Label Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" Content="Strasse" />
                      <Label Grid.Column="0" Grid.Row="2" VerticalAlignment="Center" Content="Postleitzahl" />
                      <Label Grid.Column="0" Grid.Row="3" VerticalAlignment="Center" Content="Ort" />

                      <TextBox Grid.Column="1" Grid.Row="0" Margin="3" Height="23"
											         Text="{Binding Path=InvoiceAddressLine1, UpdateSourceTrigger=PropertyChanged}" />
                      <TextBox Grid.Column="1" Grid.Row="1" Margin="3" Height="23"
											         Text="{Binding Path=InvoiceAddressStreet, UpdateSourceTrigger=PropertyChanged}" />
                      <TextBox Grid.Column="1" Grid.Row="2" Margin="3" Height="23"
											         Text="{Binding Path=InvoiceAddressPostalCode, UpdateSourceTrigger=PropertyChanged}" />
                      <TextBox Grid.Column="1" Grid.Row="3" Margin="3" Height="23"
											         Text="{Binding Path=InvoiceAddressTown, UpdateSourceTrigger=PropertyChanged}" />


                    </Grid>
                  </GroupBox>
                  <GroupBox Grid.Column="2" Grid.Row="1" Header="Kontakt" Grid.ColumnSpan="2"
									          Style="{StaticResource ObjectEditGroupBox}" Margin="8,8,0,0">
                    <Grid>
                      <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                      </Grid.RowDefinitions>
                      <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="80" />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" />
                      </Grid.ColumnDefinitions>

                      <Label Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" Content="Handy" />
                      <Label Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" Content="Telefon" />
                      <Label Grid.Column="0" Grid.Row="2" VerticalAlignment="Center" Content="Fax" />
                      <Label Grid.Column="0" Grid.Row="3" VerticalAlignment="Center" Content="Mail" />

                      <TextBox Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="0" Margin="3" Height="23"
											         Text="{Binding Path=MobilePhone, UpdateSourceTrigger=PropertyChanged}" />
                      <TextBox Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="1" Margin="3" Height="23"
											         Text="{Binding Path=Phone, UpdateSourceTrigger=PropertyChanged}" />
                      <TextBox Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="2" Margin="3" Height="23"
											         Text="{Binding Path=Fax, UpdateSourceTrigger=PropertyChanged}" />
                      <Button Grid.Column="1" Grid.Row="3" Content="*" FontFamily="Wingdings" Click="EmailBtnClick" Margin="3"
											        Height="21" IsEnabled="{Binding Path=EMail, Converter={StaticResource ObjectBoolConverter}}" />
                      <TextBox x:Name="EMailTextBox" Grid.RowSpan="1" Grid.Column="2" Grid.ColumnSpan="2" Grid.Row="3" Margin="3"
											         Height="23" Text="{Binding Path=EMail, UpdateSourceTrigger=PropertyChanged}" />

                    </Grid>
                  </GroupBox>


                  
                </Grid>
              </ScrollViewer>
            </TabItem>
            <TabItem Header="Dokumentation" Name="tabitem_notice">
              <GroupBox Header="Dokumentation" Style="{StaticResource ObjectEditGroupBox}">
                <TextBox Margin="3" Text="{Binding Path=Notice, UpdateSourceTrigger=PropertyChanged}"
								         VerticalAlignment="Stretch" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Left"
								         ScrollViewer.CanContentScroll="False" VerticalScrollBarVisibility="Auto"
								         HorizontalScrollBarVisibility="Hidden" TextWrapping="Wrap" AcceptsReturn="True"
								         AutoWordSelection="True" Language="de-DE" SpellCheck.IsEnabled="True"/>
              </GroupBox>
            </TabItem>
            <!-- Region tabitem_notice -->
            <!--<TabItem Name="tabitem_notice">
						  <GroupBox Style="{StaticResource ObjectEditGroupBox}">
							<GroupBox.Header>
							  <StackPanel Orientation="Horizontal">
								<TextBlock Text="Dokumentation"/>
								<Button x:Name="btnShowHistory" Grid.Column="0" Grid.Row="6" Width="32"
																				Height="22" HorizontalAlignment="Left" Margin="70,0,0,0"
																				Padding="1,1,1,1"
																				BorderThickness="1,1,1,1"
																				Click="btnShowHistory_Click" Style="{DynamicResource GlassButton}">
								  <Image Source="..\..\Ressources\Icons\History24.png"
										  Stretch="Uniform" Margin="1,1,1,1" />
								</Button>
							  </StackPanel>

							</GroupBox.Header>

							<TextBox Margin="3" Text="{Binding Path=Notice, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Stretch" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Left" ScrollViewer.CanContentScroll="False" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Hidden" TextWrapping="Wrap" AcceptsReturn="True" AutoWordSelection="True" />
						  </GroupBox>
						</TabItem>-->
            <!-- EndRegion -->
            <TabItem Header="Weitere Eigenschaften" Name="tabitem_varFields">
              <ScrollViewer VerticalScrollBarVisibility="Auto">
                <localView:VarFieldView VarFieldList="{Binding VarFields}" />
              </ScrollViewer>
            </TabItem>
            <TabItem Header="Aktenzeichen" Selector.Selected="TabItemCostBearer_Selected">
              <Grid x:Name="grid_costBearerRel">
                <Grid.RowDefinitions>
                  <RowDefinition Height="Auto" />
                  <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <GroupBox Style="{StaticResource ObjectEditGroupBox}" x:Name="groupBox_newCostBearer"
								          Header="Neues Aktenzeichen für Kostenträger vergeben">
                  <Grid>
                    <Grid.ColumnDefinitions>
                      <ColumnDefinition Width="Auto" />
                      <ColumnDefinition Width="*" />
                      <ColumnDefinition Width="Auto" />
                      <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                      <RowDefinition Height="Auto" />
                      <RowDefinition Height="Auto" />
                      <RowDefinition Height="Auto" />
                      <RowDefinition Height="0" />
                    </Grid.RowDefinitions>
                    <Label Content="Kostenträger" />
                    <uc:PopUpEdit Margin="3" Height="23"
										              IsReadOnly="True"
										              DeleteButtonVisibility="Collapsed"
										              Name="popupedit_costBearer"
										              PopUpClick="popupedit_costBearer_PopUpClick"
										              Text="{val:ValidationBinding Path=CostBearers.NewVM.CostBearerString}"
										              Grid.Row="0" Grid.Column="1"
										              PreviewMouseDoubleClick="Popupedit_costBearer_OnPreviewMouseDoubleClick"
										              Cursor="Arrow" />
                    <Label Content="Aktenzeichen des Klienten" Grid.Row="0" Grid.Column="2" />
                    <TextBox Grid.Row="0" Grid.Column="3" Margin="3" Height="23" Text="{Binding Path=CostBearers.NewVM.ReferenceNumber}" />
                    <Label Content="Notiz" Grid.Row="1" Grid.Column="0" />
                    <TextBox Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="3" Margin="3" Height="23"
										         Text="{Binding Path=CostBearers.NewVM.Notice}" />
                    <Button Margin="3" Grid.Row="2" Height="25" Content="Hinzufügen" Grid.ColumnSpan="4" Grid.Column="0"
										        HorizontalAlignment="Right" x:Name="button_addCostBearer" Click="button_addCostBearer_Click" />
                  </Grid>
                </GroupBox>
                <GroupBox x:Name="GroupBoxCostBearerGrid" Style="{StaticResource ObjectEditGroupBox}" Grid.Row="1"
								          Margin=" 0 20 0 0" Header="Zugeordnete Aktenzeichen pro Kostenträger" />
              </Grid>
            </TabItem>
            <TabItem Header="Diagnosen" x:Name="tabitem_diagnosis">
              <TabItem.Resources>
                <GroupBox x:Key="gb_possible" Margin="0 20 0 20" Style="{StaticResource PopUpWindowStyle}">
                  <GroupBox.Header>
                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,0,0">
                      <!--<Image Source="..\..\Ressources\Icons\CoinsDisabled.png" Height="28" />-->
                      <TextBox Text="Mögliche Diagnosen" 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>
                    <dxg:GridControl MouseDoubleClick="grid_possibleDiagnosis_MouseDoubleClick" Name="grid_possibleDiagnosis">
                      <dxg:GridControl.Columns>
                        <dxg:GridColumn FieldName="Key" FixedWidth="True" Width="70" AllowResizing="True"
												                AutoFilterCondition="Contains" Header="ICD 10" />
                        <dxg:GridColumn FieldName="Value" AutoFilterCondition="Contains" Header="Beschreibung">
                          <dxg:GridColumn.EditSettings>
                            <dxe:TextEditSettings TextWrapping="Wrap" />
                          </dxg:GridColumn.EditSettings>
                        </dxg:GridColumn>
                      </dxg:GridControl.Columns>
                      <dxg:GridControl.View>
                        <dxg:TableView x:Name="gridView_possible" NavigationStyle="Row" Margin="2 2 2 2" AutoWidth="True"
												               ShowAutoFilterRow="True" ShowGroupPanel="False" ShowGroupedColumns="false"
												               ShowTotalSummary="False" />
                      </dxg:GridControl.View>
                    </dxg:GridControl>
                  </Grid>
                </GroupBox>
              </TabItem.Resources>
              <GroupBox Style="{StaticResource ObjectEditGroupBox}" Header="Diagnosen">
                <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
                  <Grid x:Name="grid_misc">
                    <Grid.RowDefinitions>
                      <RowDefinition Height="*" />
                      <RowDefinition Height="Auto" />
                      <RowDefinition Height="Auto" />
                      <RowDefinition Height="Auto" />
                      <RowDefinition Height="Auto" />
                      <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                      <ColumnDefinition Width="Auto" />
                      <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Label x:Name="lbl_medication" Margin="3" Grid.Row="1" VerticalAlignment="Top" Content="Medikation" />
                    <TextBox x:Name="tb_medication" Margin="3" Height="100" Grid.Column="1" Grid.Row="1"
										         VerticalScrollBarVisibility="Auto" AcceptsReturn="True"
										         Text="{Binding Path=Medication, UpdateSourceTrigger=PropertyChanged}" TextWrapping="Wrap" />
                    <Label x:Name="lbl_diag" Grid.Column="0" Grid.Row="2" Margin="3" VerticalAlignment="Top"
										       Content="Bemerkungen" />
                    <Label x:Name="lbl_diag10" Grid.Column="0" Grid.Row="3" Margin="3" VerticalAlignment="Top"
										       Content="ICD10 Diagnosen" />
                    <TextBox x:Name="tb_diag" Margin="3" Height="40" Grid.Column="1" Grid.Row="2"
										         VerticalScrollBarVisibility="Auto" AcceptsReturn="True"
										         Text="{Binding Path=Diagnosis, UpdateSourceTrigger=PropertyChanged}" TextWrapping="Wrap" />
                    <TextBox x:Name="tb_diag10" Margin="3" Height="40" Grid.Column="1" Grid.Row="3"
										         VerticalScrollBarVisibility="Auto" AcceptsReturn="True"
										         Text="{Binding Path=ICD10Diagnosis, UpdateSourceTrigger=PropertyChanged}" TextWrapping="Wrap" />
                    <Grid Grid.Row="0" Grid.ColumnSpan="2" Grid.Column="0">
                      <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                      </Grid.ColumnDefinitions>
                      <dxg:GridControl Margin="3" Name="grid_choosenDiagnosis">
                        <dxg:GridControl.Columns>
                          <dxg:GridColumn FieldName="Key" AllowResizing="True" AutoFilterCondition="Contains" FixedWidth="True"
													                Width="70" Header="ICD 10" />
                          <dxg:GridColumn FieldName="Value" AutoFilterCondition="Contains" Header="Beschreibung" Width="400">
                            <dxg:GridColumn.EditSettings>
                              <dxe:TextEditSettings TextWrapping="Wrap" />
                            </dxg:GridColumn.EditSettings>
                          </dxg:GridColumn>
                          <dxg:GridColumn AllowColumnFiltering="False" AllowAutoFilter="False" FixedWidth="True" Width="26"
													                AllowResizing="False" FieldName="Key" Header=" ">
                            <dxg:GridColumn.CellTemplate>
                              <DataTemplate>
                                <Button x:Name="button_removeDiagnosis" Width="20" Height="20"
																        ToolTip="Diagnose aus der Liste entfernen" Tag="{Binding Value}"
																        Style="{DynamicResource CloseButtonStyle}" Click="button_removeDiagnosis_Click" Margin="2" />
                              </DataTemplate>
                            </dxg:GridColumn.CellTemplate>
                          </dxg:GridColumn>
                        </dxg:GridControl.Columns>
                        <dxg:GridControl.View>
                          <dxg:TableView x:Name="gridView_choosen" NavigationStyle="None" Margin="2 30 2 2" AutoWidth="True"
													               ShowGroupPanel="False" ShowGroupedColumns="false" ShowTotalSummary="False" />
                        </dxg:GridControl.View>
                      </dxg:GridControl>
                      <!--<Label FontSize="14" Foreground="{StaticResource GridPrintMenuLightBrush}" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10 3 0 0" Content="Zugeordnete Diagnosen:" />-->
                      <Button x:Name="button_addDiagnosos" HorizontalAlignment="Left" VerticalAlignment="Top"
											        Click="button_addDiagnosos_Click" Height="25" Margin="6 6 10 0" ToolTip="Diagnose hinzufügen">
                        <Grid>
                          <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                          </Grid.ColumnDefinitions>
                          <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                          </Grid.RowDefinitions>
                          <Grid Width="18" HorizontalAlignment="Center" VerticalAlignment="Center">
                            <Line X1="4" X2="12" Y1="8" Y2="8" Fill="{x:Null}" Stroke="#FFFFFFFF" StrokeStartLineCap="Round"
														      StrokeEndLineCap="Round" StrokeThickness="2" HorizontalAlignment="Center"
														      VerticalAlignment="Center" Width="16" Height="16" />
                            <Line X1="8" X2="8" Y1="4" Y2="12" Fill="{x:Null}" Stroke="#FFFFFFFF" StrokeStartLineCap="Round"
														      StrokeEndLineCap="Round" StrokeThickness="2" HorizontalAlignment="Center"
														      VerticalAlignment="Center" Width="16" Height="16" />
                          </Grid>
                          <Label Foreground="#FFFFFFFF" Grid.Column="1">Diagnose hinzufügen</Label>
                        </Grid>
                      </Button>
                    </Grid>
                    <GroupBox Grid.Row="4" Grid.ColumnSpan="2" Grid.Column="0" Style="{StaticResource ObjectEditGroupBox}" Header="Behinderungen">
                      <Grid x:Name="grid_disabilities">
                        <Grid MinHeight="100">
                          <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                          </Grid.ColumnDefinitions>
                          <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="*" />
                          </Grid.RowDefinitions>
                          <Label Grid.Column="2" Grid.Row="0" Content="Nicht zugeordnete Behinderungen" HorizontalAlignment="Left" />
                          <ListBox Grid.Column="2" Grid.Row="1" Grid.RowSpan="2" x:Name="listbox_possibleDisabilities"
													         DisplayMemberPath="TypeDescription" ItemsSource="{Binding Path=PossibleDisabilities}"
													         IsSynchronizedWithCurrentItem="True" />
                          <Button x:Name="button_addDisability" Click="button_addDisability_Click" Grid.Column="1" Margin="3"
													        Grid.Row="1" VerticalAlignment="Bottom" Content="&lt;" FontWeight="Bold" Width="25"
													        IsEnabled="{Binding Path=SelectedIndex, Converter={StaticResource IndexBoolConverter}, ElementName=listbox_possibleDisabilities}"
													        Height="25" />
                          <Button x:Name="button_removeDisability" Click="button_removeDisability_Click" Grid.Column="1" Margin="3"
													        Grid.Row="2" VerticalAlignment="Top" Content="&gt;" FontWeight="Bold" Width="25"
													        IsEnabled="{Binding Path=SelectedIndex, Converter={StaticResource IndexBoolConverter}, ElementName=listbox_disabilities}"
													        Height="25" />
                          <Label Grid.Column="0" Grid.Row="0" Content="Diesem Klienten zugeordnete Behinderungen"
													       HorizontalAlignment="Left" />
                          <ListBox Grid.Column="0" Grid.Row="1" Grid.RowSpan="2" x:Name="listbox_disabilities"
													         DisplayMemberPath="TypeDescription" ItemsSource="{Binding Path=Disabilities}"
													         IsSynchronizedWithCurrentItem="True" />
                        </Grid>
                      </Grid>
                    </GroupBox>
                    <GroupBox Grid.Row="5" Grid.ColumnSpan="6" Grid.Column="0" Style="{StaticResource ObjectEditGroupBox}" Header="Schwerbehindertenausweis">
                      <Grid>
                        <Grid.ColumnDefinitions>
                          <ColumnDefinition Width="Auto"/>
                          <ColumnDefinition Width="Auto"/>
                          <ColumnDefinition Width="Auto"/>
                          <ColumnDefinition Width="Auto"/>
                          <ColumnDefinition Width="Auto"/>
                          <ColumnDefinition Width="Auto"/>
                          <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                          <RowDefinition Height="Auto" />
                          <RowDefinition Height="Auto" />
                          <RowDefinition Height="Auto" />
                          <RowDefinition Height="Auto" />
                          <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>

                        <Label Grid.Column="0" Grid.Row="0" Content="Aust. Vers. -amt" VerticalAlignment="Center" HorizontalAlignment="Left" />
                        <TextBox Grid.Column="1" Grid.Row="0" Margin="3" Height="23" Width="100" Text="{Binding Path=AusstVersAmt, UpdateSourceTrigger=PropertyChanged}" />

                        <Label Grid.Column="0" Grid.Row="1" Content="Ausweis unbefristet gültig" VerticalAlignment="Center" />
                        <CheckBox Grid.Column="1" Grid.Row="1" Margin="3" Height="23" x:Name="AusweisUnbefristetCheckBox"
                                                          VerticalAlignment="Center" VerticalContentAlignment="Center"
                                                          IsChecked="{Binding Path=AusweisUnbefristetGueltig, UpdateSourceTrigger=PropertyChanged}"/>

                        <Label Grid.Column="0" Grid.Row="2" Content="Ausweis gültig von" VerticalAlignment="Center" />
                        <dxe:DateEdit Grid.Column="1" Grid.Row="2" AllowNullInput="True" Height="23" Margin="3"
															  Width="100" HorizontalAlignment="Left" MaskType="DateTimeAdvancingCaret"
                                                              EditValue="{Binding Path=AusweisGueltigVon, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />

                        <Label Grid.Column="0" Grid.Row="3" Content="Ausweis gültig bis" VerticalAlignment="Center" />
                        <dxe:DateEdit Grid.Column="1" Grid.Row="3" AllowNullInput="True" Height="23" Margin="3"
															  Width="100" HorizontalAlignment="Left" MaskType="DateTimeAdvancingCaret"
                                                              EditValue="{Binding Path=AusweisGueltigBis, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
															  IsEnabled="{Binding ElementName=AusweisUnbefristetCheckBox, Path=IsChecked, Converter={StaticResource BoolReverseConverter}}" />

                        <Label Grid.Column="2" Grid.Row="0" Content="Beiblatt gültig bis" VerticalAlignment="Center" />
                        <dxe:DateEdit Grid.Column="3" Grid.Row="0" AllowNullInput="True" Height="23" Margin="3"
                                                              EditValue="{Binding Path=BeiblattGueltigBis, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
															  Width="100" HorizontalAlignment="Left" MaskType="DateTimeAdvancingCaret" />

                        <Label Grid.Column="2" Grid.Row="1" Content="Grad der Behinderung" VerticalAlignment="Center" />
                        <ComboBox Grid.Column="3" Grid.Row="1" Height="23" Margin="3" x:Name="GdBComboBox" Width="100" SelectionChanged="GdBComboBox_OnSelectionChanged"/>

                        <Label Grid.Column="2" Grid.Row="2" Content="Merkzeichen" VerticalAlignment="Center" />
                        <uc:PopUpEdit IsReadOnly="True"
                                                              DeleteButtonVisibility="Collapsed"
                                                              PopUpClick="popupedit_merkzeichen_PopUpClick"
                                                              HorizontalAlignment="Stretch"
                                                              HorizontalContentAlignment="Stretch" Height="23" Width="100" Grid.Column="3" Grid.Row="2" Margin="3"
															  Text="{Binding ElementName=MerkzeichenSelection, Path=AusgewaehlteMerkzeichenString}"
															  ToolTip="{Binding ElementName=MerkzeichenSelection, Path=AusgewaehlteMerkzeichenString}"
                                                              Cursor="Arrow" />

                        <Label Grid.Column="2" Grid.Row="3" Content="Behinderungsart" VerticalAlignment="Center" />
                        <uc:PopUpEdit IsReadOnly="True"
                                      DeleteButtonVisibility="Collapsed"
                                      PopUpClick="popupedit_behinderungsarten_PopUpClick"
                                      HorizontalAlignment="Stretch"
                                      HorizontalContentAlignment="Stretch" Height="23" Width="100" Grid.Column="3" Grid.Row="3" Margin="3"
        Text="{Binding ElementName=BehinderungsartenSelection, Path=AusgewaehlteBehinderungsartenString}"
        ToolTip="{Binding ElementName=BehinderungsartenSelection, Path=AusgewaehlteBehinderungsartenString}"
                                      Cursor="Arrow" />

                        <Label Grid.Column="4" Grid.Row="0" Content="Pflegegrad" VerticalAlignment="Center" />
                        <uc:NullItemComboBox Grid.Column="5" Grid.Row="0" Margin="3" Height="23" Width="100"
                                       ItemsSource="{x:Static core:EnumTranslations.PflegegradTranslations}"
                                       SelectedValue="{Binding Path=Pflegegrad}" DisplayMemberPath="Value"
                                       SelectedValuePath="Key" />

                      </Grid>
                    </GroupBox>
                  </Grid>
                </ScrollViewer>
              </GroupBox>
            </TabItem>
            <TabItem Header="Betreuung" Selector.Selected="TabItemEmployees_Selected">
              <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
                <Grid x:Name="grid_emplyeeRel">
                  <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                  </Grid.RowDefinitions>
                  <GroupBox x:Name="groupbox_customerCareType" Header="Betreuung" Style="{StaticResource ObjectEditGroupBox}">
                    <Grid>
                      <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" />
                      </Grid.ColumnDefinitions>
                      <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="*" />
                      </Grid.RowDefinitions>


                      <Label Content="Betreuung begonnen am" Grid.Column="0" Grid.Row="0" />
                      <dxe:DateEdit Grid.Column="1" Grid.Row="0" Height="23" Margin="3" Width="100" HorizontalAlignment="Left"
											              AllowNullInput="True"
											              EditValue="{val:ValidationBinding Path=AssistanceBegin, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
											              MaskType="DateTimeAdvancingCaret" />

                      <Label Content="Betreuung beendet am" Grid.Column="0" Grid.Row="1" />
                      <dxe:DateEdit Grid.Column="1" Grid.Row="1" Height="23" Margin="3" Width="100" HorizontalAlignment="Left"
											              AllowNullInput="True"
											              EditValue="{val:ValidationBinding Path=TerminationDate, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
											              MaskType="DateTimeAdvancingCaret" />

                      <Label Content="Grund für Beendigung" Grid.Row="2" Grid.Column="0" />
                      <ComboBox x:Name="comboBox_TerminationReason" ItemsSource="{Binding Path=TerminationReasons, Mode=OneWay}"
											          HorizontalAlignment="Left" Width="200" Grid.Column="1" Grid.Row="2" Margin="3" Height="23"
											          SelectedValue="{Binding Path=TerminationReason, Mode=TwoWay}" />

                      <Grid x:Name="ctrlAdvisedAttended" Grid.ColumnSpan="2" Grid.Column="0" Grid.Row="3" Height="23"
											      Visibility="Collapsed">
                        <Grid.ColumnDefinitions>
                          <ColumnDefinition Width="Auto" />
                          <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <RadioButton Grid.Column="0" Margin="3" VerticalAlignment="Center" HorizontalAlignment="Left"
												             IsChecked="{Binding Path=IsAdvised, UpdateSourceTrigger=PropertyChanged}"
												             Content="wird beraten" />
                        <RadioButton Grid.Column="1" Margin="3" VerticalAlignment="Center" HorizontalAlignment="Left"
												             IsChecked="{Binding Path=IsAttended, UpdateSourceTrigger=PropertyChanged}"
												             Content="wird begleitet" />
                      </Grid>


                      <Label Content="Betreuungsart" Grid.Column="2"/>
                      <ListBox Grid.Row="1" Grid.RowSpan="3" Grid.Column="2" IsSynchronizedWithCurrentItem="True" x:Name="customerCareTypeList"
											         Margin="3" Height="Auto" Padding="3,3,3,3" Width="Auto" HorizontalAlignment="Left" MinWidth="200"
											         MinHeight="20" MaxHeight="65" />

                      <StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="3">
                        <Label Content="Vermittlung" />
                        <Button x:Name="button_addPlacement" HorizontalAlignment="Center" Grid.Column="2" Width="20" Height="20"
												        Margin="5,0,0,0" VerticalAlignment="Center" Click="button_addPlacement_Click">
                          <Grid Width="18" HorizontalAlignment="Center" VerticalAlignment="Center">
                            <Line X1="4" X2="12" Y1="8" Y2="8" Fill="{x:Null}" Stroke="#FFFFFFFF" StrokeStartLineCap="Round"
														      StrokeEndLineCap="Round" StrokeThickness="2" HorizontalAlignment="Center"
														      VerticalAlignment="Center" Width="16" Height="16" />
                            <Line X1="8" X2="8" Y1="4" Y2="12" Fill="{x:Null}" Stroke="#FFFFFFFF" StrokeStartLineCap="Round"
														      StrokeEndLineCap="Round" StrokeThickness="2" HorizontalAlignment="Center"
														      VerticalAlignment="Center" Width="16" Height="16" />
                          </Grid>

                        </Button>
                      </StackPanel>

                      <ListBox Grid.Column="3" Grid.Row="1" Grid.RowSpan="3" IsSynchronizedWithCurrentItem="True"
											         x:Name="placementListBox" ItemsSource="{Binding Path=PlacementList.VMList, Mode=OneWay}" Margin="3"
											         Height="Auto" Padding="3,3,3,3" Width="Auto" HorizontalAlignment="Left" MinWidth="200"
											         MinHeight="20" MaxHeight="65">
                        <ListBox.ItemContainerStyle>
                          <Style TargetType="{x:Type ListBoxItem}">
                            <Setter Property="Margin" Value="2" />
                            <Setter Property="Padding" Value="0" />
                          </Style>
                        </ListBox.ItemContainerStyle>

                        <ListBox.ItemTemplate>
                          <DataTemplate>
                            <Grid x:Name="ItemGrid" Grid.Row="2" Grid.ColumnSpan="2">
                              <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                              </Grid.ColumnDefinitions>


                              <!--<TextBlock Text="Datum" Grid.Column="0" Grid.Row="0" Margin="0,4,3,0"/>-->

                              <dxe:DateEdit MaskType="DateTimeAdvancingCaret" Grid.Column="1" x:Name="datepicker_validUntil"
															              EditValue="{Binding Path=PlacementDate, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
															              Height="23" Grid.Row="0" Width="100" />

                              <ComboBox x:Name="comboBox_PlacementObjectives" Loaded="comboBox_PlacementObjectives_Loaded"
															          Margin="2,0,0,0" Grid.Column="2" MinWidth="100" MaxWidth="140" Height="23"
															          SelectedValue="{Binding Path=Objective, Mode=TwoWay}" />

                              <Button x:Name="button_deletePlacement" Grid.Column="3" Grid.Row="1" Width="20" Height="20"
															        VerticalAlignment="Center" HorizontalAlignment="Right"
															        Style="{DynamicResource CloseButtonStyle}" Click="button_deletePlacement_Click" Margin="3,0,0,0" />
                            </Grid>
                            <DataTemplate.Triggers>
                              <DataTrigger
																Binding="{Binding Path=IsSelected, RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}, Mode=FindAncestor}}"
																Value="True">
                                <Setter Property="Background" TargetName="ItemGrid" Value="White" />
                                <Setter Property="TextBlock.Foreground" TargetName="ItemGrid" Value="#FF000000" />
                              </DataTrigger>
                            </DataTemplate.Triggers>
                          </DataTemplate>
                        </ListBox.ItemTemplate>

                      </ListBox>


                    </Grid>
                  </GroupBox>

                  <controls:PopupNonTopmost Topmost="False" x:Name="popup_newEmployeeRel" Width="350" StaysOpen="True" Placement="MousePoint">
                    <Border Background="White" Padding="3" BorderThickness="1" BorderBrush="Gray">
                      <GroupBox x:Name="groupbox_newEmployeeRel" Header="Betreuer zuordnen" Style="{StaticResource ObjectEditGroupBox}">
                        <Grid>
                          <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                          </Grid.RowDefinitions>
                          <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />

                          </Grid.ColumnDefinitions>
                          <Label VerticalAlignment="Center" Content="Mitarbeiter" />
                          <uc:PopUpEdit IsReadOnly="True"
										DeleteButtonVisibility="Collapsed"
										Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="2" Margin="3" Height="23" x:Name="popupedit_employeeRelations"
										Text="{val:ValidationBinding Path=EmployeeRelations.NewVM.EmployeeString}"
										PopUpClick="popupedit_employeeRelations_PopUpClick"
										PreviewMouseDoubleClick="Popupedit_employeeRelations_OnPreviewMouseDoubleClick"
										Cursor="Arrow" />
                          <Label Content="Rolle" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" />
                          <ComboBox Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="2" Margin="3" Height="23"
															  ItemsSource="{Binding Path=EmployeeRelations.PossibleRoles}"
															  SelectedItem="{val:ValidationBinding Path=EmployeeRelations.NewVM.Role}" />
                          <Label Content="Notiz" Grid.Row="2" Grid.Column="0" VerticalAlignment="Top" />
                          <TextBox Grid.Row="2" Grid.Column="1" Height="50" Margin="3" Grid.ColumnSpan="2"
															 Text="{Binding Path=EmployeeRelations.NewVM.Notice, UpdateSourceTrigger=PropertyChanged}" />
                          <Button Grid.Row="3" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Bottom" Height="25"
															Margin="3" Content="Hinzufügen" x:Name="button_addEmployeeRelation"
															Click="button_addEmployeeRelation_Click" />
                          <Button Grid.Row="3" Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Height="25"
															Margin="3" Content="Abbrechen" x:Name="button_cancelEmployeeRelation"
															Click="button_cancelEmployeeRelation_Click" />
                        </Grid>
                      </GroupBox>
                    </Border>
                  </controls:PopupNonTopmost>
                  <GroupBox x:Name="GroupBoxEmployeeGrid" Header="Diesem Klienten zugeordnete Betreuer" Grid.Row="2"
									          Style="{StaticResource ObjectEditGroupBox}" Margin="0 20 0 0" MinHeight="120">
                    <Grid x:Name="employeeGrid">
                      <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="*" />
                      </Grid.RowDefinitions>
                      <Button Grid.Row="0" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Bottom" Height="25"
											        Margin="3" Content="Neuen Betreuer hinzufügen" x:Name="button_openAddEmployeeRelation"
											        Click="button_openAddEmployeeRelationn_Click" />
                    </Grid>

                  </GroupBox>

                <controls:PopupNonTopmost Topmost="False" x:Name="popup_newTeamRel" Width="350" StaysOpen="True" Placement="MousePoint">
                    <Border Background="White" Padding="3" BorderThickness="1" BorderBrush="Gray">
                      <GroupBox x:Name="groupbox_newTeamRel" Header="Team zuordnen" Style="{StaticResource ObjectEditGroupBox}" Margin="0 20 0 0">
                        <Grid>
                          <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                          </Grid.RowDefinitions>
                          <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />

                          </Grid.ColumnDefinitions>
                          <Label VerticalAlignment="Center" Content="Team" />
                          <uc:PopUpEdit IsReadOnly="True" DeleteButtonVisibility="Collapsed" Grid.ColumnSpan="2"
																  Grid.Column="1" Margin="3" Height="23" x:Name="popupedit_teamRelations"
																  Text="{val:ValidationBinding Path=TeamRelations.NewVM.TeamString}"
																  PopUpClick="popupedit_teamRelations_PopUpClick"
																  Cursor="Arrow" PreviewMouseDoubleClick="Popupedit_teamRelations_OnPreviewMouseDoubleClick" />
                          <Button Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Bottom" Height="25"
															Margin="3" Content="Hinzufügen" x:Name="button_addTeamRelation" Click="button_addTeamRelation_Click" />
                          <Button Grid.Row="1" Grid.Column="2" HorizontalAlignment="Left" VerticalAlignment="Bottom" Height="25"
															Margin="3" Content="Abbrechen" x:Name="button_cancelTeamRelation" Click="button_cancelTeamRelation_Click" />
                        </Grid>
                      </GroupBox>
                    </Border>
                  </controls:PopupNonTopmost>
                  <GroupBox x:Name="GroupBoxTeamGrid" Header="Diesem Klienten zugeordnete Teams" Grid.Row="4"
									          Style="{StaticResource ObjectEditGroupBox}" Margin="0 20 0 0">
                    <Grid x:Name="teamGrid">
                      <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="*" />
                      </Grid.RowDefinitions>
                      <Button Grid.Row="0" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Bottom" Height="25"
											        Margin="3" Content="Neues Team hinzufügen" x:Name="button_openAddTeamRelation"
											        Click="button_openAddTeamRelationn_Click" />
                    </Grid>

                  </GroupBox>
                </Grid>
              </ScrollViewer>
            </TabItem>
            <TabItem Header="Abwesenheiten" Selector.Selected="TabItemAbsenceTimes_Selected">
              <Grid x:Name="grid_absenceTimes">
                <Grid.Resources>
                  <DataTemplate x:Key="DropDownItemTemplate">
                    <Grid>
                      <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="Auto" SharedSizeGroup="combo1" />
                        <ColumnDefinition Width="Auto" SharedSizeGroup="combo2" />
                        <ColumnDefinition Width="Auto" SharedSizeGroup="combo3" />
                      </Grid.ColumnDefinitions>
                      <Label Content="{Binding Path=Description}" />
                      <Label VerticalAlignment="Center" Content="max. abrechenbar:" Grid.Column="1" IsEnabled="False" Padding="0" />
                      <Label VerticalAlignment="Center" HorizontalAlignment="Right" Grid.Column="2" IsEnabled="False" Margin="3 0" Content="{Binding Path=Hours}" Padding="0" />
                      <Label VerticalAlignment="Center" Grid.Column="3" IsEnabled="False" Margin="0" Content="h" Padding="0" />
                    </Grid>
                  </DataTemplate>
                  <DataTemplate x:Key="SelectedItemTemplate">
                    <Label Content="{Binding Path=Description}" Margin="3 0" Padding="0" />
                  </DataTemplate>
                </Grid.Resources>
                <Grid.RowDefinitions>
                  <RowDefinition Height="Auto" />
                  <RowDefinition Height="Auto" />
                  <RowDefinition Height="*" />
                  <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="Auto" />
                  <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <GroupBox Grid.Row="1" Grid.Column="0" x:Name="groupbox_newAbsenceTime" Grid.ColumnSpan="2"
								          Header="Abwesenheit hinzufügen" Style="{StaticResource ObjectEditGroupBox}">
                  <Grid>
                    <Grid.ColumnDefinitions>
                      <ColumnDefinition Width="Auto" />
                      <ColumnDefinition Width="*" />
                      <ColumnDefinition Width="Auto" />
                      <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                      <RowDefinition Height="Auto" />
                      <RowDefinition Height="Auto" />
                      <RowDefinition Height="Auto" />
                      <RowDefinition Height="Auto" />
                      <RowDefinition Height="Auto" />
                      <RowDefinition Height="*" />
                    </Grid.RowDefinitions>
                    <Label Grid.Column="0" Grid.Row="0">Startdatum</Label>
                    <Label Grid.Column="2" Grid.Row="0">Enddatum</Label>
                    <Label Grid.Column="0" Grid.Row="1">Kategorie</Label>
                    <Label Grid.Column="2" Grid.Row="1">Erläuterung</Label>
                    <Button Grid.Row="2" Grid.ColumnSpan="4" Grid.Column="0" HorizontalAlignment="Right" Margin="1,10,0,3"
										        Click="button_addAbsence_Click" Style="{DynamicResource {x:Type Button}}" Content="Abwesenheit hinzufügen" />
                    <dxe:DateEdit MaskType="DateTimeAdvancingCaret" Grid.Column="1" Grid.Row="0" Height="23" Margin="3"
										              EditValue="{val:ValidationBinding Path=AbsenceTimes.NewVM.Start, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />
                    <dxe:DateEdit MaskType="DateTimeAdvancingCaret" Grid.Column="3" Grid.Row="0" Height="23" Margin="3"
										              EditValue="{val:ValidationBinding Path=AbsenceTimes.NewVM.End, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />
                    <ComboBox Name="combox_reasons" Grid.Column="1" Grid.Row="1" Height="23" Margin="3"
										          ItemsSource="{Binding Path=AbsenceTimes.PossibleReasons}"
										          SelectedItem="{val:ValidationBinding Path=AbsenceTimes.NewVM.Reason}">
                      <ComboBox.ItemContainerStyle>
                        <Style>
                          <Setter Property="Control.HorizontalContentAlignment" Value="Stretch" />
                        </Style>
                      </ComboBox.ItemContainerStyle>
                    </ComboBox>
                    <TextBox Grid.Column="3" Grid.Row="1" Height="23" Margin="3" Text="{Binding Path=AbsenceTimes.NewVM.Notice, UpdateSourceTrigger=PropertyChanged}" />
                  </Grid>
                </GroupBox>
                <GroupBox x:Name="GroupBoxAbsenceTimes" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Header="Erfasste Abwesenheiten" Style="{StaticResource ObjectEditGroupBox}" />
              </Grid>
            </TabItem>
            <TabItem Header="Umfeld" Selector.Selected="TabItemPersons_Selected">
              <ScrollViewer VerticalScrollBarVisibility="Auto">
                <Grid x:Name="grid_environment">
                  <Grid MinHeight="100">
                    <Grid.RowDefinitions>
                      <RowDefinition Height="Auto" />
                      <RowDefinition Height="Auto" />
                      <RowDefinition Height="Auto" />
                      <RowDefinition Height="Auto" />
                      <RowDefinition Height="*" />
                    </Grid.RowDefinitions>
                    <GroupBox x:Name="groupbox_Environment" Grid.Row="0" Header="Umfeld" Style="{DynamicResource ObjectEditGroupBox}">
                      <Grid>
                        <Grid.ColumnDefinitions>
                          <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                          <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <TextBox Margin="3" Height="50" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" Text="{Binding Path=Environment, UpdateSourceTrigger=PropertyChanged}" />
                      </Grid>
                    </GroupBox>
                    <GroupBox x:Name="GroupBoxPersons" Grid.Row="2" Margin="0,20,0,0" Header="Diesem Klienten zugeordnete Personen" Style="{DynamicResource ObjectEditGroupBox}" MinHeight="150" MaxHeight="350">
                      <Grid x:Name="environmentPersonGrid">
                        <Grid.RowDefinitions>
                          <RowDefinition Height="Auto" />
                          <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <Button Grid.Row="0" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Bottom" Height="25"
								Margin="3" Content="Neue Person hinzufügen" x:Name="button_openAddEnvironmentPerson"
								Click="button_openAddEnvironmentPerson_Click" />
                        <controls:PopupNonTopmost Topmost="False" x:Name="popup_newEnvironmentPerson" Width="350" StaysOpen="True" Placement="Relative" Grid.Row="1" PlacementTarget="{Binding ElementName=button_openAddEnvironmentPerson}">
                          <Border Background="White" Padding="3" BorderThickness="1" BorderBrush="Gray">
                            <GroupBox x:Name="groupbox_newEnvironmentPerson" Header="Neue Person hinzufügen" Style="{DynamicResource ObjectEditGroupBox}">
                              <Grid>
                                <Grid.ColumnDefinitions>
                                  <ColumnDefinition Width="Auto" />
                                  <ColumnDefinition Width="*" />
                                  <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                  <RowDefinition Height="Auto" />
                                  <RowDefinition Height="Auto" />
                                  <RowDefinition Height="Auto" />
                                  <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>
                                <Label Grid.Column="0" Grid.Row="0" Content="Person" />
                                <Label Grid.Column="0" Grid.Row="1" Content="Rolle" />
                                <Label Grid.Row="2" Grid.Column="0" Content="Notiz" />

                                <uc:PopUpEdit Cursor="Arrow" NewButtonVisibility="Visible"
											    PreviewMouseDoubleClick="Popupedit_environmentPersonSearch_OnPreviewMouseDoubleClick"
											    NewClick="popupedit_environmentPersonSearch_NewClick" IsReadOnly="True"
											    x:Name="popupedit_environmentPersonSearch" Grid.Column="1" Grid.ColumnSpan="2" Margin="3" Height="23"
											    Grid.Row="0" DeleteButtonVisibility="Collapsed"
											    PopUpClick="popupedit_environmentPersonSearch_PopUpClick"
											    Text="{val:ValidationBinding Path=EnvironmentPersons.NewVM.PersonString, UpdateSourceTrigger=PropertyChanged}" />
                                <ComboBox Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="2" Margin="3" Height="23"
											ItemsSource="{Binding Path=EnvironmentPersons.PossibleRoles}"
											SelectedItem="{val:ValidationBinding Path=EnvironmentPersons.NewVM.Role}" />
                                <TextBox Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="2" Margin="3" Height="50" AcceptsReturn="True"
										    VerticalScrollBarVisibility="Auto"
										    Text="{Binding Path=EnvironmentPersons.NewVM.Notice, UpdateSourceTrigger=PropertyChanged}" />

                                <Button Grid.Column="1" Grid.Row="3" x:Name="button_addEnvironmentPerson"
										Click="button_addEnvironmentPerson_Click" Content="Hinzufügen" Height="25"
										FontWeight="Normal" Margin="3" VerticalAlignment="Bottom" HorizontalAlignment="Right" />
                                <Button Grid.Row="3" Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Height="25"
										Margin="3" Content="Abbrechen" x:Name="button_cancelAddEnvironmentPerson" Click="button_cancelAddEnvironmentPerson_Click" />
                              </Grid>
                            </GroupBox>
                          </Border>
                        </controls:PopupNonTopmost>
                      </Grid>

                    </GroupBox>




                    <GroupBox x:Name="GroupBoxOrganisations" Grid.Row="4" Margin="0,20,0,0"
												  Header="Diesem Klienten zugeordnete Organisationen" Style="{DynamicResource ObjectEditGroupBox}" VerticalAlignment="Top"
												  MinHeight="150" MaxHeight="400">
                      <Grid x:Name="environmentOrganisationGrid">
                        <Grid.RowDefinitions>
                          <RowDefinition Height="Auto" />
                          <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <Button Grid.Row="0" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Bottom" Height="25"
														Margin="3" Content="Neue Organisation hinzufügen" x:Name="button_openAddEnvironmentOrganisation"
														Click="button_openAddEnvironmentOrganisation_Click" />

                        <controls:PopupNonTopmost Topmost="False" x:Name="popup_newEnvironmentOrganisation" Width="350" StaysOpen="True" Placement="Relative" Grid.Row="1" PlacementTarget="{Binding ElementName=button_openAddEnvironmentOrganisation}">
                          <Border Background="White" Padding="3" BorderThickness="1" BorderBrush="Gray">
                            <GroupBox x:Name="groupbox_newEnvironmentOrganisation" Header="Neue Organisation hinzufügen"
                                  Style="{DynamicResource ObjectEditGroupBox}" Margin="0,10,0,0">
                              <Grid>
                                <Grid.ColumnDefinitions>
                                  <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" />
                                </Grid.RowDefinitions>
                                <Label Grid.Column="0" Grid.Row="0" Content="Organisation" />
                                <Label Grid.Column="0" Grid.Row="1" Content="Rolle" />
                                <Label Grid.Row="2" Grid.Column="0" Content="Notiz" />
                                <Label Grid.Row="3" Grid.Column="0" Content="Zusätzliche Info" />

                                <uc:PopUpEdit NewButtonVisibility="Visible"
                                        Cursor="Arrow"
                                        NewClick="popupedit_environmentOrganisationSearch_NewClick"
                                        IsReadOnly="True"
                                        x:Name="popupedit_environmentOrganisationSearch"
                                        Grid.Column="1" Margin="3" Height="23" Grid.Row="0" Grid.ColumnSpan="2"
                                        DeleteButtonVisibility="Collapsed"
                                        PopUpClick="popupedit_environmentOrganisationSearch_PopUpClick"
                                        PreviewMouseDoubleClick="Popupedit_environmentOrganisationSearch_OnPreviewMouseDoubleClick"
                                        Text="{val:ValidationBinding Path=EnvironmentOrganisations.NewVM.OrganisationString, UpdateSourceTrigger=PropertyChanged}" />


                                <ComboBox Grid.Column="1" Margin="3" Height="23" Grid.Row="1" Grid.ColumnSpan="2"
                                      ItemsSource="{Binding Path=EnvironmentOrganisations.PossibleRoles}"
                                      SelectedItem="{val:ValidationBinding Path=EnvironmentOrganisations.NewVM.Role}" />


                                <TextBox Grid.Column="1" Grid.Row="2" Margin="3" Height="50" AcceptsReturn="True" Grid.ColumnSpan="2"
                                     VerticalScrollBarVisibility="Auto"
                                     Text="{Binding Path=EnvironmentOrganisations.NewVM.Notice, UpdateSourceTrigger=PropertyChanged}" />


                                <TextBox Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="3" Margin="3" Height="50" AcceptsReturn="True"
                                     VerticalScrollBarVisibility="Auto"
                                     Text="{Binding Path=EnvironmentOrganisations.NewVM.Info1, UpdateSourceTrigger=PropertyChanged}" />


                                <Button Grid.Column="1" Grid.Row="4" x:Name="button_addEnvironmentOrganisation"
                                    Click="button_addEnvironmentOrganisation_Click" Content="Hinzufügen" Height="25"
                                    FontWeight="Normal" Margin="3" VerticalAlignment="Bottom" HorizontalAlignment="Right" />
                                <Button Grid.Row="4" Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Height="25"
                                  Margin="3" Content="Abbrechen" x:Name="button_cancelAddEnvironmentOrganisation" Click="button_cancelAddEnvironmentOrganisation_Click" />
                              </Grid>
                            </GroupBox>
                          </Border>
                        </controls:PopupNonTopmost>
                      </Grid>

                    </GroupBox>
                  </Grid>
                </Grid>
              </ScrollViewer>
            </TabItem>
            <!--<TabItem Header="Terminplanung" Name="tabitem_scheduler" Selector.Selected="tabitem_scheduler_Selected">
							<Grid x:Name="TerminplanungsGrid">
								<Grid.RowDefinitions>
									<RowDefinition Height="*" />
									<RowDefinition Height="Auto" />
								</Grid.RowDefinitions>
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="*" />
								</Grid.ColumnDefinitions>
								<Button x:Name="SelektierenBtn" Grid.Row="1" Click="SelektierenBtn_OnClick" Content="Selektieren"/>
							</Grid>
						</TabItem>-->
            <TabItem r:DemandUserRight.VisibleDemands="AssessmentSheet_View" Header="Punktebogen Kategorien">
              <ScrollViewer VerticalScrollBarVisibility="Auto">
                <Grid>
                  <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                  </Grid.RowDefinitions>
                  <GroupBox Style="{StaticResource ObjectEditGroupBox}" Header="Punktebogen Kategorien">
                    <Grid>
                      <ListView x:Name="AssessmentSheetCategoryListView" Grid.Column="1" Grid.ColumnSpan="3" Grid.Row="1"
											          Margin="3" Background="Transparent" BorderBrush="Transparent" HorizontalAlignment="Stretch"
											          ScrollViewer.HorizontalScrollBarVisibility="Disabled"
											          ItemsSource="{Binding AssessmentSheetCategories, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
                        <ListView.ItemsPanel>
                          <ItemsPanelTemplate>
                            <WrapPanel />
                          </ItemsPanelTemplate>
                        </ListView.ItemsPanel>
                        <ListView.ItemTemplate>
                          <DataTemplate>
                            <Grid>
                              <!--Visibility="{Binding Converter={StaticResource AssessmentSheetCategory2VisibilityConverter}}">-->
                              <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" SharedSizeGroup="a" />
                              </Grid.ColumnDefinitions>
                              <CheckBox Margin="3" IsChecked="{Binding IsSelected, UpdateSourceTrigger=PropertyChanged}" />
                              <TextBlock Margin="3" Grid.Column="1" Text="{Binding Description, Mode=OneWay}" />
                            </Grid>
                          </DataTemplate>
                        </ListView.ItemTemplate>
                        <ListView.Resources>
                          <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
                          <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent" />
                        </ListView.Resources>
                        <!--<ListView.ItemsPanel>
                                                <ItemsPanelTemplate>
                                                    <WrapPanel />
                                                </ItemsPanelTemplate>
                                            </ListView.ItemsPanel>-->
                      </ListView>
                    </Grid>
                  </GroupBox>
                  <GroupBox Header="Individuelle Kategorien" Style="{StaticResource ObjectEditGroupBox}" Grid.Row="1"
									          Margin="0,10,0,0">
                    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">

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

                      <Label Grid.Column="0" Grid.Row="0">Bezeichnung</Label>
                      <TextBox Grid.Column="1" Grid.Row="0" Margin="3" HorizontalAlignment="Stretch" VerticalAlignment="Top"
											         Height="23"
											         Text="{val:ValidationBinding Path=IndividualAssessmentSheetCategories.NewVM.Description, UpdateSourceTrigger=PropertyChanged}" />

                      <Label Grid.Column="2" Grid.Row="0">Position</Label>
                      <dxe:SpinEdit
												EditValue="{Binding Path=IndividualAssessmentSheetCategories.NewVM.Position, Converter={StaticResource Int2DecimalConverter}, UpdateSourceTrigger=PropertyChanged}"
												x:Name="tb_pos" IsFloatValue="False" Increment="1" MinValue="0" Height="23" Margin="3" Grid.Row="0"
												Grid.Column="3" AllowNullInput="True" Width="100" />


                      <Label Grid.Column="0" Grid.Row="1">Mögliche Werte</Label>

                      <ListView Grid.Column="1" Grid.ColumnSpan="5" Grid.Row="1" Margin="3" Background="Transparent"
											          BorderBrush="Transparent" HorizontalAlignment="Stretch"
											          ScrollViewer.HorizontalScrollBarVisibility="Disabled"
											          ItemsSource="{Binding IndividualAssessmentSheetCategories.PossibleValues}">
                        <ListView.ItemTemplate>
                          <DataTemplate>
                            <Grid>
                              <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" SharedSizeGroup="a" />
                              </Grid.ColumnDefinitions>
                              <dxe:CheckEdit Margin="3" IsChecked="{Binding IsNewSelected}" />
                              <TextBlock Margin="3" Grid.Column="1" Text="{Binding Description}" />
                            </Grid>
                          </DataTemplate>
                        </ListView.ItemTemplate>
                        <ListView.Resources>
                          <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
                          <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent" />
                        </ListView.Resources>
                        <ListView.ItemsPanel>
                          <ItemsPanelTemplate>
                            <WrapPanel />
                          </ItemsPanelTemplate>
                        </ListView.ItemsPanel>
                      </ListView>


                      <Button FontWeight="Normal" HorizontalAlignment="Left" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="4"
											        Height="25" Margin="3 3 3 3" Padding="5 0" Click="button_addIndAsc_Click" IsDefault="True">
                        Hinzufügen
                      </Button>


                      <dxg:GridControl x:Name="datagrid_asc" Margin="0,10,0,0" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="5"
											                 DataSource="{Binding IndividualAssessmentSheetCategories.VMList}">
                        <dxg:GridControl.Columns>

                          <dxg:GridColumn FieldName="IsDeleteable" Header="" FixedWidth="True" Width="24" ReadOnly="True">
                            <dxg:GridColumn.CellTemplate>
                              <DataTemplate>
                                <Button Content="r" Click="DeleteIndAscButton_Click"
																        Visibility="{Binding Path=EditValue, Converter={StaticResource BoolVisibilityConverter}}"
																        FontFamily="Webdings" Width="18" Height="18" VerticalAlignment="Center" />
                              </DataTemplate>
                            </dxg:GridColumn.CellTemplate>
                          </dxg:GridColumn>
                          <dxg:GridColumn FieldName="Position" Header="Position" Width="80" />
                          <dxg:GridColumn FieldName="Description" Header="Bezeichnung" Width="180" />
                          <dxg:GridColumn FieldName="ValuesString" Header="Mögliche Werte">
                            <dxg:GridColumn.DisplayTemplate>
                              <ControlTemplate>
                                <TextBlock Text="{Binding Value}" TextWrapping="Wrap" />
                              </ControlTemplate>
                            </dxg:GridColumn.DisplayTemplate>
                            <dxg:GridColumn.EditTemplate>
                              <ControlTemplate>
                                <Button x:Name="PART_Editor" BorderThickness="0" Style="{x:Null}" Height="21"
																        HorizontalAlignment="Stretch" Click="PART_Editor_Click">

                                  <TextBlock Text="{Binding Value}" TextWrapping="Wrap" />
                                </Button>
                              </ControlTemplate>
                            </dxg:GridColumn.EditTemplate>
                          </dxg:GridColumn>
                        </dxg:GridControl.Columns>
                        <dxg:GridControl.View>
                          <dxg:TableView AutoWidth="true" ShowGroupPanel="False" ShowGroupedColumns="false" ShowTotalSummary="False"
													               NavigationStyle="Cell" />
                        </dxg:GridControl.View>
                      </dxg:GridControl>

                      <Popup x:Name="popup_values" Width="400" StaysOpen="false" Placement="MousePoint">
                        <Border>
                          <Grid Background="White">
                            <Grid.RowDefinitions>
                              <RowDefinition Height="*" />
                              <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <ListView Margin="3" Background="White" BorderBrush="White" HorizontalAlignment="Stretch"
														          ScrollViewer.HorizontalScrollBarVisibility="Disabled"
														          ItemsSource="{Binding IndividualAssessmentSheetCategories.PossibleValues}">
                              <ListView.ItemTemplate>
                                <DataTemplate>
                                  <Grid>
                                    <Grid.ColumnDefinitions>
                                      <ColumnDefinition Width="Auto" />
                                      <ColumnDefinition Width="Auto" SharedSizeGroup="a" />
                                    </Grid.ColumnDefinitions>
                                    <dxe:CheckEdit Margin="3" IsChecked="{Binding IsEditSelected}" />
                                    <TextBlock Margin="3" Grid.Column="1" Text="{Binding Description}" />
                                  </Grid>
                                </DataTemplate>
                              </ListView.ItemTemplate>
                              <ListView.Resources>
                                <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
                                <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent" />
                              </ListView.Resources>
                              <ListView.ItemsPanel>
                                <ItemsPanelTemplate>
                                  <WrapPanel />
                                </ItemsPanelTemplate>
                              </ListView.ItemsPanel>
                            </ListView>
                            <Button FontWeight="Normal" HorizontalAlignment="Right" Grid.Row="1" Height="25" Margin="3 3 3 3"
														        Padding="5 0" Click="button_editIndAsc_Click" IsDefault="True">
                              Übernehmen
                            </Button>
                          </Grid>

                        </Border>
                      </Popup>

                    </Grid>
                  </GroupBox>
                </Grid>

              </ScrollViewer>
            </TabItem>
            <TabItem Header="Medikamentenverordnungen" Name="tabitem_Medikamentenverordnungen" Selector.Selected="tabitem_medver_Selected">
              <Grid>
                <Grid.RowDefinitions>
                  <RowDefinition Height="*" />
                  <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <UniformGrid Grid.Row="0" Grid.Column="0" Rows="3" Columns="1">
                  <GroupBox Header="Aktuelle Medikamentenverordnung" Style="{StaticResource ObjectEditGroupBox}">
                    <Grid>
                      <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="*" />
                      </Grid.RowDefinitions>
                      <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" />
                      </Grid.ColumnDefinitions>
                      <TextBlock Margin="0,3,0,3" Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" Foreground="Black">
                        <TextBlock.Inlines>
                          <Run Text="Erstellt von: " />
                          <Run FontWeight="Bold" Text="{Binding Path=AktuelleMedikamentenverordnungsliste.Ersteller, Mode=OneWay}" />
                        </TextBlock.Inlines>
                      </TextBlock>
                      <TextBlock Margin="15,3,0,3" Grid.Column="1" Grid.Row="0" VerticalAlignment="Center" Foreground="Black">
                        <TextBlock.Inlines>
                          <Run Text="Datum: " />
                          <Run FontWeight="Bold" Text="{Binding Path=AktuelleMedikamentenverordnungsliste.ErstellDatum, Mode=OneWay}" />
                        </TextBlock.Inlines>
                      </TextBlock>
                      <StackPanel Grid.Column="2" Grid.Row="0" Margin="0,3,0,3" HorizontalAlignment="Right" Orientation="Horizontal">
                        <StackPanel Orientation="Horizontal">
                          <TextBlock Margin="3" FontSize="14"  HorizontalAlignment="Left" VerticalAlignment="Center">
                            <Hyperlink x:Name="LinkAktuelleListeDrucken" TargetName="_NewWindow" Foreground="#FF2B508B" RequestNavigate="LinkAktuelleListeDrucken_OnRequestNavigate">
                              <Run Text="Drucken" />
                            </Hyperlink>
                          </TextBlock>
                          <TextBlock Margin="3" FontSize="14"  HorizontalAlignment="Left" VerticalAlignment="Center">
                            <Hyperlink x:Name="LinkListeMitZusatzFeldern" TargetName="_NewWindow" Foreground="#FF2B508B" RequestNavigate="LinkListeMitZusatzeldernDrucken_OnRequestNavigate">
                              <Run Text="Drucken mit Zusatzfeldern" />
                            </Hyperlink>
                          </TextBlock>
                        </StackPanel>
                        <Button Content="Bearbeiten" IsEnabled="{Binding Path=AktuelleMedikamentenverordnungsliste, Converter={StaticResource BoolNullCheckConverter}}" Click="EditMedVerordnungClick" VerticalAlignment="Center" />
                        <Button Content="Löschen" IsEnabled="{Binding Path=AktuelleMedikamentenverordnungsliste, Converter={StaticResource BoolNullCheckConverter}}" Margin="3,0,0,0" Click="RemoveMedVerordnungClick" VerticalAlignment="Center" />
                      </StackPanel>
                      <Grid x:Name="AktuelleMVRGrid" Grid.Row="1" Grid.ColumnSpan="3" Grid.Column="0" />
                    </Grid>
                  </GroupBox>
                  <GroupBox Header="Bedarfsmedikation" Style="{StaticResource ObjectEditGroupBox}">
                    <Grid>
                      <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="*" />
                      </Grid.RowDefinitions>
                      <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" />
                      </Grid.ColumnDefinitions>
                      <TextBlock Margin="0,3,0,3" Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" Foreground="Black">
                        <TextBlock.Inlines>
                          <Run Text="Erstellt von: " />
                          <Run FontWeight="Bold" Text="{Binding Path=Bedarfsmedikamentenverordnungsliste.Ersteller, Mode=OneWay}" />
                        </TextBlock.Inlines>
                      </TextBlock>
                      <TextBlock Margin="15,3,0,3" Grid.Column="1" Grid.Row="0" VerticalAlignment="Center" Foreground="Black">
                        <TextBlock.Inlines>
                          <Run Text="Datum: " />
                          <Run FontWeight="Bold" Text="{Binding Path=Bedarfsmedikamentenverordnungsliste.ErstellDatum, Mode=OneWay}" />
                        </TextBlock.Inlines>
                      </TextBlock>
                      <StackPanel Grid.Column="2" Grid.Row="0" Margin="0,3,0,3" HorizontalAlignment="Right" Orientation="Horizontal">
                        <StackPanel Orientation="Horizontal">
                          <TextBlock Margin="3" FontSize="14"  HorizontalAlignment="Left" VerticalAlignment="Center">
                            <Hyperlink x:Name="LinkBedarfsListeDrucken" TargetName="_NewWindow" Foreground="#FF2B508B" RequestNavigate="LinkBedarfsListeDrucken_OnRequestNavigate">
                              <Run Text="Drucken" />
                            </Hyperlink>
                          </TextBlock>
                          <TextBlock Margin="3" FontSize="14"  HorizontalAlignment="Left" VerticalAlignment="Center">
                            <Hyperlink x:Name="LinkBedarfsListeMitZusatzFeldern" TargetName="_NewWindow" Foreground="#FF2B508B" RequestNavigate="LinkBedarfsListeMitZusatzeldernDrucken_OnRequestNavigate">
                              <Run Text="Drucken mit Zusatzfeldern" />
                            </Hyperlink>
                          </TextBlock>
                        </StackPanel>
                        <Button Content="Bearbeiten" IsEnabled="{Binding Path=Bedarfsmedikamentenverordnungsliste, Converter={StaticResource BoolNullCheckConverter}}" Click="EditBedarfMedVerordnungClick" VerticalAlignment="Center" />
                        <Button Content="Löschen" IsEnabled="{Binding Path=Bedarfsmedikamentenverordnungsliste, Converter={StaticResource BoolNullCheckConverter}}" Margin="3,0,0,0" Click="RemoveBedarfsMedVerordnungClick" VerticalAlignment="Center" />
                      </StackPanel>
                      <Grid x:Name="BedarfsMVRGrid" Grid.Row="1" Grid.ColumnSpan="3" Grid.Column="0" />
                    </Grid>
                  </GroupBox>
                  <GroupBox x:Name="GroupBoxMedikamentenverordnungen" Header="Historie" Style="{StaticResource ObjectEditGroupBox}" />
                </UniformGrid>
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="1">
                  <Button Content="Neu aus Bedarfsverordnung" IsEnabled="{Binding Path=Bedarfsmedikamentenverordnungsliste, Converter={StaticResource BoolNullCheckConverter}}" Click="MedVerAusBedarfsListeClick" Margin="3" />
                  <Button Content="Neu aus aktueller Verordnung" IsEnabled="{Binding Path=AktuelleMedikamentenverordnungsliste, Converter={StaticResource BoolNullCheckConverter}}" Click="MedVerAusListeClick" Margin="3" />
                  <Button Content="Neue Medikamentenverordnung" Click="NeueMVLHinzufuegenClick" Margin="3" />
                </StackPanel>
              </Grid>
            </TabItem>
            <TabItem Header="Bargeldverwaltung" Name="tabitem_Bargeldverwaltung" Selector.Selected="Tabitem_Bargeldverwaltung_OnSelected">
				
              <!--<Grid x:Name="BargeldverwaltungsGrid">
                <Grid.RowDefinitions>
                  <RowDefinition Height="Auto" />
                  <RowDefinition Height="Auto" />
                  <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="Auto" />
                  <ColumnDefinition Width="Auto" />
                  <ColumnDefinition Width="Auto" />
                  <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <StackPanel Grid.Column="0" Grid.Row="0" Orientation="Horizontal" Grid.ColumnSpan="2">
                  <Label VerticalAlignment="Center">Kassenbestand</Label>
                  <dxe:TextEdit MaskType="Numeric" Mask="c" MaskUseAsDisplayFormat="True" Height="23" Margin="3" EditMode="InplaceInactive"
								Width="100" EditValue="{Binding Path=Kassenbestand, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center" />

                  <Label VerticalAlignment="Center">Auszahlungsintervall</Label>
                  <dxe:ComboBoxEdit VerticalAlignment="Center" Height="23" HorizontalAlignment="Left" Width="150" IsTextEditable="False" Margin="3,0,3,3" IsEnabled="{Binding Path=DarfBargeldtransaktionenBearbeiten, RelativeSource={RelativeSource AncestorType={x:Type detail:CustomerView}}}"
									ItemsSource="{Binding Path=Values, Source={x:Static core:DisplayEnum.Auszahlungsintervall}}"
									EditValue="{Binding Path=Auszahlungsintervall, UpdateSourceTrigger=PropertyChanged}" />
                </StackPanel>
                <StackPanel Grid.Column="3" Grid.Row="0" HorizontalAlignment="Right" Orientation="Horizontal">
                  <ComboBox x:Name="KassenbuchMonatsCB" Margin="3">
                    <ComboBoxItem>1</ComboBoxItem>
                    <ComboBoxItem>2</ComboBoxItem>
                    <ComboBoxItem>3</ComboBoxItem>
                    <ComboBoxItem>4</ComboBoxItem>
                    <ComboBoxItem>5</ComboBoxItem>
                    <ComboBoxItem>6</ComboBoxItem>
                    <ComboBoxItem>7</ComboBoxItem>
                    <ComboBoxItem>8</ComboBoxItem>
                    <ComboBoxItem>9</ComboBoxItem>
                    <ComboBoxItem>10</ComboBoxItem>
                    <ComboBoxItem>11</ComboBoxItem>
                    <ComboBoxItem>12</ComboBoxItem>
                  </ComboBox>
                  <ComboBox x:Name="KassenbuchJahresCB" Margin="3" />
                  <TextBlock Margin="3" FontSize="14" VerticalAlignment="Center" PreviewMouseLeftButtonDown="UIElement_OnPreviewMouseLeftButtonDown">
                    <Hyperlink x:Name="LinkKassenbuchDrucken" TargetName="_NewWindow" Foreground="#FF2B508B">
                      <Run Text="Kassenbuch Drucken" />
                    </Hyperlink>
                  </TextBlock>
                </StackPanel>
                <GroupBox x:Name="NeueZahlungsGroupBox" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="4" Style="{StaticResource ObjectEditGroupBox}" Header="Neue Zahlung">
                <Grid x:Name="NeueTransaktionsGrid">
                    <Grid.ColumnDefinitions>
                      <ColumnDefinition Width="Auto" />
                      <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Grid Grid.Column="0">
                      <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="*" />
                      </Grid.RowDefinitions>
                      <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                      <Label Grid.Column="0" Grid.Row="0">Datum</Label>
                      <dxe:DateEdit Grid.Column="1" Grid.Row="0" Width="100" MaskType="DateTimeAdvancingCaret" Height="23" Margin="3" EditValue="{val:ValidationBinding Path=Bargeldtransaktionsliste.NewVM.Zahlungsdatum, UpdateSourceTrigger=PropertyChanged}" />

                      <Label Grid.Column="2" Grid.Row="0">Art</Label>
                      <dxe:ComboBoxEdit Grid.Column="3" Grid.Row="0" Height="23" HorizontalAlignment="Left" Width="150" IsTextEditable="False" Margin="3,0,3,3"
										EditValue="{val:ValidationBinding Path=Bargeldtransaktionsliste.NewVM.Zahlungstyp, UpdateSourceTrigger=PropertyChanged}"
										ItemsSource="{Binding Path=Values, Source={x:Static core:DisplayEnum.Zahlungstyp}}" />

                      <Label Grid.Column="4" Grid.Row="0">Betrag</Label>
                      <dxe:TextEdit Grid.Column="5" Grid.Row="0" MaskType="Numeric" Mask="########0.00" MaskUseAsDisplayFormat="True" Height="23" Margin="3" Width="100"
														  EditValue="{val:ValidationBinding Path=Bargeldtransaktionsliste.NewVM.Betrag, UpdateSourceTrigger=PropertyChanged}" />

                        <Label Grid.Row="1" Grid.Column="0" Content="Notiz" />
                        <TextBox Margin="3" Grid.Column="1" Grid.ColumnSpan="5" Grid.Row="1"
									Text="{Binding Path=Bargeldtransaktionsliste.NewVM.Notice, UpdateSourceTrigger=PropertyChanged}" Height="60"
									VerticalAlignment="Stretch" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Left"
									ScrollViewer.CanContentScroll="False" VerticalScrollBarVisibility="Auto"
									HorizontalScrollBarVisibility="Hidden" TextWrapping="Wrap" AcceptsReturn="True"
									AutoWordSelection="True" Language="de-DE" SpellCheck.IsEnabled="True" />

                        <Button Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="6" HorizontalAlignment="Right" Margin="3" Click="AddBargeldTransaktion">Hinzufügen</Button>
                    </Grid>
                  </Grid>
                </GroupBox>

                <GroupBox Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="4" Style="{StaticResource ObjectEditGroupBox}" Header="Ein- und Auszahlungen">
                  <dxg:GridControl Name="grid_bargeldtransaktionen" ItemsSource="{Binding Path=Bargeldtransaktionsliste.VMList}" CustomColumnSort="Grid_Bargeldtransaktionen_OnCustomColumnSort">
                    <dxg:GridControl.Columns>
                      <dxg:GridColumn Header="" FixedWidth="True" Width="24" ReadOnly="True" Visible="{Binding Path=DarfBargeldtransaktionenBearbeiten, RelativeSource={RelativeSource AncestorType={x:Type detail:CustomerView}}}">
                        <dxg:GridColumn.CellTemplate>
                          <DataTemplate>
                            <Button Content="r" Click="button_bargeldtransaktionDeleteClick" FontFamily="Webdings" Width="18" Height="18" VerticalAlignment="Center" />
                          </DataTemplate>
                        </dxg:GridColumn.CellTemplate>
                      </dxg:GridColumn>
                      <dxg:GridColumn Header="Datum" FieldName="Zahlungsdatum" EditSettings="{dxe:DateSettings DisplayFormat=d}" AllowEditing="{Binding Path=BargeldtransaktionenBearbeitenAlsDefaultBooelan, RelativeSource={RelativeSource AncestorType={x:Type detail:CustomerView}}}" />
                      <dxg:GridColumn Header="Art" FieldName="Zahlungstyp" AllowEditing="{Binding Path=BargeldtransaktionenBearbeitenAlsDefaultBooelan, RelativeSource={RelativeSource AncestorType={x:Type detail:CustomerView}}}">
                        <dxg:GridColumn.EditSettings>
                          <dxe:ComboBoxEditSettings ItemsSource="{Binding Path=Values, Source={x:Static core:DisplayEnum.Zahlungstyp}}" IsTextEditable="False" />
                        </dxg:GridColumn.EditSettings>
                      </dxg:GridColumn>

                      <dxg:GridColumn Header="Betrag" FieldName="Betrag" AllowEditing="{Binding Path=BargeldtransaktionenBearbeitenAlsDefaultBooelan, RelativeSource={RelativeSource AncestorType={x:Type detail:CustomerView}}}">
                        <dxg:GridColumn.EditSettings>
                          <dxe:TextEditSettings MaskType="Numeric" Mask="c" MaskUseAsDisplayFormat="True" />
                        </dxg:GridColumn.EditSettings>
                      </dxg:GridColumn>
                                            <dxg:GridColumn Header="Notiz" FieldName="Notice" AllowEditing="{Binding Path=BargeldtransaktionenBearbeitenAlsDefaultBooelan, RelativeSource={RelativeSource AncestorType={x:Type detail:CustomerView}}}"/>
                      <dxg:GridColumn FieldName="X" Header="Drucken" ReadOnly="True">
                        <dxg:GridColumn.CellTemplate>
                          <DataTemplate>
                            <TextBlock x:Name="textblock_link_pdfexport" VerticalAlignment="Center" Margin="3,0,0,0">
                              <Hyperlink x:Name="LinkZahlungsbelegDrucken" Click="LinkZahlungsbelegDruckenClick" TargetName="_NewWindow"
																	   Foreground="#FF2B508B">
                                <Run Text="Zahlungsbeleg Drucken" />
                              </Hyperlink>
                            </TextBlock>
                          </DataTemplate>
                        </dxg:GridColumn.CellTemplate>
                      </dxg:GridColumn>
                    </dxg:GridControl.Columns>
                    <dxg:GridControl.View>
                      <dxg:TableView NavigationStyle="Cell" Margin="2 2 2 2" AutoWidth="True"
														   ShowAutoFilterRow="False" ShowGroupPanel="False" ShowGroupedColumns="False"
												           ShowTotalSummary="False" />
                    </dxg:GridControl.View>
                  </dxg:GridControl>
                </GroupBox>
              </Grid>-->
            </TabItem>
			  <TabItem Header="Dokumente" Name="tabitem_documents" Selector.Selected="tabitem_documents_Selected" />
           
            <TabItem Header="Chat Service" Name="tabitem_chatservice" Selector.Selected="tabitem_chatservice_Selected" />
            
			  <TabItem Header="Log" Name="tabitem_log" Selector.Selected="tabitem_log_Selected" />
          </TabControl>
          <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 r:DemandUserRight.VisibleDemands="EditAll, CustomerView_Edit" x:Name="btnSave" Content="Speichern"
						        Margin="0,0,2,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>
    </uc:ShadowChrome>
    <Popup Margin="10" Name="popup_employee" StaysOpen="False" Placement="MousePoint" Width="370" Height="250"
		       Closed="popup_Closed" Opened="popup_Opened">
      <localSearchView:EmployeeSearchView ItemSelected="EmployeeSearchView_ItemSelected_1" x:Name="employeesearchview" />
    </Popup>
    <Popup Margin="10" Name="popup_team" StaysOpen="False" Placement="MousePoint" Width="370" Height="250"
		       Closed="popup_Closed" Opened="popup_Opened">
      <localSearchView:TeamSearchView ItemSelected="TeamSearchView_ItemSelected_1" x:Name="teamsearchview" />
    </Popup>
    <Popup Margin="10" x:Name="popup_person" StaysOpen="False" Placement="MousePoint" Width="370" Height="250"
		       Closed="popup_Closed" Opened="popup_Opened">
      <localSearchView:PersonSearchView x:Name="personsearchview" />
    </Popup>
    <Popup Margin="10" x:Name="popup_organisation" StaysOpen="False" Placement="MousePoint" Width="370" Height="250"
		       Closed="popup_Closed" Opened="popup_Opened">
      <localSearchView:OrganisationSearchView SearchMode="All" x:Name="organisationsearchview" />
    </Popup>
    <Popup Margin="10" x:Name="popup_costBearer" StaysOpen="False" Placement="MousePoint" Width="370" Height="250"
		       Closed="popup_Closed" Opened="popup_Opened">
      <localSearchView:OrganisationSearchView SearchMode="CostBearer" x:Name="costbearersearchview"
			                                        ItemSelected="costbearersearchview_ItemSelected" />
    </Popup>
    <Popup Name="PopupBehinderungsarten" StaysOpen="False" Placement="MousePoint" Width="270" Height="300" >
      <controls:BehinderungsartenSelectionControl x:Name="BehinderungsartenSelection" AusgewaehlteBehinderungsarten="{Binding Path=PublicViewModel.BehinderungsartenListe, RelativeSource={RelativeSource AncestorType={x:Type detail:CustomerView}}, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />
    </Popup>
    <Popup Name="PopupMerkzeichen" StaysOpen="False" Placement="MousePoint" Width="270" Height="240" >
      <controls:MerkzeichenSelectionControl x:Name="MerkzeichenSelection" AusgewaehlteMerkzeichen="{Binding Path=PublicViewModel.MerkzeichenListe, RelativeSource={RelativeSource AncestorType={x:Type detail:CustomerView}}, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />
    </Popup>
    <Border x:Name="popup_content" />
  </Grid>
</localView:BeWoView>