<mah:MetroWindow x:Class="ZKuP.Notifications"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:ZKuP"
        xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
        mc:Ignorable="d"
        Title="Notifications" Height="380" Width="430" MinHeight="420" MinWidth="430" MaxWidth="430"  Loaded="Window_Loaded" LocationChanged="Window_LocationChanged">

    <mah:MetroWindow.Resources>
        <ResourceDictionary>
            <local:IntToYesNo x:Key="IntToBool"></local:IntToYesNo>
        </ResourceDictionary>
    </mah:MetroWindow.Resources>
    
    
    <Grid>
        <StackPanel Margin="10,20,10,10">
            <TextBlock Text="Kategorie wählen:" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
            <ComboBox x:Name="cbCategory" Height="30" Margin="0,5,0,0" VerticalAlignment="Top" SelectionChanged="cbCategory_SelectionChanged">
                <ComboBoxItem Content=""/>
                <ComboBoxItem Content="Firma"/>
                <ComboBoxItem Content="Besucher"/>
                <ComboBoxItem Content="Lieferant"/>
                <ComboBoxItem Content="DB Notdienst"/>
            </ComboBox>
        </StackPanel>

        <StackPanel Margin="10,80,10,10">
            <TextBlock x:Name="tbChoose" Text="" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
            <ComboBox x:Name="cBVisitor" Margin="0,5,0,0" Height="30" VerticalAlignment="Top" IsEnabled="False" SelectionChanged="cBVisitor_SelectionChanged"/>
        </StackPanel>

        <StackPanel Orientation="Vertical" VerticalAlignment="Top" Margin="10,150,5,0">
            <!--<CheckBox x:Name="cbWin" Margin="10,5,0,10" Content="Windows-Notification" IsEnabled="False" Checked="cbWin_Checked" Unchecked="cbWin_Unchecked"/>-->

            <DockPanel  Margin="5,0,10,5">
                <TextBlock x:Name="lblSMS" Margin="5" Text="Handynr.:" IsEnabled="False"/>
                <TextBox x:Name="tbSMS" HorizontalAlignment="Right" Width="250" IsEnabled="True"/>
            </DockPanel>
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,5,0,0">
                <TextBlock Text="Bei jeder Einfahrt benachrichtigen?"/>
                <RadioButton x:Name="rbRepeatYes" Content="Ja" GroupName="rbRepeat" Margin="20,0"/>
                <RadioButton Content="Nein" IsChecked="True" GroupName="rbRepeat" Margin="20,0"/>
            </StackPanel>
            <DataGrid x:Name="dgNotifications" AutoGenerateColumns="False" MinHeight="100" Margin="0,10,0,0" ToolTip="Markieren und mit 'ENTF' entfernen" PreviewKeyDown="dgNotifications_PreviewKeyDown">
                <DataGrid.Columns>
                    <DataGridTextColumn Header="ID" Binding="{Binding id_notification}" Width="0" CanUserResize="False" Visibility="Hidden"/>
                    <DataGridTextColumn Header="Besucher" Binding="{Binding Visitor}"/>
                    <DataGridTextColumn Header="Handynr." Binding="{Binding SMS}"/>
                    <DataGridTextColumn Header="SMS gesendet" Binding="{Binding SMSSent, Converter={StaticResource IntToBool}}">
                        <DataGridTextColumn.ElementStyle>
                            <Style TargetType="TextBlock">
                                <Setter Property="TextAlignment" Value="Center" />
                            </Style>
                        </DataGridTextColumn.ElementStyle>
                    </DataGridTextColumn>
                    <DataGridTextColumn Header="SMS wiederholen" Binding="{Binding SMSRepeat, Converter={StaticResource IntToBool}}">
                        <DataGridTextColumn.ElementStyle>
                            <Style TargetType="TextBlock">
                                <Setter Property="TextAlignment" Value="Center" />
                            </Style>
                        </DataGridTextColumn.ElementStyle>
                    </DataGridTextColumn>
                </DataGrid.Columns>
            </DataGrid>
        </StackPanel>

        <StackPanel Orientation="Vertical" VerticalAlignment="Bottom">
            <Button x:Name="btnAddNotification" Content="Hinzufügen" Margin="5" Height="30" VerticalAlignment="Bottom" Click="btnAddNotification_Click"/>
            <Button x:Name="btnSave" Content="Schließen" Height="30" Margin="5" VerticalAlignment="Bottom" Click="btnSave_Click"/>
        </StackPanel>
    </Grid>
</mah:MetroWindow>
