<Window x:Class="ScreenToGif.Windows.Other.Localization"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:c="clr-namespace:ScreenToGif.Controls"
        Title="{DynamicResource S.Localization}" MinHeight="300" MinWidth="500" MaxHeight="500" SizeToContent="WidthAndHeight"
        Icon="/ScreenToGif;component/Resources/Logo.ico" WindowStartupLocation="CenterOwner" SnapsToDevicePixels="True" 
        Background="{DynamicResource Panel.Background}" Loaded="Localization_Loaded">

    <Window.CommandBindings>
        <CommandBinding Command="{StaticResource Command.MoveUp}" CanExecute="MoveUp_CanExecute" Executed="MoveUp_Executed"/>
        <CommandBinding Command="{StaticResource Command.MoveDown}" CanExecute="MoveDown_CanExecute" Executed="MoveDown_Executed"/>
        <CommandBinding Command="{StaticResource Command.Save}" CanExecute="Save_CanExecute" Executed="Save_Executed"/>
        <CommandBinding Command="{StaticResource Command.Remove}" CanExecute="Remove_CanExecute" Executed="Remove_Executed"/>
        <CommandBinding Command="{StaticResource Command.Add}" CanExecute="Add_CanExecute" Executed="Add_Executed"/>
    </Window.CommandBindings>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
            <RowDefinition Height="40"/>
        </Grid.RowDefinitions>

        <c:StatusBand Grid.Row="0" x:Name="StatusBand"/>

        <Grid Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>

            <ListBox Grid.Row="0" Grid.Column="0" Grid.RowSpan="6" x:Name="ResourceListBox" Margin="5,5,0,5" VerticalContentAlignment="Center"/>

            <c:ExtendedButton Grid.Row="0" Grid.Column="1" x:Name="UpButton" Margin="3,5" Icon="{StaticResource Vector.Arrow.Blue.Top}" ContentWidth="18" ContentHeight="18"
                              Style="{StaticResource Style.Button.NoText.Border}" MinWidth="30" MinHeight="30" Command="{StaticResource Command.MoveUp}"
                              ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                              ToolTipService.Placement="Right" ToolTipService.VerticalOffset="-5"/>

            <c:ExtendedButton Grid.Row="1" Grid.Column="1" x:Name="DownButton" Margin="3,5" Icon="{StaticResource Vector.Arrow.Blue.Bottom}" ContentWidth="18" ContentHeight="18"
                              Style="{StaticResource Style.Button.NoText.Border}" MinWidth="30" MinHeight="30" Command="{StaticResource Command.MoveDown}"
                              ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                              ToolTipService.Placement="Right" ToolTipService.VerticalOffset="-5"/>

            <c:ExtendedButton Grid.Row="2" Grid.Column="1" x:Name="AddButton" Margin="3,5" Icon="{StaticResource Vector.File.Add}" ContentWidth="18" ContentHeight="18"
                              Style="{StaticResource Style.Button.NoText.Border}" MinWidth="30" MinHeight="30" Command="{StaticResource Command.Add}"
                              ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                              ToolTipService.Placement="Right" ToolTipService.VerticalOffset="-5"/>

            <c:ExtendedButton Grid.Row="3" Grid.Column="1" x:Name="SaveButton" Margin="3,5" Icon="{StaticResource Vector.Save}" ContentWidth="18" ContentHeight="18"
                              Style="{StaticResource Style.Button.NoText.Border}" MinWidth="30" MinHeight="30" Command="{StaticResource Command.Save}"
                              ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                              ToolTipService.Placement="Right" ToolTipService.VerticalOffset="-5"/>

            <c:ExtendedButton Grid.Row="4" Grid.Column="1" x:Name="RemoveButton" Margin="3,5" Icon="{StaticResource Vector.Remove}" ContentWidth="18" ContentHeight="18"
                              Style="{StaticResource Style.Button.NoText.Border}" MinWidth="30" MinHeight="30" Command="{StaticResource Command.Remove}"
                              ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                              ToolTipService.Placement="Right" ToolTipService.VerticalOffset="-5"/>
        </Grid>

        <Grid Grid.Row="2" Background="{DynamicResource Panel.Background.Level3}" UseLayoutRounding="False">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>

            <TextBlock Grid.Column="0" TextAlignment="Center" VerticalAlignment="Center" FontSize="13" Foreground="{DynamicResource Element.Foreground.Header}" Margin="0">
                <Run Text="{DynamicResource S.Localization.Usage.First}"/><LineBreak/>
                <Run Text="{DynamicResource S.Localization.Usage.Second}"/>
            </TextBlock>

            <c:ExtendedButton Grid.Column="1" x:Name="OkButton" Text="{DynamicResource S.Ok}" Icon="{StaticResource Vector.Ok}" IsCancel="True"
                              ContentWidth="18" ContentHeight="18" Padding="5,0" MinWidth="90" Margin="5"/>
        </Grid>
    </Grid>
</Window>