<mah:MetroWindow x:Name="metroWindow" x:Class="ZKuP.MainWindow"
        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:mah="http://metro.mahapps.com/winfx/xaml/controls"
        xmlns:local="clr-namespace:ZKuP"
        xmlns:gif="https://github.com/XamlAnimatedGif/XamlAnimatedGif"
        xmlns:p="clr-namespace:ZKuP.Properties"
        mc:Ignorable="d"
        
        Title="{Binding Version, StringFormat=ZKuP - {0:0}, Mode=OneWay, RelativeSource={RelativeSource Mode=Self}}" 
  
                 WindowStartupLocation="CenterScreen"
        MinHeight="675"
        MinWidth="1680"
        Closing="Window_Closing"
        PreviewKeyDown="Window_PreviewKeyDown" Loaded="Window_Loaded" ContentRendered="Window_ContentRendered" SizeChanged="Window_SizeChanged" LocationChanged="MetroWindow_LocationChanged" StateChanged="MetroWindow_StateChanged" DpiChanged="MetroWindow_DpiChanged" 
        >
    <!--Height="{Binding Source={x:Static p:Settings.Default}, Path=Height, Mode=TwoWay, FallbackValue=747}"
        Width="{Binding Source={x:Static p:Settings.Default}, Path=Width, Mode=TwoWay, FallbackValue=1624}"
        Left="{Binding Source={x:Static p:Settings.Default}, Path=Left, Mode=TwoWay}"
        Top="{Binding Source={x:Static p:Settings.Default}, Path=Top, Mode=TwoWay}"-->

    <!--{Binding Source={x:Static p:Settings.Default}, Path=Height, Mode=TwoWay, FallbackValue=600}-->
    <!--{Binding Source={x:Static p:Settings.Default}, Path=Width, Mode=TwoWay, FallbackValue=1420}WindowStartupLocation="CenterScreen"-->
    <!--WindowState="{Binding Source={x:Static p:Settings.Default}, Path=State, Mode=TwoWay}"-->


    <mah:MetroWindow.Resources>
        <local:IntToCategory x:Key="IntToCategory"></local:IntToCategory>
        <local:ConvertToBackground x:Key="ConvertToBackground"></local:ConvertToBackground>
        <local:ConvertToBackground2 x:Key="ConvertToBackground2"></local:ConvertToBackground2>
        <local:BoolToCheckBox x:Key="BoolToCheckBox"></local:BoolToCheckBox>
        <local:MultiToBackground x:Key="MultiToBackground"></local:MultiToBackground>
        <local:DBNullToBool x:Key="DBNullToBool"></local:DBNullToBool>
        <local:HeightMinusConverter x:Key="HeightMinusConverter"/>

        <local:ReturnToolTip x:Key="ReturnToolTip"></local:ReturnToolTip>

        <local:SystemIconConverter x:Key="SystemIcon"></local:SystemIconConverter>


        <Storyboard x:Key="sbConnection" RepeatBehavior="Forever">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="imgConnection" Storyboard.TargetProperty="(UIElement.Opacity)">
                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                <EasingDoubleKeyFrame KeyTime="00:00:00.5000000" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="00:00:01" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>


        <!-- Connected Icon -->
        <DrawingImage x:Key="ConnectedIcon">
            <DrawingImage.Drawing>
                <DrawingGroup ClipGeometry="M0,0 V100 H300 V0 H0 Z">
                    <DrawingGroup.Transform>
                        <TranslateTransform X="25" Y="8" />
                    </DrawingGroup.Transform>
                    <DrawingGroup Opacity="1" Transform="1,0,0,1,50,50">
                        <GeometryDrawing Brush="#FF22C55E">
                            <GeometryDrawing.Pen>
                                <Pen Brush="#FF16A34A" Thickness="2" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
                            </GeometryDrawing.Pen>
                            <GeometryDrawing.Geometry>
                                <RectangleGeometry RadiusX="8" RadiusY="8" Rect="-25,-8,20,16" />
                            </GeometryDrawing.Geometry>
                        </GeometryDrawing>
                        <GeometryDrawing Brush="#FF22C55E">
                            <GeometryDrawing.Pen>
                                <Pen Brush="#FF16A34A" Thickness="2" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
                            </GeometryDrawing.Pen>
                            <GeometryDrawing.Geometry>
                                <RectangleGeometry RadiusX="8" RadiusY="8" Rect="5,-8,20,16" />
                            </GeometryDrawing.Geometry>
                        </GeometryDrawing>
                        <GeometryDrawing Brush="#FFFFFFFF">
                            <GeometryDrawing.Geometry>
                                <RectangleGeometry RadiusX="1" RadiusY="1" Rect="-8,-3,6,6" />
                            </GeometryDrawing.Geometry>
                        </GeometryDrawing>
                        <GeometryDrawing Brush="#FFFFFFFF">
                            <GeometryDrawing.Geometry>
                                <RectangleGeometry RadiusX="1" RadiusY="1" Rect="2,-3,6,6" />
                            </GeometryDrawing.Geometry>
                        </GeometryDrawing>
                        <GeometryDrawing Brush="#FF000000">
                            <GeometryDrawing.Pen>
                                <Pen Brush="#FF16A34A" Thickness="3" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
                            </GeometryDrawing.Pen>
                            <GeometryDrawing.Geometry>
                                <LineGeometry StartPoint="-5,0" EndPoint="5,0" />
                            </GeometryDrawing.Geometry>
                        </GeometryDrawing>
                    </DrawingGroup>
                </DrawingGroup>
            </DrawingImage.Drawing>
        </DrawingImage>
        <!--<DrawingImage x:Key="ConnectedIcon">
            <DrawingImage.Drawing>
                <DrawingGroup>
                    --><!-- Left connector part --><!--
                    <GeometryDrawing Brush="#22c55e" 
                    Geometry="M0,8 L20,8 A8,8 0 0,1 20,24 L0,24 A8,8 0 0,1 0,8 Z">
                        <GeometryDrawing.Pen>
                            <Pen Brush="#16a34a" Thickness="2"/>
                        </GeometryDrawing.Pen>
                    </GeometryDrawing>

                    --><!-- Right connector part --><!--
                    <GeometryDrawing Brush="#22c55e" 
                    Geometry="M30,8 L50,8 A8,8 0 0,1 50,24 L30,24 A8,8 0 0,1 30,8 Z">
                        <GeometryDrawing.Pen>
                            <Pen Brush="#16a34a" Thickness="2"/>
                        </GeometryDrawing.Pen>
                    </GeometryDrawing>

                    --><!-- Left pin --><!--
                    <GeometryDrawing Brush="White" 
                    Geometry="M17,13 L23,13 A1,1 0 0,1 23,19 L17,19 A1,1 0 0,1 17,13 Z"/>

                    --><!-- Right pin --><!--
                    <GeometryDrawing Brush="White" 
                    Geometry="M27,13 L33,13 A1,1 0 0,1 33,19 L27,19 A1,1 0 0,1 27,13 Z"/>

                    --><!-- Connection line --><!--
                    <GeometryDrawing>
                        <GeometryDrawing.Pen>
                            <Pen Brush="#16a34a" Thickness="3"/>
                        </GeometryDrawing.Pen>
                        <GeometryDrawing.Geometry>
                            <LineGeometry StartPoint="20,16" EndPoint="30,16"/>
                        </GeometryDrawing.Geometry>
                    </GeometryDrawing>
                </DrawingGroup>
            </DrawingImage.Drawing>
        </DrawingImage>-->

        <!-- Not Connected Icon -->
        <DrawingImage x:Key="NotConnectedIcon">
            <DrawingImage.Drawing>
                <DrawingGroup ClipGeometry="M0,0 V100 H300 V0 H0 Z">
                    <DrawingGroup.Transform>
                        <TranslateTransform X="30" Y="8" />
                    </DrawingGroup.Transform>
                    <DrawingGroup Opacity="1" Transform="1,0,0,1,150,50">
                        <GeometryDrawing Brush="#FFEF4444">
                            <GeometryDrawing.Pen>
                                <Pen Brush="#FFDC2626" Thickness="2" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
                            </GeometryDrawing.Pen>
                            <GeometryDrawing.Geometry>
                                <RectangleGeometry RadiusX="8" RadiusY="8" Rect="-30,-8,20,16" />
                            </GeometryDrawing.Geometry>
                        </GeometryDrawing>
                        <GeometryDrawing Brush="#FFEF4444">
                            <GeometryDrawing.Pen>
                                <Pen Brush="#FFDC2626" Thickness="2" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
                            </GeometryDrawing.Pen>
                            <GeometryDrawing.Geometry>
                                <RectangleGeometry RadiusX="8" RadiusY="8" Rect="15,-8,20,16" />
                            </GeometryDrawing.Geometry>
                        </GeometryDrawing>
                        <GeometryDrawing Brush="#FFFFFFFF">
                            <GeometryDrawing.Geometry>
                                <RectangleGeometry RadiusX="1" RadiusY="1" Rect="-13,-3,6,6" />
                            </GeometryDrawing.Geometry>
                        </GeometryDrawing>
                        <GeometryDrawing Brush="#FFFFFFFF">
                            <GeometryDrawing.Geometry>
                                <RectangleGeometry RadiusX="1" RadiusY="1" Rect="18,-3,6,6" />
                            </GeometryDrawing.Geometry>
                        </GeometryDrawing>
                        <GeometryDrawing Geometry="F1 M300,100z M0,0z M-5,-2L0,0 -5,2 M5,-2L10,0 5,2">
                            <GeometryDrawing.Pen>
                                <Pen Brush="#FFEF4444" Thickness="2" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
                            </GeometryDrawing.Pen>
                        </GeometryDrawing>
                    </DrawingGroup>
                </DrawingGroup>
            </DrawingImage.Drawing>
        </DrawingImage>
        <!--<DrawingImage x:Key="NotConnectedIcon">
            <DrawingImage.Drawing>
                <DrawingGroup>
                    --><!-- Left connector part --><!--
                    <GeometryDrawing Brush="#ef4444" 
                    Geometry="M0,8 L20,8 A8,8 0 0,1 20,24 L0,24 A8,8 0 0,1 0,8 Z">
                        <GeometryDrawing.Pen>
                            <Pen Brush="#dc2626" Thickness="2"/>
                        </GeometryDrawing.Pen>
                    </GeometryDrawing>

                    --><!-- Right connector part (separated) --><!--
                    <GeometryDrawing Brush="#ef4444" 
                    Geometry="M35,8 L55,8 A8,8 0 0,1 55,24 L35,24 A8,8 0 0,1 35,8 Z">
                        <GeometryDrawing.Pen>
                            <Pen Brush="#dc2626" Thickness="2"/>
                        </GeometryDrawing.Pen>
                    </GeometryDrawing>

                    --><!-- Left pin --><!--
                    <GeometryDrawing Brush="White" 
                    Geometry="M17,13 L23,13 A1,1 0 0,1 23,19 L17,19 A1,1 0 0,1 17,13 Z"/>

                    --><!-- Right pin --><!--
                    <GeometryDrawing Brush="White" 
                    Geometry="M38,13 L44,13 A1,1 0 0,1 44,19 L38,19 A1,1 0 0,1 38,13 Z"/>

                    --><!-- Spark/gap indication --><!--
                    <GeometryDrawing>
                        <GeometryDrawing.Pen>
                            <Pen Brush="#ef4444" Thickness="2"/>
                        </GeometryDrawing.Pen>
                        <GeometryDrawing.Geometry>
                            <PathGeometry>
                                <PathFigure StartPoint="25,14">
                                    <LineSegment Point="30,16"/>
                                    <LineSegment Point="25,18"/>
                                </PathFigure>
                                <PathFigure StartPoint="30,14">
                                    <LineSegment Point="35,16"/>
                                    <LineSegment Point="30,18"/>
                                </PathFigure>
                            </PathGeometry>
                        </GeometryDrawing.Geometry>
                    </GeometryDrawing>
                </DrawingGroup>
            </DrawingImage.Drawing>
        </DrawingImage>-->
        
    </mah:MetroWindow.Resources>


    <Grid>
    <Grid x:Name="gridBackground" VerticalAlignment="Stretch">
        <Grid.RowDefinitions>
            <RowDefinition Height="160"/>
            <RowDefinition x:Name="gridRowTop" Height="*" MinHeight="300"/>
            <RowDefinition Height="10" MinHeight="15" MaxHeight="15"/>
            <RowDefinition Height="1*" MinHeight="100"/>
        </Grid.RowDefinitions>

        <Canvas x:Name="canvasIvo" Visibility="Collapsed">
            <Canvas.Background>
                <ImageBrush ImageSource="/Resources/skull.png" AlignmentY="Top" Viewport="0,0,50,50" ViewportUnits="Absolute" TileMode="Tile"/>
            </Canvas.Background>
        </Canvas>

        <Grid x:Name="gridSpinner" Background="White" Grid.RowSpan="4" Panel.ZIndex="99" Margin="0" Visibility="Visible">
            <!--<Canvas HorizontalAlignment="Center" VerticalAlignment="Center" Width="90" Height="90">
                <local:ucSpinnerPiston RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Center" VerticalAlignment="Center" Canvas.Left="46" Canvas.Top="46" Height="25" Width="25" >
                    <local:ucSpinnerPiston.RenderTransform>
                        <TransformGroup>
                            <ScaleTransform ScaleY="3" ScaleX="3"/>
                            <SkewTransform/>
                            <RotateTransform/>
                            <TranslateTransform X="-13.5" Y="-13.5"/>
                        </TransformGroup>
                    </local:ucSpinnerPiston.RenderTransform>
                </local:ucSpinnerPiston>
            </Canvas>-->
            <Image x:Name="imgLoading" gif:AnimationBehavior.SourceUri="/Resources/Loading.gif" gif:AnimationBehavior.CacheFramesInMemory="True" gif:AnimationBehavior.RepeatBehavior="3x" gif:AnimationBehavior.AnimationCompleted="imgLoading_AnimationCompleted" VerticalAlignment="Center" Width="400" Height="120" Margin="0,0,0,80"/>
            <!--gif:ImageBehavior.RepeatBehavior="3x"-->
            <TextBlock Text="ZKuP wird geladen..." HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,120,0,0" FontSize="20" Foreground="#CC000000"/>
            <ProgressBar x:Name="pgLoad" Maximum="100" Value="0" Background="{x:Null}" Margin="0,368,0,184" VerticalAlignment="Center" Height="30" HorizontalAlignment="Center" Width="400"/>
        </Grid>


        <Button x:Name="btnHelp" Content="Hilfe" Margin="0,63,182,0" Height="23" FontSize="12" Padding="-5" FontWeight="Regular" VerticalAlignment="Top" Click="BtnHelp_Click" HorizontalAlignment="Right" Width="87" Visibility="Visible" Grid.RowSpan="3"/>

        <Grid x:Name="Main" Margin="10,0" MaxHeight="190" MinHeight="190" VerticalAlignment="Top" Grid.Row="0" Visibility="Hidden" MinWidth="{Binding ActualWidth, ElementName=metroWindow, Mode=OneWay}">


            <TabControl x:Name="tcMainMenu" HorizontalAlignment="Right" VerticalAlignment="Top" Width="650"  MinHeight="190" MaxHeight="190" Margin="0,7,10,0" SelectionChanged="TabControl_SelectionChanged">
                <TabItem x:Name="tabPark" Header="Parkausweise" Visibility="Collapsed" Margin="5,0" Width="130" Height="30" mah:HeaderedControlHelper.HeaderFontSize="18" mah:HeaderedControlHelper.HeaderHorizontalContentAlignment="Center" mah:HeaderedControlHelper.HeaderVerticalContentAlignment="Center">
                    <StackPanel Orientation="Horizontal" Margin="0,5">
                        <StackPanel Orientation="Vertical" Margin="2">
                            <Button x:Name="btnCreateParkausweis" Content="Parkausweis beantragen" Height="37" FontSize="12" Padding="-5" Margin="2,5" VerticalAlignment="Top" HorizontalAlignment="Left" FontWeight="Regular" Width="150" Click="btnCreateParkausweis_Click" Visibility="Collapsed"/>
                            <!--<Button x:Name="btnCreateSpecialParkausweis" Content="Sonderparkausweis" Height="30" FontSize="12" Padding="-5" Margin="2" VerticalAlignment="Top" FontWeight="Regular" Width="150" Click="btnCreateSpecialParkausweis_Click" Visibility="Collapsed"/>-->
                        </StackPanel>

                        <StackPanel Orientation="Vertical" Margin="2">
                            <Button x:Name="btnGrantParkausweis" Content="Parkausweise genehmigen" Height="37" FontSize="12" Padding="-5" Margin="2,5" VerticalAlignment="Top" FontWeight="Regular" Width="150" Click="btnGrantParkausweis_Click" Visibility="Collapsed"/>
                            <Button x:Name="btnListParkausweis" Content="Parkausweise verwalten" Height="37" FontSize="12" Padding="-5" Margin="2,5" VerticalAlignment="Top" FontWeight="Regular" Width="150" Click="btnListParkausweis_Click" Visibility="Collapsed"/>
                        </StackPanel>

                        <StackPanel Orientation="Vertical" Margin="2">
                            <Button x:Name="btnCheckParkausweis" Content="Parkausweise prüfen" Height="37" FontSize="12" Padding="-5" Margin="2,5" VerticalAlignment="Top" FontWeight="Regular" Width="150" Click="btnCheckParkausweis_Click" Visibility="Collapsed">
                                <Button.ToolTip>
                                    <TextBlock Text="Hier kann überprüft werden ob Kennzeichen einen Parkschein hat"/>
                                </Button.ToolTip>
                            </Button>
                            <Button x:Name="btnCheckKennzeichen" Content="Kennzeichen prüfen" Height="37" FontSize="12" Padding="-5" Margin="2,5" VerticalAlignment="Bottom" FontWeight="Regular" Width="150" Click="btnCheckKennzeichen_Click" Visibility="Collapsed">
                                <Button.ToolTip>
                                    <StackPanel>
                                        <TextBlock Text="Für eingefahrene Fzg. zb von Firmen das Kennzeichen prüfen"/>
                                        <TextBlock Text="Die Suche ergibt Kennzeichen für die ein Zutritt genehmigt wurde"/>
                                    </StackPanel>
                                </Button.ToolTip>
                            </Button>
                        </StackPanel>

                        <StackPanel Orientation="Vertical" Margin="2">
                            <Button x:Name="btnPrintParkausweis" Content="Parkausweise drucken" Height="37" FontSize="12" Padding="-5" Margin="2,5" VerticalAlignment="Top" FontWeight="Regular" Width="150" Click="btnPrintParkausweis_Click" Visibility="Collapsed"/>

                        </StackPanel>
                        <!--<Button x:Name="btnCreateParkausweis" Content="Parkausweis beantragen" Height="23" FontSize="12" Padding="-5" VerticalAlignment="Top" FontWeight="Regular" HorizontalAlignment="Right" Margin="0,13,280,0" Width="150" Click="btnCreateParkausweis_Click" Visibility="Collapsed"/>
                        <Button x:Name="btnCreateSpecialParkausweis" Content="Sonderparkausweis" Height="23" FontSize="12" Padding="-5" VerticalAlignment="Top" FontWeight="Regular" HorizontalAlignment="Right" Margin="0,13,440,0" Width="150" Click="btnCreateSpecialParkausweis_Click" Visibility="Collapsed"/>
                        <Button x:Name="btnGrantParkausweis" Content="Parkausweise genehmigen" Height="23" FontSize="12" Padding="-5" VerticalAlignment="Top" FontWeight="Regular" HorizontalAlignment="Right" Margin="0,38,280,0" Width="150" Click="btnGrantParkausweis_Click" Visibility="Collapsed"/>
                        <Button x:Name="btnListParkausweis" Content="Parkausweise verwalten" Height="23" FontSize="12" Padding="-5" VerticalAlignment="Top" FontWeight="Regular" HorizontalAlignment="Right" Margin="0,63,280,0" Width="150" Click="btnListParkausweis_Click" Visibility="Collapsed"/>
                        <Button x:Name="btnCheckParkausweis" Content="Parkausweise prüfen" Height="23" FontSize="12" Padding="-5" VerticalAlignment="Top" FontWeight="Regular" HorizontalAlignment="Right" Margin="0,88,280,0" Width="150" Click="btnCheckParkausweis_Click" Visibility="Collapsed">
                            <Button.ToolTip>
                                <TextBlock Text="Hier kann überprüft werden ob Kennzeichen einen Parkschein hat"/>
                            </Button.ToolTip>
                        </Button>
                        <Button x:Name="btnPrintParkausweis" Content="Parkausweise drucken" Height="23" FontSize="12" Padding="-5" VerticalAlignment="Top" FontWeight="Regular" HorizontalAlignment="Right" Margin="0,88,440,0" Width="150" Click="btnPrintParkausweis_Click" Visibility="Collapsed"/>
                        <Button x:Name="btnCheckKennzeichen" Content="Kennzeichen prüfen" Height="23" FontSize="12" Padding="-5" VerticalAlignment="Bottom" FontWeight="Regular" HorizontalAlignment="Right" Margin="0,0,280,-20" Width="150" Click="btnCheckKennzeichen_Click" Visibility="Collapsed">
                            <Button.ToolTip>
                                <StackPanel>
                                    <TextBlock Text="Für eingefahrene Fzg. zb von Firmen das Kennzeichen prüfen"/>
                                    <TextBlock Text="Die Suche ergibt Kennzeichen für die ein Zutritt genehmigt wurde"/>
                                </StackPanel>
                            </Button.ToolTip>
                        </Button>-->
                    </StackPanel>
                </TabItem>
                <TabItem x:Name="tabFirmBesAsp" Header="Firmen/Besucher/Asp" Visibility="Collapsed" Margin="5,0" Width="195" FontSize="8" Height="30" mah:HeaderedControlHelper.HeaderFontSize="18" mah:HeaderedControlHelper.HeaderHorizontalContentAlignment="Center" mah:HeaderedControlHelper.HeaderVerticalContentAlignment="Center">
                    <StackPanel Orientation="Horizontal" Margin="0,5">
                        <StackPanel Orientation="Vertical" Margin="2">
                            <Button x:Name="btnCreateFirma" Content="Firmen verwalten" Height="37" FontSize="12" Padding="-5" Margin="2,5" FontWeight="Regular" Width="150" Click="BtnCreateFirma_Click" Visibility="Collapsed"/>
                            <Button x:Name="btnBelegung" Content="BE-Flächen" Height="37" FontSize="12" Padding="-5" Margin="2,5" FontWeight="Regular" Width="150" Visibility="Collapsed" Click="btnBelegung_Click"/>
                        </StackPanel>

                        <StackPanel Orientation="Vertical" Margin="2">
                            <Button x:Name="btnManageAsp" Content="Ansprechpartner verwalten" Height="37" FontSize="12" Padding="-5" Margin="2,5" FontWeight="Regular" Width="150" Click="BtnManageAsp_Click" Visibility="Collapsed"/>
                        </StackPanel>

                        <StackPanel Orientation="Vertical" Margin="2">
                            <Button x:Name="btnCreateVisitor" Content="Besucher verwalten" Height="37" FontSize="12" Padding="-5" Margin="2,5" FontWeight="Regular" Width="150" Click="BtnCreateVisitor_Click" Visibility="Collapsed"/>
                            <Button x:Name="btnFamily" Content="   Werksführung&#xa;Mein Arbeitsplatz" HorizontalContentAlignment="Center" Height="37" FontSize="11" Padding="-5" Margin="2,5" FontWeight="Regular" Width="150" Click="btnFamily_Click" Visibility="Visible"/>
                        </StackPanel>
                    </StackPanel>
                </TabItem>
                <TabItem x:Name="tabPfoertner" Header="Pförtner" Visibility="Collapsed" Margin="5,0" Width="90" FontSize="8" Height="30" mah:HeaderedControlHelper.HeaderFontSize="18" mah:HeaderedControlHelper.HeaderHorizontalContentAlignment="Center" mah:HeaderedControlHelper.HeaderVerticalContentAlignment="Center">
                    <StackPanel Orientation="Horizontal" Margin="0,5">
                        <StackPanel Orientation="Horizontal" Margin="4,2,0,0">
                            <Button x:Name="btnKarten" Height="85" FontSize="12" Padding="-5" VerticalAlignment="Top" Margin="0,5,4,0" FontWeight="Regular" Click="btnKarten_Click" Width="150" Visibility="Collapsed">
                                <Button.Content>
                                    <StackPanel>
                                        <Border BorderThickness="0" BorderBrush="Black" Margin="0,0,0,10">
                                            <Image Source="/Resources/Karten.png" Height="40"/>
                                        </Border>
                                        <TextBlock Text="Karten" TextAlignment="Center" FontSize="14"/>
                                    </StackPanel>
                                </Button.Content>
                            </Button>
                            <Button x:Name="btnKartenTausch" Height="85" FontSize="12" Padding="-5" VerticalAlignment="Top" Margin="4,5,2,0" FontWeight="Regular" Click="btnKartenTausch_Click" Width="150" Visibility="Collapsed">
                                <Button.Content>
                                    <StackPanel>
                                        <Border BorderThickness="0" BorderBrush="Black" Margin="0,0,0,10" Width="100">
                                            <Image Source="/Resources/KartenTausch.png" Height="40"/>
                                        </Border>
                                        <TextBlock Text="Rot zu Grün tauschen" FontSize="14"/>
                                    </StackPanel>
                                </Button.Content>
                            </Button>
                        </StackPanel>
                        <StackPanel Orientation="Vertical" Margin="4,2">
                            <Button x:Name="btnCreateDeliveries" Content="Lieferanten verwalten" Height="37" FontSize="12" Padding="-5" Margin="2,5" FontWeight="Regular" Width="150" Visibility="Collapsed" Click="btnCreateDeliveries_Click"/>
                            <Button x:Name="btnCheckAusgegebeneParkausweise" Content="Ausgegebene Parkausweise" Height="37" FontSize="12" Padding="-5" Margin="2,5" FontWeight="Regular" Width="150" Visibility="Visible" Click="btnCheckAusgegebeneParkausweise_Click"/>
                        </StackPanel>

                        <StackPanel Orientation="Vertical" Margin="0,2">
                            <Button x:Name="btnEnstoerdienste" Content="Entstördienste verwalten" Height="37" FontSize="12" Margin="2,5" Padding="-5" Width="140" Visibility="Visible" Click="btnEnstoerdienste_Click"/>
                            <Button x:Name="btnCOMSelector" Content="Kartenleser auswählen" Height="37" FontSize="12" Margin="2,5" Padding="-5" Width="140" Visibility="Visible" Click="btnCOMSelector_Click"/>
                        </StackPanel>
                    </StackPanel>
                </TabItem>
                <TabItem x:Name="tabSonstiges" Header="Sonstiges" Visibility="Collapsed" Margin="5,0" Width="100" FontSize="8" Height="30" mah:HeaderedControlHelper.HeaderFontSize="18" mah:HeaderedControlHelper.HeaderHorizontalContentAlignment="Center" mah:HeaderedControlHelper.HeaderVerticalContentAlignment="Center">
                    <StackPanel Orientation="Horizontal" Margin="0,5">
                        <StackPanel Orientation="Vertical" Margin="2">
                            <Button x:Name="btnHelp2" Content="Hilfe" Height="37" FontSize="12" Padding="-5" Margin="2,5" FontWeight="Regular" Click="BtnHelp_Click" Width="150" Visibility="Visible"/>
                        </StackPanel>
                        <StackPanel Orientation="Vertical" Margin="2">
                            <Button x:Name="btnArrivalsOverview" Content="Ankunftsübersicht" Height="37" FontSize="12" Padding="-5" Margin="2,5" FontWeight="Regular" Width="150" Visibility="Collapsed" Click="btnArrivalsOverview_Click"/>
                        </StackPanel>
                        <StackPanel Orientation="Vertical" Margin="2">
                            <Button x:Name="btnMcFitSign" Content="McFit User erstellen" Height="37" FontSize="12" Padding="-5" Margin="2,5" FontWeight="Regular" Width="150" Visibility="Collapsed" Click="btnMcFitSignUp_Click"/>
                        </StackPanel>
                    </StackPanel>
                </TabItem>
                <TabItem x:Name="tabAdmin" Header="Admin" Visibility="Collapsed" Margin="5,0" Width="80" FontSize="8" Height="30" mah:HeaderedControlHelper.HeaderFontSize="18" mah:HeaderedControlHelper.HeaderHorizontalContentAlignment="Center" mah:HeaderedControlHelper.HeaderVerticalContentAlignment="Center">
                    <StackPanel Orientation="Horizontal" Margin="0,5">
                        <StackPanel Orientation="Vertical" Margin="2">
                            <Button x:Name="btnManageUsers" Content="Manage Users" Height="37" FontSize="12" Padding="-5" Margin="2,5" FontWeight="Regular" Click="BtnManageUsers_Click" Width="150" Visibility="Collapsed"/>
                            <Button x:Name="btnApproveFzg" Content="Fahrzeuggenehmigung" Height="37" FontSize="12" Padding="-5" Margin="2,5" FontWeight="Regular" Click="btnApproveFzg_Click" Width="150" Visibility="Collapsed"/>
                        </StackPanel>
                        <StackPanel Orientation="Vertical" Margin="2">
                            <Button x:Name="btnSignatures" Content="Unterschriften" Height="37" FontSize="12" Padding="-5" Margin="2,5" FontWeight="Regular" Width="150" Click="btnSignatures_Click" Visibility="Collapsed"/>
                        </StackPanel>
                        <StackPanel Orientation="Vertical" Margin="2">
                            <Button x:Name="btnNotifications" Content="Benachrichtigungen" Height="37" FontSize="12" Padding="-5" Margin="2,5" FontWeight="Regular" Width="150" Click="btnNotifications_Click" Visibility="Collapsed"/>
                        </StackPanel>
                    </StackPanel>
                </TabItem>
            </TabControl>

            <TextBlock x:Name="lblmcfit" Text="Aktuell verfügbare McFit Karten: " FontSize="12" HorizontalAlignment="Right" Margin="0,140,420,0" Visibility="Visible"/>

            <Button x:Name="btnIvoBackground" VerticalAlignment="Top" HorizontalAlignment="Right" Height="95" Width="10" Margin="0,13,20,0" Click="btnIvoBackground_Click" Visibility="Collapsed"/>

            <!--<Button x:Name="btnNew" Content="Firma/Besucher kommt an" Height="23" FontSize="12" Padding="-5" HorizontalAlignment="Left" FontWeight="Regular" Margin="0,13,0,0" VerticalAlignment="Top" Width="200" Click="BtnNew_Click" Visibility="Collapsed"/>-->
            <Button x:Name="btnDelivery" Content="Lieferant kommt an" Tag="Lieferant" Height="30" FontSize="12" Padding="-5" HorizontalAlignment="Left" FontWeight="Regular" Margin="0,30,0,0" VerticalAlignment="Top" Width="200" Click="btnDelivery_Click" Visibility="Collapsed"/>
            <Button x:Name="btnEmergency" Content="DB Intern Entstördienst kommt an" Tag="DB" Height="30" FontSize="12" Padding="-5" HorizontalAlignment="Left" FontWeight="Regular" Margin="0,70,0,0" VerticalAlignment="Top" Width="200" Click="btnDelivery_Click" Visibility="Collapsed"/>

            <!--<Border x:Name="canvasHinweis" Visibility="Collapsed" CornerRadius="8" BorderBrush="Red" BorderThickness="1" Width="300" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="580,13,0,0" Height="90">
                <Grid Width="300" HorizontalAlignment="Left">

                    <Image Visibility="Visible"  
                        Margin="10,22,0,0"
                        Stretch="Uniform"
                        MaxHeight="30"
                        VerticalAlignment="Top"
                        HorizontalAlignment="Left"
                        Source="{Binding Converter={StaticResource SystemIcon}, ConverterParameter=Warning}"/>

                    <TextBlock x:Name="lblHinweis" TextWrapping="Wrap" TextAlignment="Center" Padding="55,5,10,5" HorizontalAlignment="Right" VerticalAlignment="Center" Width="300" Height="NaN" />
                    -->
            <!--Background="#32FF5D00"-->
            <!--

                </Grid>
            </Border>
            <Button x:Name="btnSetHinweis" Visibility="Collapsed" FontSize="12" Padding="-5" Height="23" Content="Hinweis setzen" FontWeight="Regular" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="620,0,0,-10" Width="220" Click="btnSetHinweis_Click"/>-->


            <Grid x:Name="BE" Margin="215, 30, 0, 0" Width="350" VerticalAlignment="Top" HorizontalAlignment="Left" ToolTip="Rote Parkplätze sind belegt, Gelbe belegt durch BE-Fläche, Grüne frei">

                <TextBlock Text="Parkplätze im Werk:" Margin="0, -20, 0, 0" Height="20" Width="150" HorizontalAlignment="Left" VerticalAlignment="Top"/>
                <Button x:Name="btnBE" Content="BE-Flächenansicht" FontSize="12" Padding="-5" Margin="0, 110, 120, 0" Height="20" FontWeight="Regular" HorizontalAlignment="Center" VerticalAlignment="Top" Width="150" Visibility="Collapsed" Click="btnBEImages_Click"/>
                <Rectangle x:Name="P1" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0, 0, 0, 0" StrokeThickness="0" Fill="Green" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown"/>
                <TextBlock Text="1" Margin="0, 0, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="10" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>

                <Rectangle x:Name="P2" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0, 20, 0, 0" StrokeThickness="0" Fill="Green"/>
                <TextBlock Text="2" Margin="0, 20, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="10" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>
                <Rectangle x:Name="P3" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0, 40, 0, 0" StrokeThickness="0" Fill="Green"/>
                <TextBlock Text="3" Margin="0, 40, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="10" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>
                <Rectangle x:Name="P4" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0, 60, 0, 0" StrokeThickness="0" Fill="Green"/>
                <TextBlock Text="4" Margin="0, 60, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="10" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>

                <Rectangle x:Name="P5" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="25, 0, 0, 0" StrokeThickness="0" Fill="Green" Stroke="Aqua"/>
                <TextBlock Text="5" Margin="25, 0, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>
                <Rectangle x:Name="P6" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="25, 20, 0, 0" StrokeThickness="0" Fill="Green"/>
                <TextBlock Text="6" Margin="25, 20, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="2" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>
                <Rectangle x:Name="P7" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="25, 40, 0, 0" StrokeThickness="0" Fill="Green"/>
                <TextBlock Text="7" Margin="25, 40, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="1" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>
                <Rectangle x:Name="P8" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="25, 60, 0, 0" StrokeThickness="0" Fill="Green"/>
                <TextBlock Text="8" Margin="25, 60, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="1" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>

                <Rectangle x:Name="P9" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="50, 0, 0, 0" StrokeThickness="0" Fill="Green"/>
                <TextBlock Text="9" Margin="50, 0, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="2" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>
                <Rectangle x:Name="P10" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="50, 20, 0, 0" StrokeThickness="0" Fill="Green"/>
                <TextBlock Text="10" Margin="50, 20, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="2" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>
                <Rectangle x:Name="P11" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="50, 40, 0, 0" StrokeThickness="0" Fill="Green"/>
                <TextBlock Text="11" Margin="50, 40, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="2" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>
                <Rectangle x:Name="P12" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="50, 60, 0, 0" StrokeThickness="0" Fill="Green"/>
                <TextBlock Text="12" Margin="50, 60, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="2" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>

                <Rectangle x:Name="P13" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="75, 0, 0, 0" StrokeThickness="0" Fill="Green"/>
                <TextBlock Text="13" Margin="75, 0, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="2" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>
                <Rectangle x:Name="P14" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="75, 20, 0, 0" StrokeThickness="0" Fill="Green"/>
                <TextBlock Text="14" Margin="75, 20, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="2" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>
                <Rectangle x:Name="P15" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="75, 40, 0, 0" StrokeThickness="0" Fill="Green"/>
                <TextBlock Text="15" Margin="75, 40, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="2" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>
                <Rectangle x:Name="P16" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="75, 60, 0, 0" StrokeThickness="0" Fill="Green"/>
                <TextBlock Text="16" Margin="75, 60, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="2" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>

                <Rectangle x:Name="P17" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="100, 0, 0, 0" StrokeThickness="0" Fill="Green"/>
                <TextBlock Text="17" Margin="100, 0, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="2" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>
                <Rectangle x:Name="P18" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="100, 20, 0, 0" StrokeThickness="0" Fill="Green"/>
                <TextBlock Text="18" Margin="100, 20, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="2" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>
                <Rectangle x:Name="P19" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="100, 40, 0, 0" StrokeThickness="0" Fill="Green"/>
                <TextBlock Text="19" Margin="100, 40, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="2" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>
                <Rectangle x:Name="P20" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="100, 60, 0, 0" StrokeThickness="0" Fill="Green"/>
                <TextBlock Text="20" Margin="100, 60, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="4" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>

                <Rectangle x:Name="P21" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="125, 0, 0, 0" StrokeThickness="0" Fill="Green"/>
                <TextBlock Text="21" Margin="125, 0, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="4" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>
                <Rectangle x:Name="P22" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="125, 20, 0, 0" StrokeThickness="0" Fill="Green"/>
                <TextBlock Text="22" Margin="125, 20, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="4" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>
                <Rectangle x:Name="P23" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="125, 40, 0, 0" StrokeThickness="0" Fill="Green"/>
                <TextBlock Text="23" Margin="125, 40, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="2" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>
                <Rectangle x:Name="P24" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="125, 60, 0, 0" StrokeThickness="0" Fill="Green" Stroke="Aqua"/>
                <TextBlock Text="24" Margin="125, 60, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>

                <Rectangle x:Name="P25" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="150, 0, 0, 0" StrokeThickness="0" Fill="Green"/>
                <TextBlock Text="25" Margin="150, 0, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>
                <Rectangle x:Name="P26" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="150, 20, 0, 0" StrokeThickness="0" Fill="Green"/>
                <TextBlock Text="26" Margin="150, 20, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>
                <Rectangle x:Name="P27" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="150, 40, 0, 0" StrokeThickness="0" Fill="Green" Stroke="Aqua"/>
                <TextBlock Text="27" Margin="150, 40, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>
                <Rectangle x:Name="P28" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="150, 60, 0, 0" StrokeThickness="0" Fill="Green" Stroke="Aqua"/>
                <TextBlock Text="28" Margin="150, 60, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>
                <Rectangle x:Name="P29" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="175, 0, 0, 0" StrokeThickness="0" Fill="Green" Stroke="Aqua"/>
                <TextBlock Text="29" Margin="175, 0, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>
                <Rectangle x:Name="P30" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="175, 20, 0, 0" StrokeThickness="0" Fill="Green" Stroke="Aqua"/>
                <TextBlock Text="30" Margin="175, 20, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>
                <Rectangle x:Name="P31" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="175, 40, 0, 0" StrokeThickness="0" Fill="Green" Stroke="Aqua"/>
                <TextBlock Text="31" Margin="175, 40, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>
                <Rectangle x:Name="P32" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="175, 60, 0, 0" StrokeThickness="0" Fill="Green" Stroke="Aqua"/>
                <TextBlock Text="32" Margin="175, 60, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>

                <Rectangle x:Name="P33" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="200, 0, 0, 0" StrokeThickness="0" Fill="Green" Stroke="Aqua"/>
                <TextBlock Text="33" Margin="200, 0, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>
                <Rectangle x:Name="P34" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="200, 20, 0, 0" StrokeThickness="0" Fill="Green" Stroke="Aqua"/>
                <TextBlock Text="34" Margin="200, 20, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" PreviewMouseLeftButtonDown="ParkSetPreviewMouseLeftButtonDown" ToolTip="Klicken um Parkplatz zu belegen/freizugeben"/>



                <TextBlock Text="Frei:" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10, 78, 0, 0"/>
                <TextBlock x:Name="lblGreenCounter" Text="23" TextAlignment="Center" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="40, 78, 0, 0"/>
                <TextBlock Text="Belegt:" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="102, 78, 0, 0"/>
                <TextBlock x:Name="lblRedCounter" Text="23" TextAlignment="Center" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="148, 78, 0, 0"/>
            </Grid>

            <!--<ItemsControl ItemsSource="{Binding Source='Besucherparkplätze'}" Margin="410,13,0,0">
                <ItemsControl.ItemContainerStyle>
                    <Style TargetType="ContentPresenter">
                        <Setter Property="Margin" Value="0,-5,0,0"/>
                    </Style>
                </ItemsControl.ItemContainerStyle>
            </ItemsControl>-->
            <Grid x:Name="BesuchP" Margin="465, 26, 0, 10" Width="30" HorizontalAlignment="Left" VerticalAlignment="Top">
                <TextBlock Text="Besucherparkplätze" Margin="-20,1,0,-5" Height="30" HorizontalAlignment="Left" VerticalAlignment="Top">
                    <TextBlock.LayoutTransform>
                        <RotateTransform Angle="270"/>
                    </TextBlock.LayoutTransform>
                </TextBlock>

                <Grid x:Name="BesuchPButtons" Margin="2,4,0,0">
                    <Rectangle x:Name="G1" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0, 0, 0, 0" StrokeThickness="1" Fill="Green" PreviewMouseLeftButtonDown="G_ParkPreviewMouseLeftButtonDown"/>
                    <TextBlock Text="1" Margin="0, 0, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="10" PreviewMouseLeftButtonDown="G_ParkPreviewMouseLeftButtonDown"/>
                    <Rectangle x:Name="G2" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0, 20, 0, 0" StrokeThickness="1" Fill="Green"/>
                    <TextBlock Text="2" Margin="0, 20, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="10" PreviewMouseLeftButtonDown="G_ParkPreviewMouseLeftButtonDown"/>
                    <Rectangle x:Name="G3" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0, 40, 0, 0" StrokeThickness="1" Fill="Green"/>
                    <TextBlock Text="3" Margin="0, 40, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="10" PreviewMouseLeftButtonDown="G_ParkPreviewMouseLeftButtonDown"/>
                    <Rectangle x:Name="G4" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0, 60, 0, 0" StrokeThickness="1" Fill="Green"/>
                    <TextBlock Text="4" Margin="0, 60, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="10" PreviewMouseLeftButtonDown="G_ParkPreviewMouseLeftButtonDown"/>
                    <Rectangle x:Name="G5" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0, 80, 0, 0" StrokeThickness="1" Fill="Green"/>
                    <TextBlock Text="5" Margin="0, 80, 0, 0" Width="20" Height="15" HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" Padding="0" FontWeight="SemiBold" Tag="10" PreviewMouseLeftButtonDown="G_ParkPreviewMouseLeftButtonDown"/>
                </Grid>
            </Grid>


            <Grid x:Name="gridBike" Visibility="Collapsed" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="510,13,0,0" Height="190" Width="110">
                <Grid.RowDefinitions>
                    <RowDefinition Height="20"/>
                    <RowDefinition Height="55"/>
                    <RowDefinition Height="20"/>
                    <RowDefinition Height="40"/>
                </Grid.RowDefinitions>
                <TextBlock Text="Krafträder im Werk:" Grid.ColumnSpan="3" Grid.Row="0"/>
                <Image x:Name="imgBike" Source="/Resources/Bike.png" Grid.Row="1" Width="70" Height="50" Stretch="Uniform"/>
                <TextBlock x:Name="lblBike" Text="0 / 16" FontSize="16" ToolTip="Motorräder im Werk" Grid.Row="2" Width="100" Height="20" Margin="0,0,0,0" TextAlignment="Center"/>
                <Button x:Name="btnBikeIn" ToolTip="Motorrad fährt ein" Background="PaleVioletRed" ToolTipService.ShowOnDisabled="True" ToolTipService.InitialShowDelay="0" Grid.Row="3" Width="40" Height="30" Margin="10,10,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Padding="7,0,7,4" Panel.ZIndex="100" Click="BikeEinfahrt_Click">
                    <Image x:Name="imgBikeIn" Source="/Resources/In.png" Height="20" ToolTip="Motorrad fährt ein" ToolTipService.ShowOnDisabled="True" ToolTipService.InitialShowDelay="0"/>
                </Button>
                <Button x:Name="btnBikeOut" ToolTip="Motorrad fährt aus" Background="LightGreen" ToolTipService.ShowOnDisabled="True" ToolTipService.InitialShowDelay="0" Grid.Row="3" Width="40" Height="30" Margin="0,10,10,0" HorizontalAlignment="Right" VerticalAlignment="Top" Padding="7,0,7,4" Panel.ZIndex="100" Click="BikeAusfahrt_Click">
                    <Image x:Name="imgBikeOut" Source="/Resources/Out.png" Height="20" ToolTip="Motorrad fährt aus" ToolTipService.ShowOnDisabled="True" ToolTipService.InitialShowDelay="0"/>
                </Button>
            </Grid>


            <Grid x:Name="gridLieferanten" Visibility="Collapsed" Margin="650, 13, 0, 0" Width="350" Height="190" VerticalAlignment="Top" HorizontalAlignment="Left">
                <Grid.RowDefinitions>
                    <RowDefinition Height="20"/>
                    <RowDefinition Height="55"/>
                    <RowDefinition Height="20"/>
                    <RowDefinition Height="30"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>

                <TextBlock Text="Lieferanten im Werk:" Grid.ColumnSpan="3" Grid.Row="0"/>

                <Image x:Name="imgLKWLang" Source="/Resources/LKWLang.png" ToolTip="Lieferanten mit LKW &gt; 7,5t im Werk" ToolTipService.InitialShowDelay="1" Grid.Column="0" Grid.Row="1" Stretch="Fill" Width="90" Height="45"/>
                <TextBlock x:Name="lblLKWLang" Text="Text" FontSize="16" ToolTip="Lieferanten mit LKW &gt; 7,5t im Werk" ToolTipService.InitialShowDelay="1" Grid.Column="0" Grid.Row="2" Width="70" Height="50" Margin="0,0,0,0" TextAlignment="Center"/>
                <Button x:Name="btnLKWLang" Content="Ausfahrt" ToolTip="Lieferant mit LKW &gt; 7,5t fährt raus" ToolTipService.InitialShowDelay="1" Grid.Column="0" Grid.Row="3" Width="80" Height="30" Margin="0,0,0,-10" VerticalAlignment="Bottom" Padding="0,0,0,0" Panel.ZIndex="100" Click="Ausfahrt_Click"/>

                <Image x:Name="imgLKW" Source="/Resources/LKW.png" ToolTip="Lieferanten mit LKW &lt; 7,5t im Werk" ToolTipService.InitialShowDelay="1" Grid.Column="1" Grid.Row="1" Stretch="Fill" Width="70" Height="45"/>
                <TextBlock x:Name="lblLKW" Text="Text" FontSize="16" ToolTip="Lieferanten mit LKW &lt; 7,5t im Werk" ToolTipService.InitialShowDelay="1" Grid.Column="1" Grid.Row="2" Width="70" Height="20" Margin="0,0,0,0" TextAlignment="Center"/>
                <Button x:Name="btnLKW" Content="Ausfahrt" ToolTip="Lieferant mit LKW &lt; 7,5t fährt raus" ToolTipService.InitialShowDelay="1" Grid.Column="1" Grid.Row="3" Width="80" Height="30" Margin="0,0,0,-10" VerticalAlignment="Bottom" Padding="0,0,0,0" Panel.ZIndex="100" Click="Ausfahrt_Click"/>

                <Image x:Name="imgSprinter" Source="/Resources/Sprinter.png" ToolTip="Lieferanten mit Sprinter im Werk" ToolTipService.InitialShowDelay="1" Grid.Column="2" Grid.Row="1" Stretch="Fill" Width="70" Height="45"/>
                <TextBlock x:Name="lblSprinter" Text="Text" FontSize="16" ToolTip="Lieferanten mit Sprinter im Werk" ToolTipService.InitialShowDelay="1" Grid.Column="2" Grid.Row="2" Width="70" Height="20" Margin="0,0,0,0" TextAlignment="Center"/>
                <Button x:Name="btnSprinter" Content="Ausfahrt" ToolTip="Lieferant mit Sprinter fährt raus" ToolTipService.InitialShowDelay="1" Grid.Column="2" Grid.Row="3" Width="80" Height="30" Margin="0,0,0,-10" VerticalAlignment="Bottom" Padding="0,0,0,0" Panel.ZIndex="100" Click="Ausfahrt_Click"/>

                <Image x:Name="imgPKW" Source="/Resources/PKW.png" ToolTip="Lieferanten mit PKW im Werk" ToolTipService.InitialShowDelay="1" Grid.Column="3" Grid.Row="1" Stretch="Fill" Width="70" Height="45"/>
                <TextBlock x:Name="lblPKW" Text="Text" FontSize="16" ToolTip="Lieferanten mit PKW im Werk" ToolTipService.InitialShowDelay="1" Grid.Column="3" Grid.Row="2" Width="70" Height="20" Margin="0,0,0,0" TextAlignment="Center"/>
                <Button x:Name="btnPKW" Content="Ausfahrt" ToolTip="Lieferant mit PKW fährt raus" ToolTipService.InitialShowDelay="1" Grid.Row="3" Grid.Column="3" Width="80" Height="30" Margin="0,0,0,-10" VerticalAlignment="Bottom" Padding="0,0,0,0" Panel.ZIndex="100" Click="Ausfahrt_Click"/>

            </Grid>
        </Grid>


        <Grid x:Name="gridToday" Grid.Row="1" Visibility="Collapsed" VerticalAlignment="Stretch" MinHeight="100" Margin="0,-10,0,0" MaxWidth="{Binding ActualWidth, ElementName=metroWindow, Mode=OneWay}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition x:Name="columnLeft" Width="1.456*" MinWidth="1000"/>
                <ColumnDefinition Width="15"/>
                <ColumnDefinition x:Name="columnRight" Width="1*" MinWidth="450"/>
            </Grid.ColumnDefinitions>

            <TextBox x:Name="tbSearch" mah:TextBoxHelper.Watermark="Ankunft heute durchsuchen..." HorizontalAlignment="Left" Height="23" Margin="10,-15,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="180" Visibility="Collapsed" Padding="0,2,0,0" TextChanged="TextBox_TextChanged" PreviewGotKeyboardFocus="TbSearch_PreviewGotKeyboardFocus" PreviewLostKeyboardFocus="TbSearch_PreviewLostKeyboardFocus"/>
            <!--<TextBlock x:Name="lblSearch" Text="Ankunft heute durchsuchen..." Foreground="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" IsHitTestVisible="False" Margin="12,-15,0,0" Padding="3" Visibility="Collapsed" HorizontalAlignment="Left" Width="180"/>-->
            <Button x:Name="btnClearSearch" HorizontalAlignment="Left" Content="X" Padding="0" VerticalAlignment="Top" Margin="190,-15,0,0" Height="26" Width="14" Foreground="Red" Visibility="Collapsed" FontWeight="Bold" ToolTip="Suchfeld leeren" Click="btnClearSearch_Click"/>

            <TextBlock x:Name="lblAnkunftHeuteFirmen" Grid.Row="0" HorizontalAlignment="Left" TextWrapping="Wrap" Text="Ankunft heute Firmen:" VerticalAlignment="Top" Margin="10,15,0,0"/>
            <TextBlock x:Name="lblAnkunftHeuteBesucher" Grid.Column="2" HorizontalAlignment="Left" TextWrapping="Wrap" Text="Ankunft heute Besucher und Werksführungen:" VerticalAlignment="Top" Margin="10,15,0,0"/>

            <!--<Button x:Name="btnResetListsMain" Content="Listengröße zurücksetzen" Margin="0,8,0,0" HorizontalAlignment="Center" VerticalAlignment="Top" Width="150" Height="22" Click="btnResetLists_Click" Visibility="Visible"/>-->

            <DataGrid Grid.Column="0" x:Name="dgToday" RowHeaderWidth="0" HorizontalGridLinesBrush="Gray" GridLinesVisibility="Horizontal" KeyboardNavigation.TabNavigation="None"  ItemsSource="{Binding ., UpdateSourceTrigger=PropertyChanged}" CanUserAddRows="False" CanUserDeleteRows="False" AutoGenerateColumns="False" Margin="10,35,10,10" IsReadOnly="True">
                <DataGrid.Resources>
                    <Style TargetType="{x:Type DataGridRow}">
                        <EventSetter Event="Control.MouseDoubleClick" Handler="DataGridRow_MouseDoubleClick"/>
                    </Style>
                </DataGrid.Resources>
                <DataGrid.RowStyle>
                    <Style TargetType="{x:Type DataGridRow}">
                        <EventSetter Event="Control.MouseDoubleClick" Handler="DataGridRow_MouseDoubleClick"/>
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Name, Converter={StaticResource ConvertToBackground2}}" Value="1">
                                <Setter Property="Background" Value="#3000FF00"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding Name, Converter={StaticResource ConvertToBackground2}}" Value="0">
                                <Setter Property="Background" Value="#30FF0000"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding Name, Converter={StaticResource ConvertToBackground2}}" Value="2">
                                <Setter Property="Background" Value="#80095feb"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </DataGrid.RowStyle>
                <DataGrid.Columns>

                    <DataGridTextColumn Header="Firma" Binding="{Binding Name}" Width="*" SortDirection="Ascending" IsReadOnly="True">
                        <DataGridTextColumn.ElementStyle>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Margin" Value="4"/>
                                <Setter Property="ToolTip" Value="{Binding NoToolTip, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:MainWindow}}, Converter={StaticResource ReturnToolTip}}"/>
                            </Style>
                        </DataGridTextColumn.ElementStyle>
                    </DataGridTextColumn>
                    <DataGridTextColumn Header="Ansprechpartner der Firma" Binding="{Binding Verantwortlicher_MA_Firma}" Width="*" IsReadOnly="True">
                        <DataGridTextColumn.ElementStyle>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Margin" Value="4"/>
                                <Setter Property="ToolTip" Value="{Binding NoToolTip, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:MainWindow}}, Converter={StaticResource ReturnToolTip}}"/>
                            </Style>
                        </DataGridTextColumn.ElementStyle>
                    </DataGridTextColumn>
                    <DataGridTextColumn Header="Tel. Ansprechpartner Firma" Binding="{Binding Tel_Nr_Verantwortlicher_Firma}" Width="*" IsReadOnly="True">
                        <DataGridTextColumn.ElementStyle>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Margin" Value="4"/>
                                <Setter Property="ToolTip" Value="{Binding NoToolTip, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:MainWindow}}, Converter={StaticResource ReturnToolTip}}"/>
                            </Style>
                        </DataGridTextColumn.ElementStyle>
                    </DataGridTextColumn>
                    <DataGridTextColumn Header="Fremdfirmenkoordinator DB" Binding="{Binding Ansprechpartner_Intern}" Width="*" IsReadOnly="True">
                        <DataGridTextColumn.ElementStyle>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Margin" Value="4"/>
                                <Setter Property="ToolTip" Value="{Binding NoToolTip, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:MainWindow}}, Converter={StaticResource ReturnToolTip}}"/>
                            </Style>
                        </DataGridTextColumn.ElementStyle>
                    </DataGridTextColumn>
                    <DataGridTemplateColumn Header="Asp-Info" IsReadOnly="True">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <Button x:Name="btnInfo" Content="Info"/>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTextColumn Header="BE-Fläche" Binding="{Binding BE}" Width="*" IsReadOnly="True">
                        <DataGridTextColumn.ElementStyle>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Margin" Value="4"/>
                                <Setter Property="ToolTip" Value="{Binding NoToolTip, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:MainWindow}}, Converter={StaticResource ReturnToolTip}}"/>
                            </Style>
                        </DataGridTextColumn.ElementStyle>
                    </DataGridTextColumn>
                    <DataGridTemplateColumn MinWidth="0.1" MaxWidth="0.5" CanUserResize="False" CanUserSort="False" CanUserReorder="False"/>
                    <DataGridTemplateColumn x:Name="columnFzg" Header="Fzg" IsReadOnly="True" Visibility="Collapsed" Width="30">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Anzahl_Fzg}" FontSize="14" FontWeight="SemiBold" TextAlignment="Center" Padding="2"/>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTextColumn x:Name="columnBeginn" Binding="{Binding Arbeitsbeginn, StringFormat=\{0:dd.MM.yy\}}" Header="A.Beginn" IsReadOnly="True" Visibility="Collapsed" Width="90" CanUserSort="True">
                        <DataGridTextColumn.ElementStyle>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="TextAlignment" Value="Center"/>
                            </Style>
                        </DataGridTextColumn.ElementStyle>
                        <!--<DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Arbeitsbeginn, StringFormat=\{0:dd.MM.yy\}}" FontSize="14" TextAlignment="Center" Padding="2"/>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>-->
                    </DataGridTextColumn>
                    <DataGridTextColumn x:Name="columnEnde" Binding="{Binding Arbeitsende, StringFormat=\{0:dd.MM.yy\}}" Header="A.Ende" IsReadOnly="True" Visibility="Collapsed" Width="90" CanUserSort="True">
                        <DataGridTextColumn.ElementStyle>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="TextAlignment" Value="Center"/>
                            </Style>
                        </DataGridTextColumn.ElementStyle>
                        <!--<DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Arbeitsende, StringFormat=\{0:dd.MM.yy\}}" FontSize="14" TextAlignment="Center" Padding="2"/>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>-->
                    </DataGridTextColumn>
                </DataGrid.Columns>
            </DataGrid>



            <StackPanel x:Name="gridSplitterArrowsVertical" Margin="0,0,0,0" Width="15" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center">
                <TextBlock Text="↔" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="-7,0,0,0" FontSize="20" Foreground="Gray" FontWeight="Bold" Visibility="Visible"/>
                <TextBlock Text="↔" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="-7,-15,0,0" FontSize="20" Foreground="Gray" FontWeight="Bold" Visibility="Visible"/>
            </StackPanel>
            <!--<Line x:Name="lineVertical" Grid.Column="1" Stroke="LightGray" StrokeThickness="5" Y1="0" Y2="4000" Margin="0,50,0,0"/>-->
            <GridSplitter x:Name="gridSplitterVertical" ResizeBehavior="PreviousAndNext" ResizeDirection="Columns" Cursor="SizeWE" Margin="0,50,12,0" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="3" Background="LightGray" Grid.IsSharedSizeScope="True" Visibility="Visible" />




            <DataGrid Grid.Column="2" x:Name="dgTodayBesucher" RowHeaderWidth="0" HorizontalGridLinesBrush="Gray" GridLinesVisibility="Horizontal" KeyboardNavigation.TabNavigation="None"  ItemsSource="{Binding ., UpdateSourceTrigger=PropertyChanged}" CanUserAddRows="False" CanUserDeleteRows="False" AutoGenerateColumns="False" Margin="0,35,10,10" IsReadOnly="True">
                <DataGrid.Resources>
                    <Style TargetType="{x:Type DataGridRow}">
                        <EventSetter Event="Control.MouseDoubleClick" Handler="DataGridRow_MouseDoubleClick"/>
                    </Style>
                </DataGrid.Resources>
                <DataGrid.RowStyle>
                    <Style TargetType="{x:Type DataGridRow}">
                        <EventSetter Event="Control.MouseDoubleClick" Handler="DataGridRow_MouseDoubleClick"/>
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Name, Converter={StaticResource ConvertToBackground2}}" Value="1">
                                <Setter Property="Background" Value="#3000FF00"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding Name, Converter={StaticResource ConvertToBackground2}}" Value="0">
                                <Setter Property="Background" Value="#30FF0000"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding Name, Converter={StaticResource ConvertToBackground2}}" Value="2">
                                <Setter Property="Background" Value="#80095feb"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </DataGrid.RowStyle>
                <DataGrid.Columns>

                    <DataGridTextColumn Header="Besuchergruppe" Binding="{Binding Name}" Width="*" SortDirection="Ascending" IsReadOnly="True">
                        <DataGridTextColumn.ElementStyle>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Margin" Value="4"/>
                                <Setter Property="ToolTip" Value="{Binding NoToolTip, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:MainWindow}}, Converter={StaticResource ReturnToolTip}}"/>
                            </Style>
                        </DataGridTextColumn.ElementStyle>
                    </DataGridTextColumn>
                    <DataGridTextColumn Header="Asp. der Besuchergruppe" Binding="{Binding Verantwortlicher_MA_Firma}" Width="*" IsReadOnly="True">
                        <DataGridTextColumn.ElementStyle>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Margin" Value="4"/>
                                <Setter Property="ToolTip" Value="{Binding NoToolTip, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:MainWindow}}, Converter={StaticResource ReturnToolTip}}"/>
                            </Style>
                        </DataGridTextColumn.ElementStyle>
                    </DataGridTextColumn>
                    <DataGridTextColumn Header="Tel. Besucher" Binding="{Binding Tel_Nr_Verantwortlicher_Firma}" Width="0.7*" IsReadOnly="True">
                        <DataGridTextColumn.ElementStyle>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Margin" Value="4"/>
                                <Setter Property="ToolTip" Value="{Binding NoToolTip, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:MainWindow}}, Converter={StaticResource ReturnToolTip}}"/>
                            </Style>
                        </DataGridTextColumn.ElementStyle>
                    </DataGridTextColumn>
                    <DataGridTextColumn Header="Asp. DB Intern" Binding="{Binding Ansprechpartner_Intern}" Width="*" IsReadOnly="True">
                        <DataGridTextColumn.ElementStyle>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Margin" Value="4"/>
                                <Setter Property="ToolTip" Value="{Binding NoToolTip, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:MainWindow}}, Converter={StaticResource ReturnToolTip}}"/>
                            </Style>
                        </DataGridTextColumn.ElementStyle>
                    </DataGridTextColumn>
                    <DataGridTemplateColumn Header="Asp-Info" IsReadOnly="True">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <Button x:Name="btnInfo" Click="BtnInfo_Click" Content="Info"/>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTemplateColumn MinWidth="0.1" MaxWidth="0.5" CanUserResize="False" CanUserSort="False" CanUserReorder="False"/>
                </DataGrid.Columns>
            </DataGrid>
        </Grid>






        <TextBox x:Name="tbSearchArrived" Grid.Row="2" Width="180" HorizontalAlignment="Left" VerticalAlignment="Top" Height="23" Margin="10,-3,0,-20" Visibility="Collapsed" TextChanged="tbSearchArrived_TextChanged" PreviewGotKeyboardFocus="tbSearchArrived_PreviewGotKeyboardFocus" PreviewLostKeyboardFocus="tbSearchArrived_PreviewLostKeyboardFocus"/>
        <TextBlock x:Name="lblSearchArrived" Text="Bereits bestätigt durchsuchen..." Grid.Row="2" Foreground="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" IsHitTestVisible="False" Margin="11,-1,0,-20" Padding="3" Visibility="Collapsed" HorizontalAlignment="Left" Width="180"/>
        <Button x:Name="btnClearSearchArrived" HorizontalAlignment="Left" Grid.Row="2" Content="X" Padding="0" VerticalAlignment="Top" Margin="190,-3,0,-20" Height="26" Width="14" Foreground="Red" Visibility="Collapsed" FontWeight="Bold" ToolTip="Suchfeld leeren" Click="btnClearSearchArrived_Click"/>

        <TextBlock x:Name="gridSplitterArrows" Text="↔" Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="-8,-2,0,-20" FontSize="20" Foreground="Gray" RenderTransformOrigin="0.5,0.5" FontWeight="Bold" Visibility="Collapsed">
            <TextBlock.RenderTransform>
                <TransformGroup>
                    <ScaleTransform/>
                    <SkewTransform/>
                    <RotateTransform Angle="90"/>
                    <TranslateTransform/>
                </TransformGroup>
            </TextBlock.RenderTransform>
        </TextBlock>
        <TextBlock x:Name="gridSplitterLine" Text="↔" Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="8,-2,0,-20" FontSize="20" Foreground="Gray" RenderTransformOrigin="0.5,0.5" FontWeight="Bold" Visibility="Collapsed">
            <TextBlock.RenderTransform>
                <TransformGroup>
                    <ScaleTransform/>
                    <SkewTransform/>
                    <RotateTransform Angle="90"/>
                    <TranslateTransform/>
                </TransformGroup>
            </TextBlock.RenderTransform>
        </TextBlock>
            <GridSplitter x:Name="gridSplitter" Cursor="SizeNS" ResizeDirection="Rows" ResizeBehavior="PreviousAndNext" Grid.Row="2" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="300,10,300,-10" Height="3" Background="LightGray" Grid.IsSharedSizeScope="True" Visibility="Collapsed" DragCompleted="gridSplitter_DragCompleted"/>
        <!---->




        <Grid x:Name="gridArrived" Margin="0,10,0,10" Grid.Row="3" Visibility="Collapsed" VerticalAlignment="Top" MinHeight="100">
            <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Top" Width="300" Margin="10,10,0,0"><Run Text="Ankunft bereits bestätigt: (letzte 10 Tage)"/></TextBlock>

            <DataGrid x:Name="dgOverview" MinHeight="90" RowHeaderWidth="0" HorizontalGridLinesBrush="Gray" GridLinesVisibility="Horizontal" KeyboardNavigation.TabNavigation="None" ItemsSource="{Binding ., UpdateSourceTrigger=PropertyChanged}" CanUserAddRows="False" CanUserDeleteRows="False" AutoGenerateColumns="False" Margin="10,31,10,0" CellEditEnding="dgOverview_CellEditEnding">
                <DataGrid.RowStyle>
                    <Style TargetType="DataGridRow">
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Kategorie}" Value="4">
                                <Setter Property="Background" Value="#80fa0202"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding Kategorie}" Value="5">
                                <Setter Property="Background" Value="#80095feb"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </DataGrid.RowStyle>
                <DataGrid.Columns>
                    <DataGridTextColumn Header="Kategorie" Binding="{Binding Kategorie, Converter={StaticResource IntToCategory}}" IsReadOnly="True">
                        <DataGridTextColumn.ElementStyle>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Margin" Value="4"/>
                                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
                            </Style>
                        </DataGridTextColumn.ElementStyle>
                    </DataGridTextColumn>

                    <DataGridTextColumn Header="Name" Binding="{Binding Name}" Width="*" IsReadOnly="True">
                        <DataGridTextColumn.ElementStyle>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Margin" Value="4"/>
                                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
                            </Style>
                        </DataGridTextColumn.ElementStyle>
                    </DataGridTextColumn>

                    <DataGridTextColumn Header="Zutritt" Binding="{Binding Zutritt, StringFormat=\{0:dd.MM.yyyy HH:mm\}}" CanUserReorder="False" SortDirection="Descending" IsReadOnly="True">
                        <DataGridTextColumn.ElementStyle>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Margin" Value="4"/>
                                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
                            </Style>
                        </DataGridTextColumn.ElementStyle>
                    </DataGridTextColumn>

                    <DataGridTextColumn Header="Prüfung Zutritt" Binding="{Binding Pruefung_Zutritt}" IsReadOnly="True">
                        <DataGridTextColumn.ElementStyle>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Padding" Value="3"/>
                                <Setter Property="Background" Value="{Binding Pruefung_Zutritt, Converter={StaticResource ConvertToBackground}}"/>
                                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
                                <Setter Property="TextAlignment" Value="Center" />
                            </Style>
                        </DataGridTextColumn.ElementStyle>
                    </DataGridTextColumn>

                    <DataGridTextColumn Header="Prüfung Einweisung" Binding="{Binding Pruefung_Einweisung}" IsReadOnly="True">
                        <DataGridTextColumn.ElementStyle>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Padding" Value="3"/>
                                <Setter Property="Background" Value="{Binding Pruefung_Einweisung, Converter={StaticResource ConvertToBackground}}"/>
                                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
                                <Setter Property="TextAlignment" Value="Center" />
                            </Style>
                        </DataGridTextColumn.ElementStyle>
                    </DataGridTextColumn>

                    <DataGridTextColumn Header="Anzahl Personen" Binding="{Binding AnzahlPers}" IsReadOnly="True">
                        <DataGridTextColumn.ElementStyle>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Margin" Value="4"/>
                                <Setter Property="TextAlignment" Value="Center"/>
                                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
                            </Style>
                        </DataGridTextColumn.ElementStyle>
                    </DataGridTextColumn>

                    <DataGridTextColumn x:Name="anzFzg" Header="Anzahl Fzg" IsReadOnly="True">
                        <DataGridTextColumn.Binding>
                            <MultiBinding StringFormat="{}{0} / {1}">
                                <Binding Path="AnzahlFzg" />
                                <Binding Path="Fzg_gemeldet" />
                            </MultiBinding>
                        </DataGridTextColumn.Binding>
                        <DataGridTextColumn.ElementStyle>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Padding" Value="4"/>
                                <Setter Property="TextAlignment" Value="Center"/>
                                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
                                <Setter Property="Background">
                                    <Setter.Value>
                                        <MultiBinding Converter="{StaticResource MultiToBackground}">
                                            <Binding Path="AnzahlFzg"/>
                                            <Binding Path="Fzg_gemeldet"/>
                                        </MultiBinding>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                        </DataGridTextColumn.ElementStyle>
                    </DataGridTextColumn>
                    <DataGridTextColumn Header="Kennzeichen" Binding="{Binding Kennzeichen}">
                        <DataGridTextColumn.ElementStyle>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Margin" Value="4"/>
                                <Setter Property="TextAlignment" Value="Center"/>
                                <Setter Property="ToolTip" Value="Doppelklicken um Kennzeichen nachträglich zu ändern"/>
                                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
                            </Style>
                        </DataGridTextColumn.ElementStyle>
                    </DataGridTextColumn>
                    <DataGridTextColumn Header="Ansprechpartner / Tel. bei Lieferant" Binding="{Binding Ansprechpartner}" Width="*" IsReadOnly="True">
                        <DataGridTextColumn.ElementStyle>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Margin" Value="4"/>
                                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
                            </Style>
                        </DataGridTextColumn.ElementStyle>
                    </DataGridTextColumn>
                    <DataGridTemplateColumn Header="kl. Unterweisung" IsReadOnly="True">
                        <DataGridTemplateColumn.CellStyle>
                            <Style TargetType="{x:Type DataGridCell}">
                                <Setter Property="HorizontalAlignment" Value="Center"/>
                                <Setter Property="VerticalAlignment" Value="Center"/>
                            </Style>
                        </DataGridTemplateColumn.CellStyle>
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <CheckBox x:Name="cBKleine_Unterweis" IsChecked="{Binding Kl_Unterweisung, Converter={StaticResource BoolToCheckBox}}" Click="CBKleine_Unterweis_Click"/>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <!--<DataGridTemplateColumn Header="Karte" MinWidth="40">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <Button x:Name="btnCard" Click="btnCard_Click" Content="Karte"/>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>-->
                    <DataGridTemplateColumn Header="Asp-Info" MinWidth="40" IsReadOnly="True">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <Button x:Name="btnInfoArrived" Click="BtnInfoArrived_Click" Content="Info" IsEnabled="{Binding idFirma_Besucher, Converter={StaticResource DBNullToBool}}"/>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTextColumn MaxWidth="0.1" CanUserResize="False" CanUserSort="False" CanUserReorder="False"/>
                </DataGrid.Columns>
            </DataGrid>

        </Grid>

        <Grid x:Name="UserCreate" Visibility="Collapsed" Grid.RowSpan="3">
            <!--<Button x:Name="btnUserCreate" Content="Besucher erstellen" Click="btnUserCreate_Click" Margin="0" Width="500" Height="70" FontSize="20" Padding="5" Background="#FF85F7A4" BorderBrush="#FFCDCDCD" Foreground="Blue" FontWeight="Bold">
                <Button.Template>
                    <ControlTemplate TargetType="{x:Type ButtonBase}">
                        <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="10" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
                            <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="Button.IsDefaulted" Value="True">
                                <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" TargetName="border" Value="#FFBEE6FD"/>
                                <Setter Property="BorderBrush" TargetName="border" Value="#FF3C7FB1"/>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="True">
                                <Setter Property="Background" TargetName="border" Value="#FFC4E5F6"/>
                                <Setter Property="BorderBrush" TargetName="border" Value="#FF2C628B"/>
                            </Trigger>
                            <Trigger Property="ToggleButton.IsChecked" Value="True">
                                <Setter Property="Background" TargetName="border" Value="#FFBCDDEE"/>
                                <Setter Property="BorderBrush" TargetName="border" Value="#FF245A83"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter Property="Background" TargetName="border" Value="#FFF4F4F4"/>
                                <Setter Property="BorderBrush" TargetName="border" Value="#FFADB2B5"/>
                                <Setter Property="Foreground" Value="#FF838383"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Button.Template>
            </Button>-->
            <Button x:Name="btnCreatePark" Content="Parkausweis beantragen" Click="btnCreateParkausweis_Click" Margin="100, 100, 100, 250" Width="500" Height="70" FontSize="20" Background="#FF85F7A4" BorderBrush="#FFCDCDCD" Foreground="Blue" FontWeight="Bold">
                <Button.Template>
                    <ControlTemplate TargetType="{x:Type ButtonBase}">
                        <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="10" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
                            <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="Button.IsDefaulted" Value="True">
                                <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" TargetName="border" Value="#FFBEE6FD"/>
                                <Setter Property="BorderBrush" TargetName="border" Value="#FF3C7FB1"/>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="True">
                                <Setter Property="Background" TargetName="border" Value="#FFC4E5F6"/>
                                <Setter Property="BorderBrush" TargetName="border" Value="#FF2C628B"/>
                            </Trigger>
                            <Trigger Property="ToggleButton.IsChecked" Value="True">
                                <Setter Property="Background" TargetName="border" Value="#FFBCDDEE"/>
                                <Setter Property="BorderBrush" TargetName="border" Value="#FF245A83"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter Property="Background" TargetName="border" Value="#FFF4F4F4"/>
                                <Setter Property="BorderBrush" TargetName="border" Value="#FFADB2B5"/>
                                <Setter Property="Foreground" Value="#FF838383"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Button.Template>
            </Button>

            <Button x:Name="btnMcFitSignUp" Content="User für McFit Karten erstellen" Click="btnMcFitSignUp_Click" Margin="100, 250, 100, 100" Width="500" Height="70" FontSize="20" Background="#FF85F7A4" BorderBrush="#FFCDCDCD" Foreground="Blue" FontWeight="Bold">
                <Button.Template>
                    <ControlTemplate TargetType="{x:Type ButtonBase}">
                        <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="10" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
                            <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="Button.IsDefaulted" Value="True">
                                <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" TargetName="border" Value="#FFBEE6FD"/>
                                <Setter Property="BorderBrush" TargetName="border" Value="#FF3C7FB1"/>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="True">
                                <Setter Property="Background" TargetName="border" Value="#FFC4E5F6"/>
                                <Setter Property="BorderBrush" TargetName="border" Value="#FF2C628B"/>
                            </Trigger>
                            <Trigger Property="ToggleButton.IsChecked" Value="True">
                                <Setter Property="Background" TargetName="border" Value="#FFBCDDEE"/>
                                <Setter Property="BorderBrush" TargetName="border" Value="#FF245A83"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter Property="Background" TargetName="border" Value="#FFF4F4F4"/>
                                <Setter Property="BorderBrush" TargetName="border" Value="#FFADB2B5"/>
                                <Setter Property="Foreground" Value="#FF838383"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Button.Template>
            </Button>
            <TextBlock x:Name="lblmcfit2" Text="Aktuell verfügbare McFit Karten: " HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,250,0,0" Visibility="Collapsed"/>

            <Button x:Name="btnFamily2" Content="Werksführung - Mein Arbeitsplatz" HorizontalContentAlignment="Center" Click="btnFamily_Click" Margin="100, 400, 100, 0" Width="500" Height="70" FontSize="20" Background="#FF85F7A4" BorderBrush="#FFCDCDCD" Foreground="Blue" FontWeight="Bold">
                <Button.Template>
                    <ControlTemplate TargetType="{x:Type ButtonBase}">
                        <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="10" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
                            <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="Button.IsDefaulted" Value="True">
                                <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" TargetName="border" Value="#FFBEE6FD"/>
                                <Setter Property="BorderBrush" TargetName="border" Value="#FF3C7FB1"/>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="True">
                                <Setter Property="Background" TargetName="border" Value="#FFC4E5F6"/>
                                <Setter Property="BorderBrush" TargetName="border" Value="#FF2C628B"/>
                            </Trigger>
                            <Trigger Property="ToggleButton.IsChecked" Value="True">
                                <Setter Property="Background" TargetName="border" Value="#FFBCDDEE"/>
                                <Setter Property="BorderBrush" TargetName="border" Value="#FF245A83"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter Property="Background" TargetName="border" Value="#FFF4F4F4"/>
                                <Setter Property="BorderBrush" TargetName="border" Value="#FFADB2B5"/>
                                <Setter Property="Foreground" Value="#FF838383"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Button.Template>
            </Button>
        </Grid>

        <Grid x:Name="canvasHelp" Panel.ZIndex="98" HorizontalAlignment="Center" VerticalAlignment="Center" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" Visibility="Collapsed" Width="450" Height="550" Grid.RowSpan="3">
            <Border BorderBrush="Gray" BorderThickness="2" Width="450" Height="{Binding Height, ElementName=canvasHelp}"/>
            <TextBlock Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" TextWrapping="Wrap" Margin="10" TextAlignment="Center"><Run FontWeight="Bold" Text="Hilfe" TextDecorations="Underline"/><LineBreak/><Run/><LineBreak/><Run/><LineBreak/><Run Text="Bei Problemen bitte an Marcus Bachler wenden."/><LineBreak/><Run/><LineBreak/><Run/></TextBlock>
            <TextBlock TextWrapping="Wrap" Text="marcus.bachler@deutschebahn.com" Margin="10,80" TextDecorations="Underline" Foreground="#FF002AE6" TextAlignment="Center" Cursor="Hand" PreviewMouseLeftButtonUp="TextBlock_PreviewMouseLeftButtonUp"/>
            <TextBlock Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" TextWrapping="Wrap" Margin="10,120" TextAlignment="Center"><Run Text="ZKuP"/><LineBreak/><Run x:Name="lblVersion"/><LineBreak/><Run/><LineBreak/><Run FontSize="12" FontFamily="Segoe UI"/><LineBreak/><Run FontSize="12" FontFamily="Segoe UI" Text="© Marcus Bachler"/></TextBlock>
            <Button x:Name="btnDebug" Content="Schließen" Width="380" Height="29" Click="btnDebug_Click" Visibility="Collapsed"/>
            <TextBlock Text="Falls Fenster mal nicht mehr sichtbar oder außerhalb&#xA;des Bildschirms sein sollte mit Strg+R zurücksetzen" TextAlignment="Center" Foreground="Red" FontWeight="Bold" Width="380" Margin="10, 220"/>
            <TextBlock x:Name="lblResetLists" Text="Untere Liste(Ankunft heute) nicht mehr sichtbar?&#xA; -> Listengröße zurücksetzen" Width="380" Height="40" Visibility="Collapsed"/>
            <Button x:Name="btnResetLists" Content="Listengröße zurücksetzen" VerticalAlignment="Center" Margin="10,80,10,0" Click="btnResetLists_Click" Visibility="Collapsed"/>

            <RichTextBox BorderThickness="0" IsReadOnly="True" VerticalAlignment="Bottom" Margin="10,0,10,40">
                <FlowDocument>
                    <Section>
                        <Paragraph FontSize="11" TextDecorations="Underline">OpenSource Bibliotheken:</Paragraph>
                        <Paragraph Margin="10,0,0,0" FontSize="11">
                            <Run Text="BouncyCastle                 "></Run>
                            <Hyperlink>http://bouncycastle.org/csharp/</Hyperlink>
                            <LineBreak/>
                            <Run Text="ColorHelper                   "></Run>
                            <Hyperlink>https://github.com/iamartyom/ColorHelper</Hyperlink>
                            <LineBreak/>
                            <Run Text="Costura                          "></Run>
                            <Hyperlink>https://github.com/Fody/Costura</Hyperlink>
                            <LineBreak/>
                            <Run Text="Google.Protobuf            "></Run>
                            <Hyperlink>https://github.com/protocolbuffers/protobuf</Hyperlink>
                            <LineBreak/>
                            <Run Text="K4os.Compression.LZ4  "></Run>
                            <Hyperlink>https://github.com/MiloszKrajewski/K4os.Compression.LZ4</Hyperlink>
                            <LineBreak/>
                            <Run Text="MahApps.Metro             "></Run>
                            <Hyperlink>https://github.com/MahApps/MahApps.Metro</Hyperlink>
                            <LineBreak/>
                            <Run Text="Newtonsoft.Json            "></Run>
                            <Hyperlink>https://www.newtonsoft.com/json</Hyperlink>
                            <LineBreak/>
                            <Run Text="WpfScreenHelper          "></Run>
                            <Hyperlink>https://github.com/micdenny/WpfScreenHelper</Hyperlink>
                            <LineBreak/>
                            <Run Text="XamlAnimatedGif          "></Run>
                            <Hyperlink>https://github.com/XamlAnimatedGif/XamlAnimatedGif</Hyperlink>
                            <LineBreak/>
                        </Paragraph>
                    </Section>
                </FlowDocument>
            </RichTextBox>

            <Button x:Name="btnCloseHelp" Content="Schließen" Margin="10,10" VerticalAlignment="Bottom" Click="BtnCloseHelp_Click"/>
        </Grid>

        <Border x:Name="canvasSettings" Margin="0" BorderThickness="1" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" CornerRadius="10" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" Visibility="Collapsed" Width="430" Height="400" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.RowSpan="3">
            <Grid>
                <!--<Border BorderBrush="Gray" BorderThickness="2" Width="400" Height="364"/>-->
                <CheckBox x:Name="cbShowParkcardToAccept" Content="Meldung 'Es sind Parkkarten zu Genehmigen vorhanden' anzeigen?" Margin="10,20,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Checked="cbShowParkcardToAccept_Checked" Unchecked="cbShowParkcardToAccept_Unchecked"/>
                <CheckBox x:Name="cbShowParkcardToPrint" Content="Meldung 'Es sind Parkkarten zum drucken vorhanden' anzeigen?" Margin="10,50,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Checked="cbShowParkcardToPrint_Checked" Unchecked="cbShowParkcardToPrint_Unchecked"/>

                <TextBlock Text="Parkkarten-Benachrichtigung:" Margin="10,85"/>

                <DataGrid x:Name="dgParkEmailUsers" IsReadOnly="True" AutoGenerateColumns="False" ItemsSource="{Binding ParkEmailUsers}" Width="350" Height="120" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False" Margin="10,110,10,30"  VerticalAlignment="Top" HorizontalAlignment="Left">
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="ID" Binding="{Binding idparkEmailUsers}"/>
                        <DataGridTextColumn Header="Name" Binding="{Binding Name}"/>
                        <DataGridTextColumn Header="Email" Binding="{Binding Email}"/>
                    </DataGrid.Columns>
                </DataGrid>
                <Button x:Name="btnAddParkEmailUser" Content="" FontFamily="Segoe UI Symbol" Width="40" Height="40" Padding="0" ToolTip="Email-Empfänger hinzufügen" Margin="10,120" VerticalAlignment="Top" HorizontalAlignment="Right" Click="btnAddParkEmailUser_Click"/>
                <Button x:Name="btnDelParkEmailUser" Content="" FontFamily="Segoe UI Symbol" Width="40" Height="40" Padding="0" ToolTip="Email-Empfänger entfernen" Margin="10,170" VerticalAlignment="Top" HorizontalAlignment="Right" Click="btnDelParkEmailUser_Click"/>

                <TextBlock Text="Fahrzeuganmeldungen-Benachrichtung:" Margin="10,215,0,0"/>

                <DataGrid x:Name="dgFzgAnmeldungUsers" IsReadOnly="True" AutoGenerateColumns="False" ItemsSource="{Binding FzgAnmeldungUsers}" Width="350" Height="140" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False" Margin="10,240,10,30"  VerticalAlignment="Top" HorizontalAlignment="Left">
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="ID" Binding="{Binding idfzgAnmeldungEmail}"/>
                        <DataGridTextColumn Header="Name" Binding="{Binding Name}"/>
                        <DataGridTextColumn Header="Email" Binding="{Binding Email}"/>
                    </DataGrid.Columns>
                </DataGrid>
                <Button x:Name="btnAddFzgAnmeldungUser" Content="" FontFamily="Segoe UI Symbol" Width="40" Height="40" Padding="0" ToolTip="Email-Empfänger hinzufügen" Margin="10,240,10,0" VerticalAlignment="Top" HorizontalAlignment="Right" Click="btnAddFzgAnmeldungUser_Click"/>
                <Button x:Name="btnDelFzgAnmeldungUser" Content="" FontFamily="Segoe UI Symbol" Width="40" Height="40" Padding="0" ToolTip="Email-Empfänger entfernen" Margin="10,290,10,0" VerticalAlignment="Top" HorizontalAlignment="Right" Click="btnDelFzgAnmeldungUser_Click"/>


                <Popup x:Name="cm" AllowsTransparency="True" StaysOpen="False" Placement="MousePoint">
                    <Border BorderThickness="1" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" CornerRadius="10">

                        <Grid Margin="10">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>
                            <TextBlock Text="Email Adresse:"/>
                            <TextBox x:Name="tbParkEmailUserEmail" Text="@deutschebahn.com" Width="300" Height="30" Margin="5" Grid.Row="1" KeyDown="AddParkEmailUserTextBox_KeyDown"/>
                            <Button Content="" FontFamily="Segoe UI Symbol" Padding="0" Width="30" Height="30" Grid.Column="1" Grid.Row="1" Click="AddParkEmailUserAdd_Click"/>
                        </Grid>
                    </Border>
                </Popup>


                <Popup x:Name="popFzgAnmeldung" AllowsTransparency="True" StaysOpen="False" Placement="MousePoint">
                    <Border BorderThickness="1" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" CornerRadius="10">

                        <Grid Margin="10">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>
                            <TextBlock Text="Email Adresse:"/>
                            <TextBox x:Name="tbFzgAnmeldungUserEmail" Text="@deutschebahn.com" Width="300" Height="30" Margin="5" Grid.Row="1" KeyDown="AddFzgAnmeldungEmailUserTextBox_KeyDown"/>
                            <Button Content="" FontFamily="Segoe UI Symbol" Padding="0" Width="30" Height="30" Grid.Column="1" Grid.Row="1" Click="AddFzgAnmeldungEmailUserAdd_Click"/>
                        </Grid>
                    </Border>
                </Popup>

                <Button x:Name="btnCloseSettings" Content="Schließen" Margin="10" Width="100" Height="29" Click="btnCloseSettings_Click" HorizontalAlignment="Right" VerticalAlignment="Bottom"/>
            </Grid>
        </Border>

        </Grid>
        
        <Grid Margin="0,-25,200,0" HorizontalAlignment="Right" VerticalAlignment="Top">

            <Border>
                <Grid Width="50" Height="30" HorizontalAlignment="Left" VerticalAlignment="Top">
                    <Image Source="/Resources/ConnBackground.png" HorizontalAlignment="Left" VerticalAlignment="Top" Stretch="Uniform"/>
                    <!--<Image x:Name="imgConnection" Source="/Resources/Disconnected.png" Width="50" Height="30" HorizontalAlignment="Left" VerticalAlignment="Top" Stretch="Uniform"/>-->
                    <Image x:Name="imgConnection" Source="{StaticResource NotConnectedIcon}" Width="38" Height="30" Margin="2,0,2,4" HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="Uniform"/>
                    <Image x:Name="imgSecureConn" Source="/Resources/Lock.png" ToolTip="Verbindung OK und gesichert" Visibility="Collapsed" Width="16" Margin="26,2,0,0"/>
                </Grid>
            </Border>

            <Button x:Name="btnDarkMode"  Click="btnDarkMode_Click" Padding="2,3,2,0" FontWeight="Regular" Visibility="Visible" Panel.ZIndex="100" Margin="50,0,0,0" HorizontalAlignment="Left" Width="35" Height="25" VerticalAlignment="Top">
                <Image x:Name="imgDarkModeButton" Source="/Resources/Moon.png"/>
                <Button.Background>
                    <ImageBrush ImageSource="/Resources/ConnBackground.png"/>
                </Button.Background>
                <Button.ContextMenu>
                    <ContextMenu>
                        <MenuItem Header="Blau" Click="AccentMenuItem_Click"/>
                        <MenuItem Header="Braun" Click="AccentMenuItem_Click"/>
                        <MenuItem Header="Grün" Click="AccentMenuItem_Click"/>
                        <MenuItem Header="Magenta" Click="AccentMenuItem_Click"/>
                        <MenuItem Header="Orange" Click="AccentMenuItem_Click"/>
                        <MenuItem Header="Rot" Click="AccentMenuItem_Click"/>
                        <MenuItem Header="Grau" Click="AccentMenuItem_Click"/>
                        <MenuItem Header="Gelb" Click="AccentMenuItem_Click"/>
                    </ContextMenu>
                </Button.ContextMenu>
                <Button.ToolTip>
                    <StackPanel Orientation="Vertical">
                        <TextBlock Text="Dark / Light - Mode wechseln"/>
                        <TextBlock Text="Rechtsklick um Akzentfarbe zu ändern"/>
                    </StackPanel>
                </Button.ToolTip>
            </Button>
            
            <Button x:Name="btnSettings" Content="" ToolTip="Einstellungen" Margin="100,0,0,0" Foreground="LightGray" FontFamily="Segoe UI Symbol" Click="btnSettings_Click" FontSize="18" Padding="2" FontWeight="Regular" Visibility="Collapsed" HorizontalAlignment="Left" Width="35" Height="25" VerticalAlignment="Top" Panel.ZIndex="100">
                <Button.Background>
                    <ImageBrush ImageSource="/Resources/ConnBackground.png"/>
                </Button.Background>
            </Button>
        </Grid>
    </Grid>
</mah:MetroWindow>
