<mah:MetroWindow x:Class="ZKuP.ManageVisitor"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:ZKuP"
        mc:Ignorable="d"
        xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
        Title="Besucher verwalten" Height="611" Width="1390" ResizeMode="NoResize"
        WindowStartupLocation="CenterOwner" Loaded="Window_Loaded">
    <mah:MetroWindow.Resources>
        <ResourceDictionary>
            <ControlTemplate x:Key="ComboBoxControlTemplate1" TargetType="{x:Type ComboBox}">
                <Grid x:Name="templateRoot" SnapsToDevicePixels="True">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Width="0"/>
                    </Grid.ColumnDefinitions>
                    <Popup x:Name="PART_Popup" AllowsTransparency="True" Grid.ColumnSpan="2" MinWidth="{Binding ActualWidth, ElementName=templateRoot}" IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Margin="1" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom">
                        <!--</Themes:SystemDropShadowChrome>-->
                        <!--<Themes:SystemDropShadowChrome x:Name="shadow" Color="Transparent" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=templateRoot}">-->
                        <Border x:Name="DropDownBorder" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}">
                            <ScrollViewer x:Name="DropDownScrollViewer">
                                <Grid x:Name="grid" RenderOptions.ClearTypeHint="Enabled">
                                    <Canvas x:Name="canvas" HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">
                                        <Rectangle x:Name="OpaqueRect" Fill="{Binding Background, ElementName=DropDownBorder}" Height="{Binding ActualHeight, ElementName=DropDownBorder}" Width="{Binding ActualWidth, ElementName=DropDownBorder}"/>
                                    </Canvas>
                                    <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                                </Grid>
                            </ScrollViewer>
                        </Border>
                    </Popup>
                    <ToggleButton x:Name="toggleButton" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}">
                        <ToggleButton.Style>
                            <Style TargetType="{x:Type ToggleButton}">
                                <Setter Property="OverridesDefaultStyle" Value="True"/>
                                <Setter Property="IsTabStop" Value="False"/>
                                <Setter Property="Focusable" Value="False"/>
                                <Setter Property="ClickMode" Value="Press"/>
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="{x:Type ToggleButton}">
                                            <Border x:Name="templateRoot" BorderBrush="#99ACACAC" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True">
                                                <Border.Background>
                                                    <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                                        <GradientStop Color="#99F0F0F0" Offset="0"/>
                                                        <GradientStop Color="#99FFFFFF" Offset="1"/>
                                                    </LinearGradientBrush>
                                                </Border.Background>
                                                <Border x:Name="splitBorder" BorderBrush="Transparent" BorderThickness="1" HorizontalAlignment="Right" Margin="0" SnapsToDevicePixels="True" Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}">
                                                    <Path x:Name="Arrow" Data="F1M0,0L2.667,2.66665 5.3334,0 5.3334,-1.78168 2.6667,0.88501 0,-1.78168 0,0z" Fill="#CC000000" HorizontalAlignment="Center" Margin="0" VerticalAlignment="Center"/>
                                                </Border>
                                            </Border>
                                            <ControlTemplate.Triggers>
                                                <MultiDataTrigger>
                                                    <MultiDataTrigger.Conditions>
                                                        <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ComboBox}}}" Value="true"/>
                                                        <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="false"/>
                                                        <Condition Binding="{Binding IsPressed, RelativeSource={RelativeSource Self}}" Value="false"/>
                                                        <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="true"/>
                                                    </MultiDataTrigger.Conditions>
                                                    <Setter Property="Background" TargetName="templateRoot" Value="White"/>
                                                    <Setter Property="BorderBrush" TargetName="templateRoot" Value="#4CABADB3"/>
                                                    <Setter Property="Background" TargetName="splitBorder" Value="Transparent"/>
                                                    <Setter Property="BorderBrush" TargetName="splitBorder" Value="Transparent"/>
                                                </MultiDataTrigger>
                                                <Trigger Property="IsMouseOver" Value="True">
                                                    <Setter Property="Fill" TargetName="Arrow" Value="Black"/>
                                                </Trigger>
                                                <MultiDataTrigger>
                                                    <MultiDataTrigger.Conditions>
                                                        <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
                                                        <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ComboBox}}}" Value="false"/>
                                                    </MultiDataTrigger.Conditions>
                                                    <Setter Property="Background" TargetName="templateRoot">
                                                        <Setter.Value>
                                                            <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                                                <GradientStop Color="#4CECF4FC" Offset="0"/>
                                                                <GradientStop Color="#4CDCECFC" Offset="1"/>
                                                            </LinearGradientBrush>
                                                        </Setter.Value>
                                                    </Setter>
                                                    <Setter Property="BorderBrush" TargetName="templateRoot" Value="#4C7EB4EA"/>
                                                </MultiDataTrigger>
                                                <MultiDataTrigger>
                                                    <MultiDataTrigger.Conditions>
                                                        <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
                                                        <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ComboBox}}}" Value="true"/>
                                                    </MultiDataTrigger.Conditions>
                                                    <Setter Property="Background" TargetName="templateRoot" Value="White"/>
                                                    <Setter Property="BorderBrush" TargetName="templateRoot" Value="#4C7EB4EA"/>
                                                    <Setter Property="Background" TargetName="splitBorder">
                                                        <Setter.Value>
                                                            <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                                                <GradientStop Color="#4CEBF4FC" Offset="0"/>
                                                                <GradientStop Color="#4CDCECFC" Offset="1"/>
                                                            </LinearGradientBrush>
                                                        </Setter.Value>
                                                    </Setter>
                                                    <Setter Property="BorderBrush" TargetName="splitBorder" Value="#4C7EB4EA"/>
                                                </MultiDataTrigger>
                                                <Trigger Property="IsPressed" Value="True">
                                                    <Setter Property="Fill" TargetName="Arrow" Value="Black"/>
                                                </Trigger>
                                                <MultiDataTrigger>
                                                    <MultiDataTrigger.Conditions>
                                                        <Condition Binding="{Binding IsPressed, RelativeSource={RelativeSource Self}}" Value="true"/>
                                                        <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ComboBox}}}" Value="false"/>
                                                    </MultiDataTrigger.Conditions>
                                                    <Setter Property="Background" TargetName="templateRoot">
                                                        <Setter.Value>
                                                            <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                                                <GradientStop Color="#4CDAECFC" Offset="0"/>
                                                                <GradientStop Color="#4CC4E0FC" Offset="1"/>
                                                            </LinearGradientBrush>
                                                        </Setter.Value>
                                                    </Setter>
                                                    <Setter Property="BorderBrush" TargetName="templateRoot" Value="#4C569DE5"/>
                                                </MultiDataTrigger>
                                                <MultiDataTrigger>
                                                    <MultiDataTrigger.Conditions>
                                                        <Condition Binding="{Binding IsPressed, RelativeSource={RelativeSource Self}}" Value="true"/>
                                                        <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ComboBox}}}" Value="true"/>
                                                    </MultiDataTrigger.Conditions>
                                                    <Setter Property="Background" TargetName="templateRoot" Value="White"/>
                                                    <Setter Property="BorderBrush" TargetName="templateRoot" Value="#4C569DE5"/>
                                                    <Setter Property="Background" TargetName="splitBorder">
                                                        <Setter.Value>
                                                            <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                                                <GradientStop Color="#4CDAEBFC" Offset="0"/>
                                                                <GradientStop Color="#4CC4E0FC" Offset="1"/>
                                                            </LinearGradientBrush>
                                                        </Setter.Value>
                                                    </Setter>
                                                    <Setter Property="BorderBrush" TargetName="splitBorder" Value="#4C569DE5"/>
                                                </MultiDataTrigger>
                                                <Trigger Property="IsEnabled" Value="False">
                                                    <Setter Property="Fill" TargetName="Arrow" Value="#4C000000"/>
                                                </Trigger>
                                                <MultiDataTrigger>
                                                    <MultiDataTrigger.Conditions>
                                                        <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
                                                        <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ComboBox}}}" Value="false"/>
                                                    </MultiDataTrigger.Conditions>
                                                    <Setter Property="Background" TargetName="templateRoot" Value="#4CF0F0F0"/>
                                                    <Setter Property="BorderBrush" TargetName="templateRoot" Value="#4CD9D9D9"/>
                                                </MultiDataTrigger>
                                                <MultiDataTrigger>
                                                    <MultiDataTrigger.Conditions>
                                                        <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
                                                        <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ComboBox}}}" Value="true"/>
                                                    </MultiDataTrigger.Conditions>
                                                    <Setter Property="Background" TargetName="templateRoot" Value="White"/>
                                                    <Setter Property="BorderBrush" TargetName="templateRoot" Value="#4CBFBFBF"/>
                                                    <Setter Property="Background" TargetName="splitBorder" Value="Transparent"/>
                                                    <Setter Property="BorderBrush" TargetName="splitBorder" Value="Transparent"/>
                                                </MultiDataTrigger>
                                            </ControlTemplate.Triggers>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                        </ToggleButton.Style>
                    </ToggleButton>
                    <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" Content="{TemplateBinding SelectionBoxItem}" ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsHitTestVisible="False" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                </Grid>
                <ControlTemplate.Triggers>
                    <!--<Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="True">
                                <Setter Property="Margin" TargetName="shadow" Value="0,0,5,5"/>
                                <Setter Property="Color" TargetName="shadow" Value="#71000000"/>
                            </Trigger>-->
                    <Trigger Property="HasItems" Value="False">
                        <Setter Property="Height" TargetName="DropDownBorder" Value="95"/>
                    </Trigger>
                    <MultiTrigger>
                        <MultiTrigger.Conditions>
                            <Condition Property="IsGrouping" Value="True"/>
                            <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="False"/>
                        </MultiTrigger.Conditions>
                        <Setter Property="ScrollViewer.CanContentScroll" Value="False"/>
                    </MultiTrigger>
                    <Trigger Property="CanContentScroll" SourceName="DropDownScrollViewer" Value="False">
                        <Setter Property="Canvas.Top" TargetName="OpaqueRect" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}"/>
                        <Setter Property="Canvas.Left" TargetName="OpaqueRect" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}"/>
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
        </ResourceDictionary>
    </mah:MetroWindow.Resources>
    <Grid>
        <TextBox x:Name="tbName" HorizontalAlignment="Left" Height="23" Margin="10,57,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="340" TabIndex="1" PreviewKeyDown="TextBoxes_PreviewKeyDown" TextChanged="tbName_TextChanged" LostFocus="tbName_LostFocus"/>
        <TextBlock HorizontalAlignment="Left"  Margin="10,36,0,0" TextWrapping="Wrap" Text="Name des Besuchers" VerticalAlignment="Top"/>
        <TextBox x:Name="tbVerantwortlicher_MA" HorizontalAlignment="Left" Height="23" Margin="10,106,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="340" TabIndex="2" PreviewKeyDown="TextBoxes_PreviewKeyDown"/>
        <TextBlock HorizontalAlignment="Left" Margin="10,85,0,0" TextWrapping="Wrap" Text="Verantwortlicher Mitarbeiter der DB" VerticalAlignment="Top"/>
        <TextBox x:Name="tbTel_Besucher" HorizontalAlignment="Left" Height="23" Margin="10,155,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="340" TabIndex="3" PreviewKeyDown="TextBoxes_PreviewKeyDown" PreviewTextInput="Tel_Nr_Besucher_PreviewTextInput"/>
        <TextBlock HorizontalAlignment="Left" Margin="10,134,0,0" TextWrapping="Wrap" VerticalAlignment="Top"><Run Text="Telefonnummer "/><Run Text="Besucher"/></TextBlock>
        <TextBox x:Name="tbAnzahl_Begleiter" HorizontalAlignment="Left" Height="23" Margin="10,204,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="340" TabIndex="4" PreviewKeyDown="TbAnzahl_Begleiter_PreviewKeyDown" PreviewTextInput="tbAnzahl_Begleiter_PreviewTextInput" ToolTip="Nur Zahlen und max. 2 Stellen" CommandManager.PreviewExecuted="Textboxes_PreviewExecuted" ContextMenu="{x:Null}"/>
        <TextBlock HorizontalAlignment="Left" Margin="10,183,0,0" TextWrapping="Wrap" Text="Gesamtanzahl Personen" VerticalAlignment="Top"/>
        <TextBlock HorizontalAlignment="Left" Margin="10,232,0,0" TextWrapping="Wrap" Text="Besuchstag" VerticalAlignment="Top"/>
        <TextBlock HorizontalAlignment="Left" Margin="10,281,0,0" TextWrapping="Wrap" Text="Grund des Besuchs" VerticalAlignment="Top"/>
        <TextBox x:Name="tbAnsprechp_Intern" HorizontalAlignment="Left" Height="23" Margin="10,445,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="340" TabIndex="8" PreviewKeyDown="TextBoxes_PreviewKeyDown"/>
        <TextBlock HorizontalAlignment="Left" Margin="10,424,0,0" TextWrapping="Wrap" Text="Ansprechpartner intern" VerticalAlignment="Top"/>
        <TextBox x:Name="tbTel_Ansprechp" HorizontalAlignment="Left" Height="23" Margin="10,494,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="340" TabIndex="9" PreviewKeyDown="TextBoxes_PreviewKeyDown"/>
        <TextBlock HorizontalAlignment="Left" Margin="10,473,0,0" TextWrapping="Wrap" Text="Telefonnummer Ansprechpartner" VerticalAlignment="Top"/>
        <DatePicker local:DatePickerHelper.ShowTodayButton="True" local:DatePickerHelper.ShowTodayButtonContent="Heute" x:Name="dpBesuchstag" HorizontalAlignment="Left" Margin="10,253,0,0" VerticalAlignment="Top" TabIndex="5" PreviewKeyDown="DpBesuchstag_PreviewKeyDown" DateValidationError="dpBesuchstag_DateValidationError"/>
        <Button x:Name="btnAdd" Content="Hinzufügen&#xA;       →" FontSize="12" Padding="-2" HorizontalAlignment="Left" Margin="355,36,0,55" Width="75" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Click="BtnAdd_Click" TabIndex="10" PreviewKeyDown="TextBoxes_PreviewKeyDown"/>
        <DataGrid x:Name="dgVisitors" ItemsSource="{Binding Path=., Mode=OneWay}" KeyboardNavigation.TabNavigation="None" Margin="435,36,10,55" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="True" HorizontalScrollBarVisibility="Visible" PreviewKeyDown="DgVisitors_PreviewKeyDown" CellEditEnding="DgVisitors_CellEditEnding" BeginningEdit="DgVisitors_BeginningEdit" SelectionChanged="dgVisitors_SelectionChanged" PreparingCellForEdit="dgVisitors_PreparingCellForEdit" ToolTip="Daten können per Doppelklick geändert werden">
            <DataGrid.CellStyle>
                <!--Override Highlighting so that its easy to see what is selected even when the control is not focused-->
                <Style TargetType="{x:Type DataGridCell}">
                    <Style.Triggers>
                        <Trigger  Property="IsSelected" Value="true">
                            <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}" />
                            <Setter Property="BorderBrush" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
                        </Trigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsSelected}" Value="True" />
                                <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}, Path=IsKeyboardFocusWithin}" Value="False" />
                            </MultiDataTrigger.Conditions>
                            <MultiDataTrigger.Setters>
                                <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
                                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}" />
                                <Setter Property="BorderBrush" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
                            </MultiDataTrigger.Setters>
                        </MultiDataTrigger>
                    </Style.Triggers>
                </Style>
            </DataGrid.CellStyle>
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Name}" ClipboardContentBinding="{x:Null}" Header="Name" Width="*" MinWidth="150" SortDirection="Ascending">
                    <DataGridTextColumn.ElementStyle>
                        <Style TargetType="{x:Type TextBlock}">
                            <Setter Property="VerticalAlignment" Value="Center"/>
                            <Setter Property="Margin" Value="5,0,0,0"/>
                        </Style>
                    </DataGridTextColumn.ElementStyle>
                </DataGridTextColumn>
                <DataGridTextColumn Binding="{Binding Verantwortlicher_MA}" ClipboardContentBinding="{x:Null}" Header="Verantw. MA" MinWidth="150">
                    <DataGridTextColumn.ElementStyle>
                        <Style TargetType="{x:Type TextBlock}">
                            <Setter Property="VerticalAlignment" Value="Center"/>
                            <Setter Property="Margin" Value="5,0,0,0"/>
                        </Style>
                    </DataGridTextColumn.ElementStyle>
                </DataGridTextColumn>
                <DataGridTemplateColumn ClipboardContentBinding="{x:Null}" Header="Tel. Besucher" MinWidth="150"> <!--Binding="{Binding Tel_Nr_Besucher}"-->
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBox Text="{Binding Tel_Nr_Besucher}" Background="Transparent" BorderThickness="0" PreviewTextInput="Tel_Nr_Besucher_PreviewTextInput" LostKeyboardFocus="Tel_Nr_Besucher_LostKeyboardFocus" TextAlignment="Left" HorizontalContentAlignment="Center" VerticalAlignment="Center" Margin="5,0,0,0"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                    <!--<DataGridTextColumn.ElementStyle>
                        <Style TargetType="{x:Type TextBlock}">
                            <Setter Property="VerticalAlignment" Value="Center"/>
                            <Setter Property="Margin" Value="5,0,0,0"/>
                        </Style>
                    </DataGridTextColumn.ElementStyle>-->
                </DataGridTemplateColumn>
                <!--<DataGridTextColumn Binding="{Binding Anzahl_Begleitpersonen}" ClipboardContentBinding="{x:Null}" Header="Anz. Personen" MinWidth="50" >
                    <DataGridTextColumn.ElementStyle>
                        <Style TargetType="{x:Type TextBlock}">
                            <Setter Property="TextAlignment" Value="Center"/>
                            <Setter Property="VerticalAlignment" Value="Center"/>
                            <Setter Property="Margin" Value="5,0,0,0"/>
                        </Style>
                    </DataGridTextColumn.ElementStyle>
                </DataGridTextColumn>-->
                <DataGridTemplateColumn ClipboardContentBinding="{x:Null}" Header="Anz. Personen" MinWidth="80" >
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
                                <TextBlock Text="{Binding Anzahl_Begleitpersonen}" Width="50" TextAlignment="Center" VerticalAlignment="Center"/>
                                <Button x:Name="btnEdit" Width="25" Height="25" ToolTip="Begleitpersonen bearbeiten/hinzufügen/entfernen" HorizontalAlignment="Right" Padding="0" Click="btnEdit_Click">
                                    <Button.Content>
                                        <Image Source="/Resources/Edit.png" Height="23"/>
                                    </Button.Content>
                                    <!--<Button.ContextMenu>
                                        <ContextMenu>
                                            <MenuItem Header="Anzahl ändern" Tag="1" Click="MenuItem_Click"/>
                                            <MenuItem Header="Personen anzeigen/bearbeiten" Tag="2" Click="MenuItem_Click"/>
                                        </ContextMenu>
                                    </Button.ContextMenu>-->
                                </Button>
                            </StackPanel>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn ClipboardContentBinding="{x:Null}" Header="Besuchstag" MinWidth="75">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <DatePicker local:DatePickerHelper.ShowTodayButton="True" local:DatePickerHelper.ShowTodayButtonContent="Heute" x:Name="dpDataGridBesuchstag" Text="{Binding Besuchstag, StringFormat=\{0:dd.MM.yyyy\}}" ToolTip="Datum über Kalender ändern" CalendarClosed="dpDataGridBesuchstag_CalendarClosed" CalendarOpened="dpDataGridBesuchstag_CalendarOpened">
                                <DatePicker.Resources>
                                    <Style TargetType="DatePickerTextBox">
                                        <Setter Property="IsReadOnly" Value="True"/>
                                    </Style>
                                </DatePicker.Resources>
                            </DatePicker>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTextColumn Binding="{Binding Grund_des_Besuchs}" ClipboardContentBinding="{x:Null}" Header="Grund des Besuchs" MinWidth="200">
                    <DataGridTextColumn.ElementStyle>
                        <Style TargetType="{x:Type TextBlock}">
                            <Setter Property="VerticalAlignment" Value="Center"/>
                            <Setter Property="Margin" Value="5,0,0,0"/>
                        </Style>
                    </DataGridTextColumn.ElementStyle>
                </DataGridTextColumn>
                <DataGridTextColumn Binding="{Binding Oertlichkeit}" ClipboardContentBinding="{x:Null}" Header="Örtlichkeit" MinWidth="150">
                    <DataGridTextColumn.ElementStyle>
                        <Style TargetType="{x:Type TextBlock}">
                            <Setter Property="VerticalAlignment" Value="Center"/>
                            <Setter Property="Margin" Value="5,0,0,0"/>
                        </Style>
                    </DataGridTextColumn.ElementStyle>
                </DataGridTextColumn>
                <DataGridTemplateColumn Header="Anspr. intern" MinWidth="150">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <ComboBox x:Name="dg_cbASP" Template="{StaticResource ComboBoxControlTemplate1}" ItemsSource="{Binding asp, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:ManageVisitor}}}" SelectedItem="{Binding Ansprechpartner_Intern, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" DropDownClosed="dg_cbAsp_DropDownClosed" DropDownOpened="dg_cbASP_DropDownOpened">
                                <ComboBox.ItemTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding}"/>
                                    </DataTemplate>
                                </ComboBox.ItemTemplate>
                            </ComboBox>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <!--<DataGridTextColumn Binding="{Binding Ansprechpartner_Intern}" ClipboardContentBinding="{x:Null}" Header="Anspr. intern" MinWidth="150">
                    <DataGridTextColumn.ElementStyle>
                        <Style TargetType="{x:Type TextBlock}">
                            <Setter Property="VerticalAlignment" Value="Center"/>
                            <Setter Property="Margin" Value="5,0,0,0"/>
                        </Style>
                    </DataGridTextColumn.ElementStyle>
                </DataGridTextColumn>-->
                <DataGridTextColumn Binding="{Binding Tel_Nr_Ansprechpartner_Intern}" ClipboardContentBinding="{x:Null}" Header="Tel. Ansprechp." MinWidth="150">
                    <DataGridTextColumn.ElementStyle>
                        <Style TargetType="{x:Type TextBlock}">
                            <Setter Property="VerticalAlignment" Value="Center"/>
                            <Setter Property="Margin" Value="5,0,0,0"/>
                        </Style>
                    </DataGridTextColumn.ElementStyle>
                </DataGridTextColumn>
            </DataGrid.Columns>
        </DataGrid>

        <!--<Popup x:Name="popAnzahl" Placement="Mouse" AllowsTransparency="True">
            <StackPanel>
                <TextBlock Text="Anzahl anpassen und mit ENTER bestätigen:" Margin="5"/>
                <TextBox Width="240" HorizontalAlignment="Left" Margin="5" PreviewKeyDown="Anzahl_PreviewKeyDown"/>
            </StackPanel>
        </Popup>

        <Popup x:Name="popView" Placement="Mouse" AllowsTransparency="True">
            <StackPanel>
            </StackPanel>
        </Popup>-->

        <Button x:Name="btnClose" Content="Schließen" Margin="0,0,10,10" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="98" Height="28" Click="BtnClose_Click" TabIndex="11"/>
        <TextBox x:Name="tbGrundDesBesuchs" HorizontalAlignment="Left" Height="23" Margin="10,302,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="340" TabIndex="6" PreviewKeyDown="TextBoxes_PreviewKeyDown"/>
        <TextBlock HorizontalAlignment="Left" Margin="10,330,0,0" TextWrapping="Wrap" Text="Örtlichkeit" VerticalAlignment="Top"/>
        <TextBox x:Name="tbOertlichkeit" HorizontalAlignment="Left" Height="23" Margin="10,351,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="340" TabIndex="7" PreviewKeyDown="TextBoxes_PreviewKeyDown"/>
        <Button x:Name="btnDelete" Content="Markierten Besucher löschen" FontSize="12" Padding="-2" Height="25" Margin="0,10,10,0" VerticalAlignment="Top" HorizontalAlignment="Right" Width="167" Click="btnDelete_Click" IsEnabled="False"/>
        <TextBlock HorizontalAlignment="Left" Margin="10,379,0,0" TextWrapping="Wrap" Text="Ansprechpartner wählen oder eingeben" VerticalAlignment="Top"/>
        <ComboBox x:Name="cBAsp" HorizontalAlignment="Left" Margin="10,400,0,0" VerticalAlignment="Top" Width="340" SelectionChanged="cBAsp_SelectionChanged"/>

        <TextBlock x:Name="lblSearch" HorizontalAlignment="Left" Margin="625,15,0,0" TextWrapping="Wrap" Text="Suchen..." VerticalAlignment="Top" Height="16" Width="177" Foreground="Gray" Visibility="Visible"/>
        <TextBox x:Name="tbSearch" HorizontalAlignment="Left" Margin="618,11,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="182" Height="23" TextChanged="TextBox_TextChanged" Background="Transparent" Visibility="Visible"/>

        <mah:ProgressRing x:Name="searchProgress" HorizontalAlignment="Left" Margin="807,11,0,0" VerticalAlignment="Top" Height="23" Width="23" IsActive="True" Visibility="Collapsed"/>

    </Grid>
</mah:MetroWindow>
