<Window x:Class="CefFlashBrowser.Views.Dialogs.JsConfirmDialog"
        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:CefFlashBrowser.Views.Dialogs"
        xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
        xmlns:behaviors="clr-namespace:CefFlashBrowser.Views.Behaviors"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        mc:Ignorable="d"
        
        x:Name="window"
        Width="420"
        Height="200"
        ResizeMode="NoResize"
        WindowStartupLocation="CenterOwner"
        FocusManager.FocusedElement="{Binding ElementName=yesButton}">

    <Window.InputBindings>
        <KeyBinding Gesture="Ctrl+W"
                    Command="{Binding ElementName=windowBehavior, Path=CloseWindowCommand}"/>
        <KeyBinding Gesture="Esc"
                    Command="{Binding ElementName=windowBehavior, Path=SetDialogResultCommand}">
            <KeyBinding.CommandParameter>
                <sys:Boolean>False</sys:Boolean>
            </KeyBinding.CommandParameter>
        </KeyBinding>
        <KeyBinding Gesture="Enter"
                    Command="{Binding ElementName=windowBehavior, Path=SetDialogResultCommand}">
            <KeyBinding.CommandParameter>
                <sys:Boolean>True</sys:Boolean>
            </KeyBinding.CommandParameter>
        </KeyBinding>
    </Window.InputBindings>

    <i:Interaction.Behaviors>
        <behaviors:WindowBehavior x:Name="windowBehavior"/>
    </i:Interaction.Behaviors>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid Grid.Row="0">
            <TextBox Margin="15"
                     Padding="0"
                     IsReadOnly="True"
                     BorderThickness="0"
                     TextWrapping="Wrap"
                     VerticalContentAlignment="Top"
                     ScrollViewer.VerticalScrollBarVisibility="Auto"
                     Text="{Binding ElementName=window, Path=Message}"/>
        </Grid>
        <Grid Grid.Row="1">
            <StackPanel Margin="0,0,15,15"
                        Orientation="Horizontal"
                        HorizontalAlignment="Right">
                <Button x:Name="noButton"
                        MinWidth="70"
                        Content="{DynamicResource dialog_no}"
                        Click="OnNoButtonClick"/>
                <Button x:Name="yesButton"
                        Margin="10,0,0,0"
                        MinWidth="70"
                        Style="{StaticResource ButtonPrimary}"
                        Content="{DynamicResource dialog_yes}"
                        Click="OnYesButtonClick"/>
            </StackPanel>
        </Grid>
    </Grid>
</Window>
