<Window x:Class="ScreenToGif.Windows.Other.Startup"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:n="clr-namespace:ScreenToGif.Controls"
        x:Name="StartupWindow" Title="{DynamicResource S.StartUp.Title}" Height="220" Width="500" Icon="/Resources/Logo.ico" 
        MinWidth="500" MinHeight="220" DataContext="{StaticResource AppViewModel}" UseLayoutRounding="True" 
        Background="{DynamicResource Panel.Background}" Initialized="Startup_Initialized" Loaded="Startup_Loaded" Closing="Startup_Closing">

    <Window.InputBindings>
        <KeyBinding Command="{Binding OpenRecorder}" CommandParameter="{Binding ElementName=StartupWindow}" Modifiers="Control" Key="N"/>
        <KeyBinding Command="{Binding OpenWebcamRecorder}" CommandParameter="{Binding ElementName=StartupWindow}" Modifiers="Control" Key="W"/>
        <KeyBinding Command="{Binding OpenBoardRecorder}" CommandParameter="{Binding ElementName=StartupWindow}" Modifiers="Control" Key="B"/>
        <KeyBinding Command="{Binding OpenEditor}" CommandParameter="{Binding ElementName=StartupWindow}" Modifiers="Control" Key="E"/>
        <KeyBinding Command="{Binding OpenOptions}" Modifiers="Control+Alt" Key="O"/>
    </Window.InputBindings>

    <Window.CommandBindings>
        <CommandBinding Command="{StaticResource Command.Update}" CanExecute="Update_CanExecute" Executed="Update_Executed"/>
    </Window.CommandBindings>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="45"/>
            <RowDefinition />
        </Grid.RowDefinitions>

        <Grid Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>

            <TextBlock Grid.Column="0" Text="ScreenToGif" Margin="10" FontSize="18" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}" Effect="{DynamicResource Shadow.Border.Small}"/>

            <TextBlock Grid.Column="1" Name="UpdateTextBlock" VerticalAlignment="Center" Visibility="Hidden" Effect="{StaticResource Shadow.Border.Small}">
                <Hyperlink Command="{StaticResource Command.Update}" ToolTip="{DynamicResource S.StartUp.NewRelease.Tooltip}" Cursor="Hand">
                    <Run Name="UpdateRun" Text="{DynamicResource S.StartUp.NewRelease}"/>
                </Hyperlink>
            </TextBlock>

            <n:ExtendedButton Grid.Column="3" Text="{DynamicResource S.StartUp.Options}" Icon="{StaticResource Vector.Options}" 
                              Margin="5" Style="{StaticResource Style.Button.Horizontal}" Effect="{StaticResource Shadow.Border.Small}"
                              Padding="2" ContentWidth="25" ContentHeight="25" Command="{Binding OpenOptions}"/>
        </Grid>

        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition/>
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>

            <n:ExtendedButton Grid.Column="0" Text="{DynamicResource S.StartUp.Recorder}" Margin="5,0,5,5" FontSize="13" Style="{StaticResource Style.Button.Vertical.Border}"
                              Effect="{StaticResource Shadow.Border.Tiny}" ContentWidth="36" ContentHeight="36" Icon="{StaticResource Vector.Record.New}" 
                              Command="{Binding OpenRecorder}" CommandParameter="{Binding ElementName=StartupWindow}" 
                              ToolTip="{DynamicResource S.StartUp.Recorder.Tooltip}" ToolTipService.Placement="Bottom"/>

            <n:ExtendedButton Grid.Column="1" Text="{DynamicResource S.StartUp.Webcam}" Margin="5,0,5,5" FontSize="13" Style="{StaticResource Style.Button.Vertical.Border}"
                              Effect="{StaticResource Shadow.Border.Tiny}" ContentWidth="36" ContentHeight="36" Icon="{StaticResource Vector.Camera.New}" 
                              Command="{Binding OpenWebcamRecorder}" CommandParameter="{Binding ElementName=StartupWindow}" 
                              ToolTip="{DynamicResource S.StartUp.Webcam.Tooltip}" ToolTipService.Placement="Bottom"/>

            <n:ExtendedButton Grid.Column="2" Text="{DynamicResource S.StartUp.Board}" Margin="5,0,5,5" FontSize="13" Style="{StaticResource Style.Button.Vertical.Border}"
                              Effect="{StaticResource Shadow.Border.Tiny}" ContentWidth="36" ContentHeight="36" Icon="{StaticResource Vector.Board.New}" 
                              Command="{Binding OpenBoardRecorder}" CommandParameter="{Binding ElementName=StartupWindow}"
                              ToolTip="{DynamicResource S.StartUp.Board.Tooltip}" ToolTipService.Placement="Bottom"/>

            <n:ExtendedButton Grid.Column="3" Text="{DynamicResource S.StartUp.Editor}" Margin="5,0,5,5" FontSize="13" Style="{StaticResource Style.Button.Vertical.Border}"
                              Effect="{StaticResource Shadow.Border.Tiny}" ContentWidth="36" ContentHeight="36" Icon="{StaticResource Vector.Editor}" 
                              Command="{Binding OpenEditor}" CommandParameter="{Binding ElementName=StartupWindow}" 
                              ToolTip="{DynamicResource S.StartUp.Editor.Tooltip}" ToolTipService.Placement="Bottom"/>
        </Grid>
    </Grid>
</Window>