<Window x:Class="ScreenToGif.Windows.Editor" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:cm="clr-namespace:System.ComponentModel;assembly=WindowsBase"
        xmlns:n="clr-namespace:ScreenToGif.Controls"
        xmlns:l="clr-namespace:ScreenToGif.Windows"
        xmlns:u="clr-namespace:ScreenToGif.Util"
        xmlns:c="clr-namespace:ScreenToGif.Util.Converters"
        xmlns:gl="clr-namespace:System.Globalization;assembly=mscorlib"
        xmlns:h="clr-namespace:ScreenToGif.Controls.Shapes" 
        xmlns:t="clr-namespace:ScreenToGif.Settings"
        x:Name="EditorWindow" Title="{DynamicResource S.Editor.Title}" MinHeight="500" MinWidth="700" 
        Background="{DynamicResource Panel.Background.Level3}" UseLayoutRounding="True" Icon="/Resources/Logo.ico"
        FocusManager.FocusedElement="{Binding RelativeSource={x:Static RelativeSource.Self}, Mode=OneTime}"
        Loaded="Window_Loaded" Closing="Window_Closing" Activated="Window_Activated" KeyUp="Window_KeyUp" 
        DpiChanged="Window_DpiChanged" Deactivated="Window_Deactivated">

    <Window.Resources>
        <c:DoubleToInt x:Key="DoubleToIntConverter"/>
        <c:InvertedBool x:Key="InvertedBoolConverter"/>
        <c:InvertedVisibility x:Key="InvertedVisibilityConverter"/>
        <c:MaximumValue x:Key="MaximumValueConverter"/>
        <c:DoubleTimesAHundredToInt x:Key="DoubleTimesAHundredToIntConverter"/>
        <c:UriToBitmap x:Key="UriToBitmapConverter"/>
        <c:PathToFilename x:Key="PathToFilenameConverter"/>
        <c:DoubleToThickness x:Key="DoubleToThicknessConverter"/>
        <c:SelectionToEditingMode x:Key="SelectionToEditingModeConverter"/>
        <c:SelectionToDrawingAttributes x:Key="SelectionToDrawingAttributesConverter"/>
        <c:SelectionToStylusShape x:Key="SelectionToStylusShapeConverter"/>
        <c:StylusTipToBool x:Key="StylusTipToBoolConverter"/>
        <c:FontToSupportedGliph x:Key="FontToSupportedGliphConverter"/>
        <c:FormatConverter x:Key="FormatConverter"/>
        <c:BoolAndToVisibility x:Key="BoolAndToVisibility"/>
        <c:IntToBool x:Key="IntToBool"/>
        <c:BoolAndOrOrToVisibility x:Key="BoolAndOrOrToVisibility"/>

        <Storyboard x:Key="ShowPanelStoryboard">
            <BooleanAnimationUsingKeyFrames Storyboard.TargetName="ActionGrid" Storyboard.TargetProperty="IsHitTestVisible" Duration="0:0:0" >
                <DiscreteBooleanKeyFrame Value="True" KeyTime="0:0:0"/>
            </BooleanAnimationUsingKeyFrames>

            <DoubleAnimation Storyboard.TargetName="ActionGrid" Storyboard.TargetProperty="(Grid.MinWidth)" From="{Binding ElementName=ActionGrid,Path=ActualWidth}" To="280" Duration="0:0:1">
                <DoubleAnimation.EasingFunction>
                    <PowerEase Power="8" />
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
            <DoubleAnimation Storyboard.TargetName="ActionGrid" Storyboard.TargetProperty="(Grid.Width)" From="{Binding ElementName=ActionGrid,Path=ActualWidth}" To="280" Duration="0:0:1">
                <DoubleAnimation.EasingFunction>
                    <PowerEase Power="8" />
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
            <DoubleAnimation Storyboard.TargetName="ActionGrid" Storyboard.TargetProperty="(Grid.Opacity)" From="{Binding ElementName=ActionGrid,Path=Opacity}" To="1" Duration="0:0:1">
                <DoubleAnimation.EasingFunction>
                    <PowerEase Power="8" />
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
        </Storyboard>

        <Storyboard x:Key="ShowExtendedPanelStoryboard">
            <BooleanAnimationUsingKeyFrames Storyboard.TargetName="ActionGrid" Storyboard.TargetProperty="IsHitTestVisible" Duration="0:0:0" >
                <DiscreteBooleanKeyFrame Value="True" KeyTime="0:0:0"/>
            </BooleanAnimationUsingKeyFrames>

            <DoubleAnimation Storyboard.TargetName="ActionGrid" Storyboard.TargetProperty="(Grid.MinWidth)" From="{Binding ElementName=ActionGrid,Path=ActualWidth}" To="320" Duration="0:0:1">
                <DoubleAnimation.EasingFunction>
                    <PowerEase Power="8" />
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
            <DoubleAnimation Storyboard.TargetName="ActionGrid" Storyboard.TargetProperty="(Grid.Width)" From="{Binding ElementName=ActionGrid,Path=ActualWidth}" To="320" Duration="0:0:1">
                <DoubleAnimation.EasingFunction>
                    <PowerEase Power="8" />
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
            <DoubleAnimation Storyboard.TargetName="ActionGrid" Storyboard.TargetProperty="(Grid.Opacity)" From="{Binding ElementName=ActionGrid,Path=Opacity}" To="1" Duration="0:0:1">
                <DoubleAnimation.EasingFunction>
                    <PowerEase Power="8" />
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
        </Storyboard>

        <Storyboard x:Key="HidePanelStoryboard">
            <BooleanAnimationUsingKeyFrames Storyboard.TargetName="ActionGrid" Storyboard.TargetProperty="IsHitTestVisible" Duration="0:0:0" >
                <DiscreteBooleanKeyFrame Value="False" KeyTime="0:0:0"/>
            </BooleanAnimationUsingKeyFrames>

            <DoubleAnimation Storyboard.TargetName="ActionGrid" Storyboard.TargetProperty="(Grid.MinWidth)" From="{Binding ElementName=ActionGrid,Path=ActualWidth}" To="0" Duration="0:0:1">
                <DoubleAnimation.EasingFunction>
                    <PowerEase Power="8" />
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
            <DoubleAnimation Storyboard.TargetName="ActionGrid" Storyboard.TargetProperty="(Grid.Width)" From="{Binding ElementName=ActionGrid,Path=ActualWidth}" To="0" Duration="0:0:1">
                <DoubleAnimation.EasingFunction>
                    <PowerEase Power="8"/>
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
            <DoubleAnimation Storyboard.TargetName="ActionGrid" Storyboard.TargetProperty="(Grid.Opacity)" From="{Binding ElementName=ActionGrid,Path=Opacity}" To="0" Duration="0:0:1">
                <DoubleAnimation.EasingFunction>
                    <PowerEase Power="8" />
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
        </Storyboard>

        <Storyboard x:Key="HideWelcomeBorderStoryboard">
            <DoubleAnimation Storyboard.TargetName="WelcomeGrid" Storyboard.TargetProperty="(Grid.Opacity)" From="{Binding ElementName=WelcomeGrid,Path=Opacity}" To="0" Duration="0:0:1">
                <DoubleAnimation.EasingFunction>
                    <PowerEase Power="8" />
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>

            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="WelcomeGrid" Storyboard.TargetProperty="Visibility" Duration="0:0:1" >
                <DiscreteObjectKeyFrame Value="{x:Static Visibility.Collapsed}" KeyTime="0:0:1"/>
            </ObjectAnimationUsingKeyFrames>
        </Storyboard>

        <Storyboard x:Key="ShowWelcomeBorderStoryboard">
            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="WelcomeGrid" Storyboard.TargetProperty="Visibility" Duration="0:0:0" >
                <DiscreteObjectKeyFrame Value="{x:Static Visibility.Visible}" KeyTime="0:0:0"/>
            </ObjectAnimationUsingKeyFrames>

            <DoubleAnimation Storyboard.TargetName="WelcomeGrid" Storyboard.TargetProperty="(Grid.Opacity)" From="0" To="1" Duration="0:0:1">
                <DoubleAnimation.EasingFunction>
                    <PowerEase Power="8" />
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
        </Storyboard>

        <Storyboard x:Key="HideOverlayGridStoryboard">
            <DoubleAnimation Storyboard.TargetName="OverlayGrid" Storyboard.TargetProperty="(Grid.Opacity)" From="{Binding ElementName=OverlayGrid,Path=Opacity}" To="0" Duration="0:0:1">
                <DoubleAnimation.EasingFunction>
                    <PowerEase Power="8" />
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>

            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OverlayGrid" Storyboard.TargetProperty="Visibility" Duration="0:0:1" >
                <DiscreteObjectKeyFrame Value="{x:Static Visibility.Collapsed}" KeyTime="0:0:1"/>
            </ObjectAnimationUsingKeyFrames>
        </Storyboard>

        <Storyboard x:Key="ShowOverlayGridStoryboard">
            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OverlayGrid" Storyboard.TargetProperty="Visibility" Duration="0:0:0" >
                <DiscreteObjectKeyFrame Value="{x:Static Visibility.Visible}" KeyTime="0:0:0"/>
            </ObjectAnimationUsingKeyFrames>

            <DoubleAnimation Storyboard.TargetName="OverlayGrid" Storyboard.TargetProperty="(Grid.Opacity)" From="0" To="1" Duration="0:0:1">
                <DoubleAnimation.EasingFunction>
                    <PowerEase Power="8" />
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
        </Storyboard>

        <Storyboard x:Key="ShowHintStoryboard">
            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HintStackPanel" Storyboard.TargetProperty="Visibility" Duration="0:0:0" >
                <DiscreteObjectKeyFrame Value="{x:Static Visibility.Visible}" KeyTime="0:0:0"/>
            </ObjectAnimationUsingKeyFrames>

            <DoubleAnimation Storyboard.TargetName="HintStackPanel" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:1.5">
                <DoubleAnimation.EasingFunction>
                    <PowerEase Power="8" />
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>

            <DoubleAnimation Storyboard.TargetName="HintStackPanel" Storyboard.TargetProperty="Opacity" From="{Binding ElementName=HintStackPanel,Path=Opacity}" To="0" BeginTime="0:0:7" Duration="0:0:3">
                <DoubleAnimation.EasingFunction>
                    <PowerEase Power="8" />
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>

            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HintStackPanel" Storyboard.TargetProperty="Visibility" BeginTime="0:0:7" Duration="0:0:3">
                <DiscreteObjectKeyFrame Value="{x:Static Visibility.Collapsed}" KeyTime="0:0:3"/>
            </ObjectAnimationUsingKeyFrames>
        </Storyboard>

        <Storyboard x:Key="ShowPermanentHintStoryboard">
            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HintStackPanel" Storyboard.TargetProperty="Visibility" Duration="0:0:0" >
                <DiscreteObjectKeyFrame Value="{x:Static Visibility.Visible}" KeyTime="0:0:0"/>
            </ObjectAnimationUsingKeyFrames>

            <DoubleAnimation Storyboard.TargetName="HintStackPanel" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:1.5">
                <DoubleAnimation.EasingFunction>
                    <PowerEase Power="8" />
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
        </Storyboard>

        <Storyboard x:Key="HideHintStoryboard">
            <DoubleAnimation Storyboard.TargetName="HintStackPanel" Storyboard.TargetProperty="(Grid.Opacity)" From="{Binding ElementName=HintStackPanel,Path=Opacity}" To="0" Duration="0:0:1">
                <DoubleAnimation.EasingFunction>
                    <PowerEase Power="8" />
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>

            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HintStackPanel" Storyboard.TargetProperty="Visibility" Duration="0:0:1">
                <DiscreteObjectKeyFrame Value="{x:Static Visibility.Collapsed}" KeyTime="0:0:1"/>
            </ObjectAnimationUsingKeyFrames>
        </Storyboard>

        <CollectionViewSource x:Key="MyFonts" x:Shared="False" 
                              Source="{Binding Source={x:Static Fonts.SystemFontFamilies}, Converter={StaticResource FontToSupportedGliphConverter}}">
            <CollectionViewSource.SortDescriptions>
                <cm:SortDescription PropertyName="Source"/>
            </CollectionViewSource.SortDescriptions>
        </CollectionViewSource>

        <DataTemplate x:Key="FontTemplate">
            <!--x:Shared="False"-->
            <VirtualizingStackPanel IsVirtualizing="True" VirtualizationMode="Recycling" ScrollViewer.IsDeferredScrollingEnabled="True">
                <TextBlock FontFamily="{Binding .}" FontSize="16" Text="{Binding .}" ToolTip="{Binding Path=.Source}"/>
            </VirtualizingStackPanel>
        </DataTemplate>
    </Window.Resources>

    <Window.CommandBindings>
        <CommandBinding Command="{StaticResource Command.NewRecording}" CanExecute="NewRecording_CanExecute" Executed="NewRecording_Executed"/>
        <CommandBinding Command="{StaticResource Command.NewWebcamRecording}" CanExecute="NewRecording_CanExecute" Executed="NewWebcamRecording_Executed"/>
        <CommandBinding Command="{StaticResource Command.NewBoardRecording}" CanExecute="NewRecording_CanExecute" Executed="NewBoardRecording_Executed"/>
        <CommandBinding Command="{StaticResource Command.NewAnimation}" CanExecute="NewProject_CanExecute" Executed="NewProject_Executed"/>

        <!--Insert-->
        <CommandBinding Command="{StaticResource Command.InsertRecording}" CanExecute="Insert_CanExecute" Executed="InsertRecording_Executed"/>
        <CommandBinding Command="{StaticResource Command.InsertWebcamRecording}" CanExecute="Insert_CanExecute" Executed="InsertWebcamRecording_Executed"/>
        <CommandBinding Command="{StaticResource Command.InsertBoardRecording}" CanExecute="Insert_CanExecute" Executed="InsertBoardRecording_Executed"/>
        <CommandBinding Command="{StaticResource Command.InsertFromMedia}" CanExecute="InsertFromMedia_CanExecute" Executed="InsertFromMedia_Executed"/>

        <!--File-->
        <CommandBinding Command="{StaticResource Command.SaveAs}" CanExecute="File_CanExecute" Executed="SaveAs_Executed"/>
        <CommandBinding Command="{StaticResource Command.Load}" CanExecute="NewProject_CanExecute" Executed="Load_Executed"/>
        <CommandBinding Command="{StaticResource Command.LoadRecent}" CanExecute="NewProject_CanExecute" Executed="LoadRecent_Executed"/>
        <CommandBinding Command="{StaticResource Command.DiscardProject}" CanExecute="File_CanExecute" Executed="DiscardProject_Executed"/>

        <!--Action Stack-->
        <CommandBinding Command="{StaticResource Command.Undo}" CanExecute="Undo_CanExecute" Executed="Undo_Executed"/>
        <CommandBinding Command="{StaticResource Command.Reset}" CanExecute="Reset_CanExecute" Executed="Reset_Executed"/>
        <CommandBinding Command="{StaticResource Command.Redo}" CanExecute="Redo_CanExecute" Executed="Redo_Executed"/>

        <!--Clipboard-->
        <CommandBinding Command="{StaticResource Command.Cut}" CanExecute="ClipBoard_CanExecute" Executed="Cut_Executed"/>
        <CommandBinding Command="{StaticResource Command.Copy}" CanExecute="ClipBoard_CanExecute" Executed="Copy_Executed"/>
        <CommandBinding Command="{StaticResource Command.Paste}" CanExecute="Paste_CanExecute" Executed="Paste_Executed"/>
        <CommandBinding Command="{StaticResource Command.ExploreClipboard}" CanExecute="ClipBoardSelection_CanExecute" Executed="ExploreClipBoard_Executed"/>
        <CommandBinding Command="{StaticResource Command.RemoveClipboardEntry}" CanExecute="ClipBoardSelection_CanExecute" Executed="RemoveClipboard_Executed"/>

        <!--Zoom-->
        <CommandBinding Command="{StaticResource Command.Zoom100}" CanExecute="Zoom_CanExecute" Executed="Zoom100_Executed"/>
        <CommandBinding x:Name="SizeToContentCommand" Command="{StaticResource Command.SizeToContent}" CanExecute="Zoom_CanExecute" Executed="SizeToContent_Executed"/>
        <CommandBinding x:Name="FitImageCommand" Command="{StaticResource Command.FitImage}" CanExecute="Zoom_CanExecute" Executed="FitImage_Executed"/>

        <!--Select-->
        <CommandBinding Command="{StaticResource Command.SelectAll}" CanExecute="Selection_CanExecute" Executed="SelectAll_Executed"/>
        <CommandBinding Command="{StaticResource Command.GoTo}" CanExecute="Selection_CanExecute" Executed="GoTo_Executed"/>
        <CommandBinding Command="{StaticResource Command.InverseSelection}" CanExecute="Selection_CanExecute" Executed="InverseSelection_Executed"/>
        <CommandBinding Command="{StaticResource Command.Unselect}" CanExecute="Image_CanExecute" Executed="DeselectAll_Executed"/>

        <!--Playback-->
        <CommandBinding Command="{StaticResource Command.FirstFrame}" CanExecute="Playback_CanExecute" Executed="FirstFrame_Executed"/>
        <CommandBinding Command="{StaticResource Command.PreviousFrame}" CanExecute="Playback_CanExecute" Executed="PreviousFrame_Executed"/>
        <CommandBinding Command="{StaticResource Command.Play}" CanExecute="Playback_CanExecute" Executed="Play_Executed"/>
        <CommandBinding Command="{StaticResource Command.NextFrame}" CanExecute="Playback_CanExecute" Executed="NextFrame_Executed"/>
        <CommandBinding Command="{StaticResource Command.LastFrame}" CanExecute="Playback_CanExecute" Executed="LastFrame_Executed"/>

        <!--Frames-->
        <CommandBinding Command="{StaticResource Command.Delete}" CanExecute="Delete_CanExecute" Executed="Delete_Executed"/>
        <CommandBinding Command="{StaticResource Command.DeletePrevious}" CanExecute="DeletePrevious_CanExecute" Executed="DeletePrevious_Executed"/>
        <CommandBinding Command="{StaticResource Command.DeleteNext}" CanExecute="DeleteNext_CanExecute" Executed="DeleteNext_Executed"/>
        <CommandBinding Command="{StaticResource Command.RemoveDuplicates}" CanExecute="RemoveDuplicates_CanExecute" Executed="RemoveDuplicates_Executed"/>
        <CommandBinding Command="{StaticResource Command.Reduce}" CanExecute="Reduce_CanExecute" Executed="Reduce_Executed"/>

        <!--Reordering-->
        <CommandBinding Command="{StaticResource Command.Reverse}" CanExecute="Reordering_CanExecute" Executed="Reverse_Executed"/>
        <CommandBinding Command="{StaticResource Command.Yoyo}" CanExecute="Reordering_CanExecute" Executed="Yoyo_Executed"/>
        <CommandBinding Command="{StaticResource Command.MoveLeft}" CanExecute="Reordering_CanExecute" Executed="MoveLeft_Executed"/>
        <CommandBinding Command="{StaticResource Command.MoveRight}" CanExecute="Reordering_CanExecute" Executed="MoveRight_Executed"/>

        <!--Delay (Duration)-->
        <CommandBinding Command="{StaticResource Command.OverrideDelay}" CanExecute="Image_CanExecute" Executed="OverrideDelay_Executed"/>
        <CommandBinding Command="{StaticResource Command.IncreaseDecreaseDelay}" CanExecute="Image_CanExecute" Executed="IncreaseDecreaseDelay_Executed"/>
        <CommandBinding Command="{StaticResource Command.ScaleDelay}" CanExecute="Image_CanExecute" Executed="ScaleDelay_Executed"/>

        <!--Image-->
        <CommandBinding Command="{StaticResource Command.Resize}" CanExecute="Image_CanExecute" Executed="Resize_Executed"/>
        <CommandBinding Command="{StaticResource Command.Crop}" CanExecute="Image_CanExecute" Executed="Crop_Executed"/>
        <CommandBinding Command="{StaticResource Command.FlipRotate}" CanExecute="Image_CanExecute" Executed="FlipRotate_Executed"/>

        <CommandBinding Command="{StaticResource Command.Caption}" CanExecute="Image_CanExecute" Executed="Caption_Executed"/>
        <CommandBinding Command="{StaticResource Command.FreeText}" CanExecute="Image_CanExecute" Executed="FreeText_Executed"/>
        <CommandBinding Command="{StaticResource Command.TitleFrame}" CanExecute="Image_CanExecute" Executed="TitleFrame_Executed"/>
        <CommandBinding Command="{StaticResource Command.KeyStrokes}" CanExecute="Image_CanExecute" Executed="KeyStrokes_Executed"/>

        <CommandBinding Command="{StaticResource Command.FreeDrawing}" CanExecute="Image_CanExecute" Executed="FreeDrawing_Executed"/>
        <CommandBinding Command="{StaticResource Command.Shapes}" CanExecute="Image_CanExecute" Executed="Shapes_Executed"/>
        <CommandBinding Command="{StaticResource Command.MouseClicks}" CanExecute="Image_CanExecute" Executed="MouseClicks_Executed"/>
        <CommandBinding Command="{StaticResource Command.Watermark}" CanExecute="Image_CanExecute" Executed="Watermark_Executed"/>
        <CommandBinding Command="{StaticResource Command.Border}" CanExecute="Image_CanExecute" Executed="Border_Executed"/>
        <CommandBinding Command="{StaticResource Command.Shadow}" CanExecute="Image_CanExecute" Executed="Shadow_Executed"/>
        <CommandBinding Command="{StaticResource Command.Obfuscate}" CanExecute="Image_CanExecute" Executed="Obfuscate_Executed"/>
        <CommandBinding Command="{StaticResource Command.Cinemagraph}" CanExecute="Image_CanExecute" Executed="Cinemagraph_Executed"/>
        <CommandBinding Command="{StaticResource Command.Progress}" CanExecute="Image_CanExecute" Executed="Progress_Executed"/>

        <!--Transitions-->
        <CommandBinding Command="{StaticResource Command.Fade}" CanExecute="Transition_CanExecute" Executed="Fade_Executed"/>
        <CommandBinding Command="{StaticResource Command.Slide}" CanExecute="Transition_CanExecute" Executed="Slide_Executed"/>

        <!--Apply and Cancel-->
        <CommandBinding x:Name="OkCommandBinding2" Command="{StaticResource Command.Ok}" CanExecute="PanelAction_CanExecute" Executed="Ok_Executed"/>
        <CommandBinding x:Name="CancelCommandBinding" Command="{StaticResource Command.Cancel}" CanExecute="PanelAction_CanExecute" Executed="Cancel_Executed"/>

        <!--Frame list-->
        <CommandBinding Command="{StaticResource Command.OpenImage}" CanExecute="ListFramesSelection_CanExecute" Executed="OpenImage_Executed"/>
        <CommandBinding Command="{StaticResource Command.ExploreFolder}" CanExecute="ListFramesSelection_CanExecute" Executed="ExploreFolder_Executed"/>
    </Window.CommandBindings>

    <Window.TaskbarItemInfo>
        <TaskbarItemInfo Description="{DynamicResource S.Editor.Title}">
            <!--<TaskbarItemInfo.ThumbButtonInfos>
                <ThumbButtonInfoCollection>
                    <ThumbButtonInfo x:Name="NewRecordingThumbInfo" Command="u:Commands.NewRecording" DismissWhenClicked="True" 
                                     Description="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureTextConverter}}" 
                                     CommandTarget="{Binding ElementName=NewRecordingButton}">
                        <ThumbButtonInfo.ImageSource>
                            <DrawingImage>
                                <DrawingImage.Drawing>
                                    <GeometryDrawing>
                                        <GeometryDrawing.Geometry>
                                            <RectangleGeometry Rect="0,0,20,20"/>
                                        </GeometryDrawing.Geometry>
                                        <GeometryDrawing.Brush>
                                            <VisualBrush Visual="{StaticResource Vector.Record.New}" Stretch="Uniform"/>
                                        </GeometryDrawing.Brush>
                                    </GeometryDrawing>
                                </DrawingImage.Drawing>
                            </DrawingImage>
                        </ThumbButtonInfo.ImageSource>
                    </ThumbButtonInfo>

                    <ThumbButtonInfo x:Name="NewWebcamRecordingThumbInfo" Command="u:Commands.NewWebcamRecording" DismissWhenClicked="True" 
                                     Description="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureTextConverter}}" 
                                     CommandTarget="{Binding ElementName=NewWebcamRecordingButton}">
                        <ThumbButtonInfo.ImageSource>
                            <DrawingImage>
                                <DrawingImage.Drawing>
                                    <GeometryDrawing>
                                        <GeometryDrawing.Geometry>
                                            <RectangleGeometry Rect="0,0,20,20"/>
                                        </GeometryDrawing.Geometry>
                                        <GeometryDrawing.Brush>
                                            <VisualBrush Visual="{StaticResource Vector.Camera.New}" Stretch="Uniform"/>
                                        </GeometryDrawing.Brush>
                                    </GeometryDrawing>
                                </DrawingImage.Drawing>
                            </DrawingImage>
                        </ThumbButtonInfo.ImageSource>
                    </ThumbButtonInfo>

                    <ThumbButtonInfo x:Name="NewBoardRecordingThumbInfo" Command="u:Commands.NewBoardRecording" DismissWhenClicked="True" 
                                     Description="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureTextConverter}}" 
                                     CommandTarget="{Binding ElementName=NewBoardRecordingButton}">
                        <ThumbButtonInfo.ImageSource>
                            <DrawingImage>
                                <DrawingImage.Drawing>
                                    <GeometryDrawing>
                                        <GeometryDrawing.Geometry>
                                            <RectangleGeometry Rect="0,0,20,20"/>
                                        </GeometryDrawing.Geometry>
                                        <GeometryDrawing.Brush>
                                            <VisualBrush Visual="{StaticResource Vector.Board.New}" Stretch="Uniform"/>
                                        </GeometryDrawing.Brush>
                                    </GeometryDrawing>
                                </DrawingImage.Drawing>
                            </DrawingImage>
                        </ThumbButtonInfo.ImageSource>
                    </ThumbButtonInfo>

                    <ThumbButtonInfo x:Name="NewFromMediaProjectThumbInfo" Command="u:Commands.NewFromMediaProject" DismissWhenClicked="True" 
                                     Description="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureTextConverter}}" 
                                     CommandTarget="{Binding ElementName=OpenMediaProjectButton}">
                        <ThumbButtonInfo.ImageSource>
                            <DrawingImage>
                                <DrawingImage.Drawing>
                                    <GeometryDrawing>
                                        <GeometryDrawing.Geometry>
                                            <RectangleGeometry Rect="0,0,20,20"/>
                                        </GeometryDrawing.Geometry>
                                        <GeometryDrawing.Brush>
                                            <VisualBrush Visual="{StaticResource Vector.Open}" Stretch="Uniform"/>
                                        </GeometryDrawing.Brush>
                                    </GeometryDrawing>
                                </DrawingImage.Drawing>
                            </DrawingImage>
                        </ThumbButtonInfo.ImageSource>
                    </ThumbButtonInfo>

                    <ThumbButtonInfo Visibility="Hidden"/>

                    <ThumbButtonInfo x:Name="DiscardThumbInfo" Command="u:Commands.DiscardProject" DismissWhenClicked="True" 
                                     Description="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureTextConverter}}" 
                                     CommandTarget="{Binding ElementName=DiscardProjectButton}">
                        <ThumbButtonInfo.ImageSource>
                            <DrawingImage>
                                <DrawingImage.Drawing>
                                    <GeometryDrawing>
                                        <GeometryDrawing.Geometry>
                                            <RectangleGeometry Rect="0,0,20,20"/>
                                        </GeometryDrawing.Geometry>
                                        <GeometryDrawing.Brush>
                                            <VisualBrush Visual="{StaticResource Vector.Remove}" Stretch="Uniform"/>
                                        </GeometryDrawing.Brush>
                                    </GeometryDrawing>
                                </DrawingImage.Drawing>
                            </DrawingImage>
                        </ThumbButtonInfo.ImageSource>
                    </ThumbButtonInfo>
                </ThumbButtonInfoCollection>
            </TaskbarItemInfo.ThumbButtonInfos>-->
        </TaskbarItemInfo>
    </Window.TaskbarItemInfo>

    <Grid x:Name="MainGrid" DataContext="{Binding ElementName=FrameListView, Path=SelectedItem}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="20"/>
        </Grid.RowDefinitions>

        <n:HideableTabControl Grid.Row="0" x:Name="RibbonTabControl" Effect="{StaticResource Shadow.Border.Tiny}" FontSize="13" IsTabStop="False" Focusable="False"
                              OptionsCommand="{Binding Source={StaticResource AppViewModel}, Path=OpenOptions}" FeedbackCommand="{Binding Source={StaticResource AppViewModel}, Path=OpenFeedback}"
                              TroubleshootCommand="{Binding Source={StaticResource AppViewModel}, Path=OpenTroubleshoot}" HelpCommand="{Binding Source={StaticResource AppViewModel}, Path=OpenHelp}">
            
            <n:AwareTabItem Header="{DynamicResource S.Editor.File}" Icon="{StaticResource Vector.Save}">
                <Grid Height="94" Margin="2" Background="{DynamicResource Panel.Background.Level2}" Effect="{StaticResource Shadow.Invariant}">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="7"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="7"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="7"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>

                    <Grid Grid.Column="0" Margin="0,1,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition Height="16"/>
                        </Grid.RowDefinitions>

                        <Label Grid.Column="0" Grid.ColumnSpan="4" Grid.Row="1" Content="{DynamicResource S.Editor.File.New}" 
							   HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Padding="0" 
							   FontSize="12" Foreground="{DynamicResource Element.Foreground.Gray112}"/>

                        <n:ExtendedButton Grid.Column="0" Grid.Row="0" x:Name="NewRecordingButton" Text="{DynamicResource S.Editor.File.New.Recording}" Icon="{StaticResource Vector.Record.New}" 
							              MinWidth="55" ContentHeight="28" ContentWidth="28" Command="{StaticResource Command.NewRecording}" Style="{StaticResource Style.Button.Vertical}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <n:ExtendedButton Grid.Column="1" Grid.Row="0" x:Name="NewWebcamRecordingButton" Text="{DynamicResource S.Editor.File.New.Webcam}" Icon="{StaticResource Vector.Camera.New}" 
							              MinWidth="55" ContentHeight="28" ContentWidth="28" Command="{StaticResource Command.NewWebcamRecording}" Style="{StaticResource Style.Button.Vertical}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <n:ExtendedButton Grid.Column="2" Grid.Row="0" x:Name="NewBoardRecordingButton" Text="{DynamicResource S.Editor.File.New.Board}" Icon="{StaticResource Vector.Board.New}" 
							              MinWidth="55" ContentHeight="28" ContentWidth="28" Command="{StaticResource Command.NewBoardRecording}" Style="{StaticResource Style.Button.Vertical}" 
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <n:ExtendedButton Grid.Column="3" Grid.Row="0" x:Name="NewAnimationButton" Text="{DynamicResource S.Editor.File.Blank}" Icon="{StaticResource Vector.File.New}" 
							              MinWidth="55" ContentHeight="28" ContentWidth="28" Command="{StaticResource Command.NewAnimation}" Style="{StaticResource Style.Button.Vertical}" 
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>
                    </Grid>

                    <Separator Grid.Column="1" Grid.Row="0" Width="1" Height="Auto" HorizontalAlignment="Left" Margin="3,2"/>

                    <Grid Grid.Column="2" Margin="0,1,0,0" IsEnabled="{Binding FilledList, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:Editor}}}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition Height="16"/>
                        </Grid.RowDefinitions>

                        <Label Grid.Column="0" Grid.ColumnSpan="4" Grid.Row="1" Content="{DynamicResource S.Editor.File.Insert}" 
							   HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Padding="0" 
							   FontSize="12" Foreground="{DynamicResource Element.Foreground.Gray112}"/>

                        <n:ExtendedButton Grid.Column="0" Grid.Row="0" x:Name="InsertRecordingButton" Text="{DynamicResource S.Editor.File.Insert.Recording}" Icon="{StaticResource Vector.Record.Add}" 
                                          MinWidth="55" ContentHeight="28" ContentWidth="28" Command="{StaticResource Command.InsertRecording}" Style="{StaticResource Style.Button.Vertical}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <n:ExtendedButton Grid.Column="1" Grid.Row="0" x:Name="InsertWebcamRecordingButton" Text="{DynamicResource S.Editor.File.Insert.Webcam}" Icon="{StaticResource Vector.Camera.Add}" 
                                          MinWidth="55" ContentHeight="28" ContentWidth="28" Command="{StaticResource Command.InsertWebcamRecording}" Style="{StaticResource Style.Button.Vertical}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <n:ExtendedButton Grid.Column="2" Grid.Row="0" x:Name="InsertBoardRecordingButton" Text="{DynamicResource S.Editor.File.Insert.Board}" Icon="{StaticResource Vector.Board.Add}" 
                                          MinWidth="55" ContentHeight="28" ContentWidth="28" Command="{StaticResource Command.InsertBoardRecording}" Style="{StaticResource Style.Button.Vertical}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <n:ExtendedButton Grid.Column="3" Grid.Row="0" x:Name="InsertImageButton" Text="{DynamicResource S.Editor.File.Insert.Media}" Icon="{StaticResource Vector.Open}" 
                                          MinWidth="55" ContentHeight="28" ContentWidth="28" Command="{StaticResource Command.InsertFromMedia}" Style="{StaticResource Style.Button.Vertical}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>
                    </Grid>

                    <Separator Grid.Column="3" Grid.Row="0" Width="1" Height="Auto" HorizontalAlignment="Left" Margin="3,2"/>

                    <Grid Grid.Column="4" Margin="0,1,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition Height="16"/>
                        </Grid.RowDefinitions>

                        <Label Grid.Column="0" Grid.ColumnSpan="4" Grid.Row="1" Content="{DynamicResource S.Editor.File}" 
							   HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Padding="0" 
							   FontSize="12" Foreground="{DynamicResource Element.Foreground.Gray112}"/>

                        <n:ExtendedButton Grid.Column="0" Grid.Row="0" x:Name="SaveButton" Text="{DynamicResource S.Editor.File.Save}" Icon="{StaticResource Vector.Save}" 
                                          MinWidth="55" ContentHeight="28" ContentWidth="28" Command="{StaticResource Command.SaveAs}" Style="{StaticResource Style.Button.Vertical}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"
                                          IsEnabled="{Binding FilledList, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:Editor}}}"/>

                        <n:ExtendedButton Grid.Column="1" Grid.Row="0" x:Name="LoadButton" Text="{DynamicResource S.Editor.File.Load}" Icon="{StaticResource Vector.Open}" 
                                          MinWidth="55" ContentHeight="28" ContentWidth="28" Command="{StaticResource Command.Load}" Style="{StaticResource Style.Button.Vertical}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <n:ExtendedButton Grid.Column="2" Grid.Row="0" x:Name="RecentButton" Text="{DynamicResource S.Editor.File.LoadRecent}" Icon="{StaticResource Vector.Project}" 
                                          MinWidth="55" ContentHeight="28" ContentWidth="28" Command="{StaticResource Command.LoadRecent}" Style="{StaticResource Style.Button.Vertical}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <n:ExtendedButton Grid.Column="3" Grid.Row="0" x:Name="DiscardProjectButton" Text="{DynamicResource S.Editor.File.Discard}" Icon="{StaticResource Vector.Remove}" 
                                          MinWidth="55" ContentHeight="28" ContentWidth="28" Command="{StaticResource Command.DiscardProject}" Style="{StaticResource Style.Button.Vertical}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"
                                          IsEnabled="{Binding FilledList, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:Editor}}}"/>
                    </Grid>

                    <Separator Grid.Column="5" Grid.Row="0" Width="1" Height="Auto" HorizontalAlignment="Left" Margin="3,2"/>
                </Grid>
            </n:AwareTabItem>

            <n:AwareTabItem Header="{DynamicResource S.Editor.Home}" Icon="{StaticResource Vector.Editor}" IsSelected="True">
                <Grid Height="94" Margin="2" Background="{DynamicResource Panel.Background.Level2}">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="7"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="7"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="7"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="7"/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>

                    <!--Action Stack-->
                    <Grid Grid.Column="0" Margin="0,1,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition Height="16"/>
                        </Grid.RowDefinitions>

                        <Label Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" Content="{DynamicResource S.Editor.Home.ActionStack}" 
						       HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Padding="0" 
						       FontSize="12" Foreground="{DynamicResource Element.Foreground.Gray112}"/>

                        <n:ExtendedButton x:Name="UndoButton" Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Editor.Home.Undo}" Icon="{StaticResource Vector.Undo}"
                                          MinWidth="55" ContentHeight="28" ContentWidth="28" Style="{StaticResource Style.Button.Vertical}" Command="{StaticResource Command.Undo}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <Grid Grid.Row="0" Grid.Column="1">
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>

                            <n:ExtendedButton x:Name="ResetButton" Grid.Row="0" Text="{DynamicResource S.Editor.Home.Reset}" Icon="{StaticResource Vector.Repeat}"
                                              Padding="2" MinWidth="60" ContentWidth="25" ContentHeight="25" Style="{StaticResource Style.Button.Horizontal}" Command="{StaticResource Command.Reset}"
                                              ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                              ToolTipService.Placement="Top" ToolTipService.HorizontalOffset="-5"/>

                            <n:ExtendedButton x:Name="RedoButton" Grid.Row="1" Text="{DynamicResource S.Editor.Home.Redo}" Icon="{StaticResource Vector.Redo}"
                                              Padding="2" MinWidth="60" ContentWidth="25" ContentHeight="25" Style="{StaticResource Style.Button.Horizontal}" Command="{StaticResource Command.Redo}"
                                              ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                              ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>
                        </Grid>
                    </Grid>

                    <Separator Grid.Column="1" Grid.Row="0" Width="1" Height="Auto" HorizontalAlignment="Left" Margin="3,2"/>

                    <!--Clipboard-->
                    <Grid Grid.Column="2" Margin="0,1,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition Height="16"/>
                        </Grid.RowDefinitions>

                        <Grid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition />
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>

                            <Label Grid.Column="0" Content="{DynamicResource S.Editor.Home.Clipboard}" 
						           HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Padding="0" 
						           FontSize="12" Foreground="{DynamicResource Element.Foreground.Gray112}"/>

                            <n:ExtendedButton Grid.Column="1" x:Name="ShowClipboardButton" Icon="{StaticResource Vector.Launcher}"
						                      Margin="0,0,-2,-2" MinWidth="10" Padding="5,0" ContentHeight="8" ContentWidth="8" Style="{StaticResource Style.Button.NoText}" 
                                              ToolTip="{DynamicResource S.Editor.Home.Clipboard.Show}" ToolTipService.Placement="Bottom" Click="ShowClipboardButton_Click" />
                        </Grid>

                        <n:ExtendedButton Grid.Row="0" Grid.Column="0" x:Name="PasteButton" Text="{DynamicResource S.Editor.Home.Paste}" Icon="{StaticResource Vector.Paste}"
                                          MinWidth="55" ContentHeight="28" ContentWidth="28" Style="{StaticResource Style.Button.Vertical}" Command="{StaticResource Command.Paste}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <Grid Grid.Row="0" Grid.Column="1">
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>

                            <n:ExtendedButton x:Name="CopyButton" Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Editor.Home.Copy}" Icon="{StaticResource Vector.Copy}"
						                      Padding="2" MinWidth="60" ContentWidth="25" ContentHeight="25" Style="{StaticResource Style.Button.Horizontal}" Command="{StaticResource Command.Copy}"
                                              ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                              ToolTipService.Placement="Top" ToolTipService.HorizontalOffset="-5"/>

                            <n:ExtendedButton x:Name="CutButton" Grid.Row="1" Text="{DynamicResource S.Editor.Home.Cut}" Icon="{StaticResource Vector.Cut}"
						                      Padding="2" MinWidth="60" ContentWidth="25" ContentHeight="25" Style="{StaticResource Style.Button.Horizontal}" Command="{StaticResource Command.Cut}"
                                              ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                              ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>
                        </Grid>
                    </Grid>

                    <Separator Grid.Column="3" Grid.Row="0" Width="1" Height="Auto" HorizontalAlignment="Left" Margin="3,2"/>

                    <!--Zoom-->
                    <Grid Grid.Column="4" Margin="0,1,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition Height="16"/>
                        </Grid.RowDefinitions>

                        <Label Grid.Column="0" Grid.ColumnSpan="3" Grid.Row="1" Content="{DynamicResource S.Editor.Home.Zoom}" 
							   HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Padding="0" 
							   FontSize="12" Foreground="{DynamicResource Element.Foreground.Gray112}"/>

                        <n:ExtendedButton Grid.Column="0" Grid.Row="0" x:Name="Zoom100Button" Text="100%" Icon="{StaticResource Vector.Fit}" 
                                          MinWidth="55" ContentHeight="28" ContentWidth="28" Style="{StaticResource Style.Button.Vertical}" Command="{StaticResource Command.Zoom100}" 
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <n:ExtendedButton Grid.Column="1" Grid.Row="0" x:Name="FitOnContentButton" Text="{DynamicResource S.Editor.Home.SizeToContent}" Icon="{StaticResource Vector.SizeToContent}" 
                                          MinWidth="55" ContentHeight="28" ContentWidth="28" Style="{StaticResource Style.Button.Vertical}" Command="{StaticResource Command.SizeToContent}" 
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <Grid Grid.Column="2" Grid.Row="0">
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>

                            <StackPanel Grid.Row="0" Orientation="Horizontal" Margin="0,5" IsEnabled="{Binding ElementName=Zoom100Button, Path=IsEnabled}">
                                <Grid Background="{StaticResource Vector.Zoom}" Width="22" Height="22" Opacity="{DynamicResource Element.Opacity}"/>
                                <n:IntegerUpDown x:Name="ZoomNumericUpDown" Minimum="5" Maximum="500" Margin="5,0,0,0" MinWidth="60"
                                                 Value="{Binding Zoom, Converter={StaticResource IntToDecimalConverter}, ElementName=ZoomBoxControl, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                                <TextBlock Text="%" VerticalAlignment="Center" Padding="3,0" Foreground="{DynamicResource Element.Foreground}"/>
                            </StackPanel>

                            <n:ExtendedButton Grid.Column="0" Grid.Row="1" x:Name="FitButton" Text="{DynamicResource S.Editor.Home.FitImage}" Icon="{StaticResource Vector.PictureFit}" 
							                  Margin="0" Padding="2" MinWidth="60" ContentWidth="30" ContentHeight="25" VerticalContentAlignment="Center"
							                  Style="{StaticResource Style.Button.Horizontal}" Command="{StaticResource Command.FitImage}" 
                                              ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                              ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>
                        </Grid>
                    </Grid>

                    <Separator Grid.Column="5" Grid.Row="0" Width="1" Height="Auto" HorizontalAlignment="Left" Margin="3,2"/>

                    <!--Select-->
                    <Grid Grid.Column="6" Margin="0,1,0,0">
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition Height="16"/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>

                        <Label Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3" x:Name="SelectLabel" Content="{DynamicResource S.Editor.Home.Select}" 
						       HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Padding="0" 
						       FontSize="12" Foreground="{DynamicResource Element.Foreground.Gray112}"/>

                        <n:ExtendedButton Grid.Row="0" Grid.Column="0" x:Name="SelectAllButton" Text="{DynamicResource S.Editor.Home.SelectAll}" Icon="{StaticResource Vector.Cursor}"
                                          MinWidth="55" ContentHeight="28" ContentWidth="28" Style="{StaticResource Style.Button.Vertical}" Command="{StaticResource Command.SelectAll}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <n:ExtendedButton Grid.Row="0" Grid.Column="1" x:Name="GoToButton" Text="{DynamicResource S.Editor.Home.GoTo}" Icon="{StaticResource Vector.Forward}"
                                          MinWidth="55" ContentHeight="28" ContentWidth="28" Style="{StaticResource Style.Button.Vertical}" Command="{StaticResource Command.GoTo}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <Grid Grid.Row="0" Grid.Column="2" Margin="0,1,0,0">
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>

                            <n:ExtendedButton x:Name="InverseSelectionButton" Grid.Row="0" Text="{DynamicResource S.Editor.Home.Inverse}" Icon="{StaticResource Vector.InverseSelection}"
                                              Padding="2" MinWidth="60" ContentWidth="25" ContentHeight="25" Style="{StaticResource Style.Button.Horizontal}" Command="{StaticResource Command.InverseSelection}"
                                              ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                              ToolTipService.Placement="Top" ToolTipService.HorizontalOffset="-5"/>

                            <n:ExtendedButton x:Name="DeselectButton" Grid.Row="1" Text="{DynamicResource S.Editor.Home.Deselect}" Icon="{StaticResource Vector.Unselect}"
                                              Padding="2" MinWidth="60" ContentWidth="25" ContentHeight="25" Style="{StaticResource Style.Button.Horizontal}" Command="{StaticResource Command.Unselect}"
                                              ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                              ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>
                        </Grid>
                    </Grid>

                    <Separator Grid.Column="7" Grid.Row="0" Width="1" Height="Auto" HorizontalAlignment="Left" Margin="3,2"/>
                </Grid>
            </n:AwareTabItem>

            <n:AwareTabItem Header="{DynamicResource S.Editor.Playback}" Icon="{StaticResource Vector.Play}">
                <Grid Height="94" Margin="2" Background="{DynamicResource Panel.Background.Level2}" Effect="{StaticResource Shadow.Invariant}">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="7"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="7"/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>

                    <Grid Grid.Column="0" Margin="0,1,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition Height="16"/>
                        </Grid.RowDefinitions>

                        <Label Grid.Column="0" Grid.ColumnSpan="5" Grid.Row="1" Content="{DynamicResource S.Editor.Playback.Playback}" 
							   HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Padding="0" 
							   FontSize="12" Foreground="{DynamicResource Element.Foreground.Gray112}"/>

                        <n:ExtendedButton Grid.Column="0" Grid.Row="0" x:Name="FirstButton" Text="{DynamicResource S.Editor.Playback.First}" Icon="{StaticResource Vector.First.Green}" 
                                          MinWidth="55" ContentHeight="28" ContentWidth="38" Command="{StaticResource Command.FirstFrame}" Style="{StaticResource Style.Button.Vertical}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <n:ExtendedRepeatButton Grid.Column="1" Grid.Row="0" x:Name="PreviousButton" Text="{DynamicResource S.Editor.Playback.Previous}" Icon="{StaticResource Vector.Previous.Green}" 
                                                ContentHeight="28" ContentWidth="28" Command="{StaticResource Command.PreviousFrame}" Style="{StaticResource Style.RepeatButton.Vertical}"
                                                ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}"
                                                ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <n:ExtendedButton Grid.Column="2" Grid.Row="0" x:Name="PlayButton" Text="{DynamicResource S.Editor.Playback.Play}" Icon="{StaticResource Vector.Play}" 
                                          MinWidth="55" ContentHeight="28" ContentWidth="28" Command="{StaticResource Command.Play}" Style="{StaticResource Style.Button.Vertical}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <n:ExtendedRepeatButton Grid.Column="3" Grid.Row="0" x:Name="NextButton" Text="{DynamicResource S.Editor.Playback.Next}" Icon="{StaticResource Vector.Next.Green}" 
                                                ContentHeight="28" ContentWidth="28" Command="{StaticResource Command.NextFrame}" Style="{StaticResource Style.RepeatButton.Vertical}"
                                                ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                                ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <n:ExtendedButton Grid.Column="4" Grid.Row="0" x:Name="LastButton" Text="{DynamicResource S.Editor.Playback.Last}" Icon="{StaticResource Vector.Last.Green}" 
                                          MinWidth="55" ContentHeight="28" ContentWidth="38" Command="{StaticResource Command.LastFrame}" Style="{StaticResource Style.Button.Vertical}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>
                    </Grid>

                    <Separator Grid.Column="1" Grid.Row="0" Width="1" Height="Auto" Margin="3,2"/>

                    <Grid Grid.Column="2" Margin="0,1,0,0">
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition/>
                            <RowDefinition Height="16"/>
                        </Grid.RowDefinitions>

                        <Label Grid.Column="0" Grid.Row="2" Content="{DynamicResource S.Editor.PlaybackOptions.Header}" 
							   HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Padding="0" 
							   FontSize="12" Foreground="{DynamicResource Element.Foreground.Gray112}"/>

                        <n:ExtendedCheckBox Grid.Column="0" Grid.Row="0" x:Name="LoopedPlaybackCheckBox" Text="{DynamicResource S.Editor.PlaybackOptions.Loop}" 
                                            IsChecked="{Binding LoopedPlayback, Source={x:Static t:UserSettings.All}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                            Margin="5,3" ToolTip="{DynamicResource S.Editor.PlaybackOptions.Loop.Info}" ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <n:ExtendedCheckBox Grid.Column="0" Grid.Row="1" Text="{DynamicResource S.Options.Editor.General.DropFramesDuringPreviewIfBehind}"
                                            IsChecked="{Binding DropFramesDuringPreviewIfBehind, Source={x:Static t:UserSettings.All}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                             Margin="5,3" ToolTip="{DynamicResource S.Options.Editor.General.DropFramesDuringPreviewIfBehind.Tooltip}" ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>
                    </Grid>

                    <Separator Grid.Column="3" Grid.Row="0" Width="1" Height="Auto" Margin="3,2"/>
                </Grid>
            </n:AwareTabItem>

            <n:AwareTabItem Header="{DynamicResource S.Editor.Edit}" Icon="{StaticResource Vector.Pen}">
                <Grid Height="94" Margin="2" Background="{DynamicResource Panel.Background.Level2}">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="7"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="7"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="7"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="7"/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>

                    <Grid Grid.Column="0" Margin="0,1,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition Height="16"/>
                        </Grid.RowDefinitions>

                        <Label Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="4" Content="{DynamicResource S.Editor.Edit.Frames}" 
						       HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Padding="0" 
						       FontSize="12" Foreground="{DynamicResource Element.Foreground.Gray112}"/>

                        <n:ExtendedButton Grid.Row="0" Grid.Column="0" x:Name="DeleteButton" Text="{DynamicResource S.Editor.Edit.Delete}" Icon="{StaticResource Vector.RemoveImage}"
                                          MinWidth="55" ContentHeight="28" ContentWidth="28" Style="{StaticResource Style.Button.Vertical}" Command="{StaticResource Command.Delete}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <n:ExtendedButton Grid.Row="0" Grid.Column="1" x:Name="DeleteDuplicatesButton" Text="{DynamicResource S.Editor.Edit.Frames.Duplicates}" Icon="{StaticResource Vector.RemoveImage}"
                                          MinWidth="55" ContentHeight="28" ContentWidth="28" Style="{StaticResource Style.Button.Vertical}" Command="{StaticResource Command.RemoveDuplicates}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <n:ExtendedButton Grid.Row="0" Grid.Column="2" x:Name="ReduceButton" Text="{DynamicResource S.Editor.Edit.Frames.Reduce}" Icon="{StaticResource Vector.RemoveImage}"
                                          MinWidth="55" ContentHeight="28" ContentWidth="28" Style="{StaticResource Style.Button.Vertical}" Command="{StaticResource Command.Reduce}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <Grid Grid.Row="0" Grid.Column="3">
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>

                            <n:ExtendedButton x:Name="DeleteBeforeButton" Grid.Row="0" Text="{DynamicResource S.Editor.Edit.DeletePrevious}" Icon="{StaticResource Vector.Delete.Before}"
						                      Padding="3,3,3,0" MinWidth="60" ContentWidth="30" ContentHeight="25" Style="{StaticResource Style.Button.Horizontal}" Command="{StaticResource Command.DeletePrevious}"
                                              ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                              ToolTipService.Placement="Top" ToolTipService.HorizontalOffset="-5"/>

                            <n:ExtendedButton x:Name="DeleteAfterButton" Grid.Row="1" Text="{DynamicResource S.Editor.Edit.DeleteNext}" Icon="{StaticResource Vector.Delete.After}"
                                              Padding="3,3,3,0" MinWidth="60" ContentWidth="30" ContentHeight="25" Style="{StaticResource Style.Button.Horizontal}" Command="{StaticResource Command.DeleteNext}"
                                              ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                              ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>
                        </Grid>
                    </Grid>

                    <Separator Grid.Column="1" Grid.Row="0" Width="1" Height="Auto" HorizontalAlignment="Left" Margin="3,2"/>

                    <Grid Grid.Column="2" Margin="0,1,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition Height="16"/>
                        </Grid.RowDefinitions>

                        <Label Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Content="{DynamicResource S.Editor.Edit.Reordering}" 
						       HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Padding="0" 
						       FontSize="12" Foreground="{DynamicResource Element.Foreground.Gray112}"/>

                        <Grid Grid.Row="0" Grid.Column="0">
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>

                            <n:ExtendedButton x:Name="ReverseOrderButton" Grid.Row="0" Text="{DynamicResource S.Editor.Edit.Reverse}" Icon="{StaticResource Vector.Invert}"
						                      Padding="3,3,3,0" ContentWidth="30" ContentHeight="25" Style="{StaticResource Style.Button.Horizontal}" Command="{StaticResource Command.Reverse}"
                                              ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                              ToolTipService.Placement="Top" ToolTipService.HorizontalOffset="-5"/>

                            <n:ExtendedButton x:Name="YoyoOrderButton" Grid.Row="1" Text="{DynamicResource S.Editor.Edit.Yoyo}" Icon="{StaticResource Vector.Yoyo}"
						                      Padding="3,3,3,0" ContentWidth="30" ContentHeight="25" Style="{StaticResource Style.Button.Horizontal}" Command="{StaticResource Command.Yoyo}"
                                              ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                              ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>
                        </Grid>

                        <n:ExtendedButton x:Name="MoveLeftButton" Grid.Row="0" Grid.Column="1" Text="{DynamicResource S.Editor.Edit.MoveLeft}" Icon="{StaticResource Vector.MoveLeft}"
                                          MinWidth="55" ContentHeight="28" ContentWidth="32" Style="{StaticResource Style.Button.Vertical}" Command="{StaticResource Command.MoveLeft}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <n:ExtendedButton x:Name="MoveRightButton" Grid.Row="0" Grid.Column="2" Text="{DynamicResource S.Editor.Edit.MoveRight}" Icon="{StaticResource Vector.MoveRight}"
                                          MinWidth="55" ContentHeight="28" ContentWidth="32" Style="{StaticResource Style.Button.Vertical}" Command="{StaticResource Command.MoveRight}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>
                    </Grid>

                    <Separator Grid.Column="3" Grid.Row="0" Width="1" Height="Auto" HorizontalAlignment="Left" Margin="3,2"/>

                    <Grid Grid.Column="4" Margin="0,1,0,0">
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition Height="16"/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>

                        <Label Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Content="{DynamicResource S.Editor.Edit.Delay}" 
						       HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Padding="0" 
						       FontSize="12" Foreground="{DynamicResource Element.Foreground.Gray112}"/>

                        <n:ExtendedButton Grid.Column="0" Grid.Row="0" x:Name="OverrideDelayButton" Text="{DynamicResource S.Editor.Edit.Delay.Override}" Icon="{StaticResource Vector.OverrideDelay}" 
                                          MinWidth="55" ContentHeight="28" ContentWidth="28" Command="{StaticResource Command.OverrideDelay}" Style="{StaticResource Style.Button.Vertical}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <n:ExtendedButton Grid.Column="1" Grid.Row="0" x:Name="ChangeDelayButton" Text="{DynamicResource S.Editor.Edit.Delay.IncreaseDecrease}" Icon="{StaticResource Vector.IncreaseDecreaseDelay}" 
                                          MinWidth="55" ContentHeight="28" ContentWidth="28" Command="{StaticResource Command.IncreaseDecreaseDelay}" Style="{StaticResource Style.Button.Vertical}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <n:ExtendedButton Grid.Column="2" Grid.Row="0" x:Name="ScaleDelayButton" Text="{DynamicResource S.Editor.Edit.Delay.Scale}" Icon="{StaticResource Vector.ScaleDelay}" 
                                          MinWidth="55" ContentHeight="28" ContentWidth="28" Command="{StaticResource Command.ScaleDelay}" Style="{StaticResource Style.Button.Vertical}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>
                    </Grid>

                    <Separator Grid.Column="5" Grid.Row="0" Width="1" Height="Auto" HorizontalAlignment="Left" Margin="3,2"/>
                </Grid>
            </n:AwareTabItem>

            <n:AwareTabItem Header="{DynamicResource S.Editor.Image}" Icon="{StaticResource Vector.Image}">
                <Grid Height="94" Margin="2" Background="{DynamicResource Panel.Background.Level2}">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="7"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="7"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="7"/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>

                    <Grid Grid.Column="0" Margin="0,1,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition Height="16"/>
                        </Grid.RowDefinitions>

                        <Label Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" Content="{DynamicResource S.Editor.Image.SizePosition}" 
						       HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Padding="0" 
						       FontSize="12" Foreground="{DynamicResource Element.Foreground.Gray112}"/>

                        <n:ExtendedButton x:Name="ResizeButton" Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Editor.Image.Resize}" Icon="{StaticResource Vector.Resize}"
                                          MinWidth="55" ContentHeight="28" ContentWidth="28" Style="{StaticResource Style.Button.Vertical}" Command="{StaticResource Command.Resize}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <Grid Grid.Row="0" Grid.Column="1">
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>

                            <n:ExtendedButton x:Name="CropButton" Grid.Row="0" Text="{DynamicResource S.Editor.Image.Crop}" Icon="{StaticResource Vector.Crop}"
                                              Padding="2" MinWidth="60" ContentWidth="25" ContentHeight="25"  Style="{StaticResource Style.Button.Horizontal}" Command="{StaticResource Command.Crop}"
                                              ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                              ToolTipService.Placement="Top" ToolTipService.HorizontalOffset="-5"/>

                            <n:ExtendedButton x:Name="FlipRotateButton" Grid.Row="1" Text="{DynamicResource S.Editor.Image.FlipRotate}" Icon="{StaticResource Vector.FlipHorizontal}"
                                              Padding="2" MinWidth="60" ContentWidth="25" ContentHeight="25" Style="{StaticResource Style.Button.Horizontal}" Command="{StaticResource Command.FlipRotate}"
                                              ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                              ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>
                        </Grid>
                    </Grid>

                    <Separator Grid.Column="1" Grid.Row="0" Width="1" Height="Auto" Margin="3,2"/>

                    <Grid Grid.Column="2" Margin="0,1,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition Height="16"/>
                        </Grid.RowDefinitions>

                        <Label Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Content="{DynamicResource S.Editor.Image.Text}" 
						       HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Padding="0" 
						       FontSize="12" Foreground="{DynamicResource Element.Foreground.Gray112}"/>

                        <n:ExtendedButton x:Name="CaptionButton" Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Editor.Image.Caption}" Icon="{StaticResource Vector.Caption}"
                                          MinWidth="55" ContentHeight="28" ContentWidth="28" Command="{StaticResource Command.Caption}" Style="{StaticResource Style.Button.Vertical}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <n:ExtendedButton x:Name="KeypressButton" Grid.Row="0" Grid.Column="1" Text="{DynamicResource S.Editor.Image.KeyStrokes}" Icon="{StaticResource Vector.Keyboard}"
                                          MinWidth="55" ContentHeight="28" ContentWidth="32" Command="{StaticResource Command.KeyStrokes}" Style="{StaticResource Style.Button.Vertical}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <Grid Grid.Row="0" Grid.Column="2">
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>

                            <n:ExtendedButton x:Name="FreeTextButton" Grid.Row="0" Text="{DynamicResource S.Editor.Image.FreeText}" Icon="{StaticResource Vector.FreeText}"
                                              Padding="2" MinWidth="60" ContentWidth="25" ContentHeight="25" Command="{StaticResource Command.FreeText}" Style="{StaticResource Style.Button.Horizontal}"
                                              ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                              ToolTipService.Placement="Top" ToolTipService.HorizontalOffset="-5"/>

                            <n:ExtendedButton x:Name="TitleFrameButton" Grid.Row="1" Text="{DynamicResource S.Editor.Image.TitleFrame}" Icon="{StaticResource Vector.TitleFrame}"
                                              Padding="2" MinWidth="60" ContentWidth="25" ContentHeight="25" Command="{StaticResource Command.TitleFrame}" Style="{StaticResource Style.Button.Horizontal}"
                                              ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                              ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>
                        </Grid>
                    </Grid>

                    <Separator Grid.Column="3" Grid.Row="0" Width="1" Height="Auto" Margin="3,2"/>

                    <Grid Grid.Column="4" Margin="0,1,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition Height="16"/>
                        </Grid.RowDefinitions>

                        <Label Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="8" Content="{DynamicResource S.Editor.Image.Overlay}" 
						       HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Padding="0" 
						       FontSize="12" Foreground="{DynamicResource Element.Foreground.Gray112}"/>

                        <n:ExtendedButton x:Name="FreeDrawButton" Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Editor.Image.FreeDrawing}" Icon="{StaticResource Vector.FreeDrawing}"
                                          MinWidth="55" ContentHeight="28" ContentWidth="32" Command="{StaticResource Command.FreeDrawing}" Style="{StaticResource Style.Button.Vertical}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <n:ExtendedButton x:Name="ShapesButton" Grid.Row="0" Grid.Column="1" Text="{DynamicResource S.Editor.Image.Shape}" Icon="{StaticResource Vector.Ellipse}"
                                          MinWidth="55" ContentHeight="28" ContentWidth="32" Command="{StaticResource Command.Shapes}" Style="{StaticResource Style.Button.Vertical}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <n:ExtendedButton Grid.Row="0" Grid.Column="2" x:Name="ProgressButton" Text="{DynamicResource S.Editor.Image.Progress}" Icon="{StaticResource Vector.Progress}"
                                          MinWidth="55" ContentHeight="28" ContentWidth="32" Command="{StaticResource Command.Progress}" Style="{StaticResource Style.Button.Vertical}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <n:ExtendedButton Grid.Row="0" Grid.Column="3" Text="{DynamicResource S.Editor.Image.Clicks}" Icon="{StaticResource Vector.Cursor}"
                                          MinWidth="55" ContentHeight="28" ContentWidth="32" Command="{StaticResource Command.MouseClicks}" Style="{StaticResource Style.Button.Vertical}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <n:ExtendedButton Grid.Row="0" Grid.Column="4" x:Name="BorderButton" Text="{DynamicResource S.Editor.Image.Border}" Icon="{StaticResource Vector.Border}"
                                          MinWidth="55" ContentHeight="28" ContentWidth="32" Command="{StaticResource Command.Border}" Style="{StaticResource Style.Button.Vertical}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <n:ExtendedButton Grid.Row="0" Grid.Column="5" x:Name="ShadowButton" Text="{DynamicResource S.Editor.Image.Shadow}" Icon="{StaticResource Vector.Shadow}"
                                          MinWidth="55" ContentHeight="28" ContentWidth="32" Command="{StaticResource Command.Shadow}" Style="{StaticResource Style.Button.Vertical}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <n:ExtendedButton Grid.Row="0" Grid.Column="6" x:Name="ObfuscateButton" Text="{DynamicResource S.Editor.Image.Obfuscate}" Icon="{StaticResource Vector.Obfuscate}"
                                          MinWidth="55" ContentHeight="28" ContentWidth="32" Command="{StaticResource Command.Obfuscate}" Style="{StaticResource Style.Button.Vertical}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <Grid Grid.Row="0" Grid.Column="7">
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>

                            <n:ExtendedButton x:Name="WatermarkButton" Grid.Row="0" Text="{DynamicResource S.Editor.Image.Watermark}" Icon="{StaticResource Vector.Watermark}"
                                              Padding="2" MinWidth="60" ContentWidth="25" ContentHeight="25" Command="{StaticResource Command.Watermark}" Style="{StaticResource Style.Button.Horizontal}"
                                              ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                              ToolTipService.Placement="Top" ToolTipService.HorizontalOffset="-5"/>

                            <n:ExtendedButton x:Name="CinemagraphButton" Grid.Row="1" Text="{DynamicResource S.Editor.Image.Cinemagraph}" Icon="{StaticResource Vector.Cinemagraph}"
						                      Padding="2" MinWidth="60" ContentWidth="25" ContentHeight="25" Command="{StaticResource Command.Cinemagraph}" Style="{StaticResource Style.Button.Horizontal}"
                                              ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                              ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>
                        </Grid>
                    </Grid>

                    <Separator Grid.Column="5" Grid.Row="0" Width="1" Height="Auto" Margin="3,2"/>
                </Grid>
            </n:AwareTabItem>

            <n:AwareTabItem Header="{DynamicResource S.Editor.Transitions}" Icon="{StaticResource Vector.Fade}">
                <Grid Height="94" Margin="2" Background="{DynamicResource Panel.Background.Level2}">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="7"/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>

                    <Grid Grid.Column="0" Margin="0,1,0,0">
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition Height="16"/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>

                        <Label Grid.Row="1" Grid.ColumnSpan="2" x:Name="StylesLabel" Content="{DynamicResource S.Editor.Transitions.Styles}" 
						       HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Padding="0" 
						       FontSize="12" Foreground="{DynamicResource Element.Foreground.Gray112}"/>

                        <n:ExtendedButton Grid.Row="0"  Grid.Column="0" x:Name="FadeTransitionButton" Text="{DynamicResource S.Editor.Transitions.Fade}" Icon="{StaticResource Vector.Fade}"
                                          MinWidth="55" ContentHeight="28" ContentWidth="32" Style="{StaticResource Style.Button.Vertical}" Command="{StaticResource Command.Fade}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                        <n:ExtendedButton Grid.Row="0" Grid.Column="1" x:Name="SlideTransitionButton" Text="{DynamicResource S.Editor.Transitions.Slide}" Icon="{StaticResource Vector.Slide}"
                                          MinWidth="55" ContentHeight="28" ContentWidth="32" Style="{StaticResource Style.Button.Vertical}" Command="{StaticResource Command.Slide}"
                                          ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                          ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>
                    </Grid>

                    <Separator Grid.Column="1" Grid.Row="0" Width="1" Height="Auto" HorizontalAlignment="Left" Margin="3,2"/>
                </Grid>
            </n:AwareTabItem>

            <n:AwareTabItem Header="{DynamicResource S.Editor.Statistics}" Icon="{StaticResource Vector.Info}">
                <Grid Height="94" Margin="2" Background="{DynamicResource Panel.Background.Level2}" Effect="{StaticResource Shadow.Invariant}">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="7"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="7"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="7"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>

                    <Grid Grid.Column="0" Margin="0,1,0,0">
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition/>
                            <RowDefinition/>
                            <RowDefinition/>
                            <RowDefinition Height="16"/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="18"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="20"/>
                            <ColumnDefinition Width="18"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="20"/>
                            <ColumnDefinition Width="18"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>

                        <Label Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="8" Content="{DynamicResource S.Editor.Statistics.General}" 
						       HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Padding="0" 
						       FontSize="12" Foreground="{DynamicResource Element.Foreground.Gray112}"/>

                        <Border Grid.Row="0" Grid.Column="0" Background="{StaticResource Vector.Number}" Height="18" Width="18" VerticalAlignment="Center" Opacity="{DynamicResource Element.Opacity}"/>
                        <TextBlock Grid.Row="0" Grid.Column="1" Text="{DynamicResource S.Editor.Statistics.FrameCount}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,0" Foreground="{DynamicResource Element.Foreground}"/>
                        <TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding ElementName=FrameListView, Path=Items.Count}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Header}"/>

                        <Border Grid.Row="2" Grid.Column="0" Background="{StaticResource Vector.Clock}" Height="18" Width="18" VerticalAlignment="Center" Opacity="{DynamicResource Element.Opacity}"/>
                        <TextBlock Grid.Row="2" Grid.Column="1" Text="{DynamicResource S.Editor.Statistics.TotalDuration}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,0" Foreground="{DynamicResource Element.Foreground}"/>
                        <TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding ElementName=EditorWindow, Path=TotalDuration, StringFormat='{}{0:mm\\:ss\\.fff} m'}" HorizontalAlignment="Center" VerticalAlignment="Center" 
                                   Foreground="{DynamicResource Element.Foreground.Header}"/>

                        <Border Grid.Row="0" Grid.Column="3" Background="{StaticResource Vector.WidthHeight}" Height="18" Width="18" VerticalAlignment="Center" Opacity="{DynamicResource Element.Opacity}"/>
                        <TextBlock Grid.Row="0" Grid.Column="4" Text="{DynamicResource S.Editor.Statistics.FrameSize}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,0" Foreground="{DynamicResource Element.Foreground}"/>
                        <TextBlock Grid.Row="1" Grid.Column="4" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Header}">
                            <TextBlock.Text>
                                <MultiBinding StringFormat="{}{0:0.#} × {1:0.#}">
                                    <Binding ElementName="EditorWindow" Path="FrameSize.Width" Mode="OneWay"/>
                                    <Binding ElementName="EditorWindow" Path="FrameSize.Height" Mode="OneWay"/>
                                </MultiBinding>
                            </TextBlock.Text>
                        </TextBlock>

                        <Border Grid.Row="2" Grid.Column="3" Background="{StaticResource Vector.Clock}" Height="18" Width="18" VerticalAlignment="Center" Opacity="{DynamicResource Element.Opacity}"/>
                        <TextBlock Grid.Row="2" Grid.Column="4" Text="{DynamicResource S.Editor.Statistics.CurrentTime}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,0" 
                                   Foreground="{DynamicResource Element.Foreground}" ToolTip="{DynamicResource S.Editor.Statistics.CurrentTime.Info}"/>
                        <TextBlock Grid.Row="3" Grid.Column="4" Text="{Binding ElementName=EditorWindow, Path=CurrentTime, StringFormat='{}{0:mm\\:ss\\.fff} m'}" HorizontalAlignment="Center" VerticalAlignment="Center" 
                                   Foreground="{DynamicResource Element.Foreground.Header}" ToolTip="{DynamicResource S.Editor.Statistics.CurrentTime.Info}"/>

                        <Border Grid.Row="0" Grid.Column="6" Background="{StaticResource Vector.Fit}" Height="18" Width="18" VerticalAlignment="Center" Opacity="{DynamicResource Element.Opacity}"/>
                        <TextBlock Grid.Row="0" Grid.Column="7" Text="{DynamicResource S.Editor.Statistics.FrameDpi}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,0" Foreground="{DynamicResource Element.Foreground}"/>
                        <TextBlock Grid.Row="1" Grid.Column="7" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Header}">
                            <TextBlock.Text>
                                <MultiBinding StringFormat="{}{0} DPI / {1} %">
                                    <Binding ElementName="EditorWindow" Path="FrameDpi" Mode="OneWay"/>
                                    <Binding ElementName="EditorWindow" Path="FrameScale" Mode="OneWay"/>
                                </MultiBinding>
                            </TextBlock.Text>
                        </TextBlock>

                        <Border Grid.Row="2" Grid.Column="6" Background="{StaticResource Vector.Delay}" Height="18" Width="18" VerticalAlignment="Center" Opacity="{DynamicResource Element.Opacity}"/>
                        <TextBlock Grid.Row="2" Grid.Column="7" Text="{DynamicResource S.Editor.Statistics.AverageDuration}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,0" Foreground="{DynamicResource Element.Foreground}"/>
                        <TextBlock Grid.Row="3" Grid.Column="7" Text="{Binding ElementName=EditorWindow, Path=AverageDelay, StringFormat=0.# ms}" HorizontalAlignment="Center" VerticalAlignment="Center" 
                                   Foreground="{DynamicResource Element.Foreground.Header}"/>
                    </Grid>

                    <Separator Grid.Column="1" Grid.Row="0" Width="1" Height="Auto" HorizontalAlignment="Left" Margin="3,2"/>

                    <Grid Grid.Column="2" Margin="0,1,0,0" MinWidth="150">
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition Height="16"/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>

                        <Label Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" Content="{DynamicResource S.Editor.Statistics.SelectedFrame}" 
						       HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Padding="0" 
						       FontSize="12" Foreground="{DynamicResource Element.Foreground.Gray112}"/>

                        <Viewbox Grid.Row="0" Grid.Column="0">
                            <Grid HorizontalAlignment="Center" VerticalAlignment="Center" Opacity="{DynamicResource Element.Opacity}">
                                <n:CircularProgressBar StrokeThickness="2" Percentage="100" SegmentColor="Gray" Radius="24"/>
                                <n:CircularProgressBar StrokeThickness="2" Maximum="10010" Minimum="10" Value="{Binding Delay, UpdateSourceTrigger=PropertyChanged}" SegmentColor="#FFE28A73" Radius="24"/>
                                <n:CircularProgressBar StrokeThickness="22" Percentage="100" SegmentColor="#FFF0F1F1" Radius="10" />
                                <n:CircularProgressBar StrokeThickness="22" Maximum="10010" Minimum="10" Value="{Binding Delay, UpdateSourceTrigger=PropertyChanged}" SegmentColor="#FFE28A73" Radius="10" />
                            </Grid>
                        </Viewbox>

                        <TextBlock Grid.Row="0" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Header}">
                            <TextBlock.Text>
                                <MultiBinding StringFormat="{}{0} ms">
                                    <Binding Path="Delay" Mode="OneWay" FallbackValue="0" UpdateSourceTrigger="PropertyChanged"/>
                                </MultiBinding>
                            </TextBlock.Text>
                        </TextBlock>
                    </Grid>
                </Grid>
            </n:AwareTabItem>
        </n:HideableTabControl>

        <!--Hack for the extended title bar-->
        <Grid Grid.Row="1" Grid.RowSpan="3" Background="{DynamicResource Panel.Background.Level3}"/>

        <!--Middle of the Window-->
        <Grid Grid.Row="1" x:Name="MiddleGrid" Background="{StaticResource Checker.DrawingBrush}" IsEnabled="{Binding Path=IsLoading, ElementName=EditorWindow, Converter={StaticResource InvertedBoolConverter}}">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>

            <n:StatusList Grid.Row="0" x:Name="StatusList"/>

            <!--Overlay behind the image-->
            <ScrollViewer Grid.Row="1" Grid.Column="0" x:Name="BehindScrollViewer" VerticalScrollBarVisibility="Hidden" HorizontalScrollBarVisibility="Hidden" Visibility="{Binding Path=Visibility, ElementName=OverlayGrid}">
                <Grid x:Name="BehindGrid" Opacity="{Binding ElementName=OverlayGrid, Path=Opacity, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}">
                    <!--Border-->
                    <Grid x:Name="BorderPreviewGrid" VerticalAlignment="Center" HorizontalAlignment="Center"
                          Visibility="{Binding ElementName=BorderGrid, Path=Visibility}" Background="White">
                        <Border x:Name="BorderBehindOverlayBorder" VerticalAlignment="Center" HorizontalAlignment="Center"
                                MinWidth="{Binding ElementName=CaptionOverlayGrid, Path=Width, FallbackValue=0}" 
                                MinHeight="{Binding ElementName=CaptionOverlayGrid, Path=Height, FallbackValue=0}"
                                BorderBrush="{Binding ElementName=BorderColorBox, Path=SelectedBrush}">
                            <Border.BorderThickness>
                                <MultiBinding Converter="{StaticResource DoubleToThicknessConverter}" ConverterParameter="-">
                                    <Binding ElementName="BorderLeftThicknessNumericUpDown" Path="Value"/>
                                    <Binding ElementName="BorderTopThicknessNumericUpDown" Path="Value"/>
                                    <Binding ElementName="BorderRightThicknessNumericUpDown" Path="Value"/>
                                    <Binding ElementName="BorderBottomThicknessNumericUpDown" Path="Value"/>
                                </MultiBinding>
                            </Border.BorderThickness>
                        </Border>
                    </Grid>

                    <!--Shadow Previewer-->
                    <Grid x:Name="ShadowPreviewGrid" VerticalAlignment="Center" HorizontalAlignment="Center"
                          Visibility="{Binding ElementName=ShadowGrid, Path=Visibility}"
                          Background="{Binding ElementName=ShadowBackgroundColorBox, Path=SelectedBrush, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}">
                        <Grid x:Name="ShadowInternalGrid" Background="White" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                              Width="{Binding ElementName=CaptionOverlayGrid, Path=Width, FallbackValue=0}" 
                              Height="{Binding ElementName=CaptionOverlayGrid, Path=Height, FallbackValue=0}">
                            <Grid.Effect>
                                <DropShadowEffect Color="{Binding Source={x:Static t:UserSettings.All}, Path=ShadowColor, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" 
                                                  BlurRadius="{Binding Source={x:Static t:UserSettings.All}, Path=ShadowBlurRadius, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
                                                  Direction="{Binding Source={x:Static t:UserSettings.All}, Path=ShadowDirection, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
                                                  Opacity="{Binding Source={x:Static t:UserSettings.All}, Path=ShadowOpacity, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
                                                  ShadowDepth="{Binding Source={x:Static t:UserSettings.All}, Path=ShadowDepth, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"/>
                            </Grid.Effect>
                        </Grid>
                    </Grid>
                </Grid>
            </ScrollViewer>

            <n:ZoomBox Grid.Row="1" Grid.Column="0" x:Name="ZoomBoxControl" Background="Transparent" ClipToBounds="True" Focusable="False" IsTabStop="False"
                       AllowDrop="True" Drop="Control_Drop" DragEnter="Control_DragEnter" MouseLeftButtonUp="ZoomBoxControl_MouseLeftButtonUp" PreviewMouseWheel="ZoomBox_MouseWheel">
                <n:ZoomBox.ContextMenu>
                    <ContextMenu>
                        <n:ExtendedMenuItem x:Name="PlayMenuItem" Header="{DynamicResource S.Editor.Playback.Play}" Icon="{StaticResource Vector.Play}" ContentHeight="16" ContentWidth="16" Command="{StaticResource Command.Play}"
                                            InputGestureText="{DynamicResource S.Keys.Space}"/>
                        <Separator/>
                        <n:ExtendedMenuItem Header="{DynamicResource S.Editor.Home.Undo}" Icon="{StaticResource Vector.Undo}" ContentHeight="16" ContentWidth="16" Command="{StaticResource Command.Undo}"/>
                        <n:ExtendedMenuItem Header="{DynamicResource S.Editor.Home.Redo}" Icon="{StaticResource Vector.Redo}" ContentHeight="16" ContentWidth="16" Command="{StaticResource Command.Redo}"/>
                        <Separator/>
                        <n:ExtendedMenuItem Header="{DynamicResource S.Context.SaveAs}" Icon="{StaticResource Vector.Gif}" ContentHeight="16" ContentWidth="16" Command="{StaticResource Command.SaveAs}"/>
                        <n:ExtendedMenuItem Header="{DynamicResource S.Recorder.Discard}" Icon="{StaticResource Vector.Remove}" ContentHeight="16" ContentWidth="16" Command="{StaticResource Command.DiscardProject}"/>
                        <Separator/>
                        <n:ExtendedMenuItem Header="{DynamicResource S.Context.RemoveFrames}" Icon="{StaticResource Vector.RemoveImage}" ContentHeight="16" ContentWidth="16" Command="{StaticResource Command.Delete}"/>
                    </ContextMenu>
                </n:ZoomBox.ContextMenu>
            </n:ZoomBox>

            <!--Overlay on top of the image-->
            <ScrollViewer Grid.Row="1" Grid.Column="0" x:Name="MainScrollViewer" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" 
                          PreviewMouseWheel="ZoomBox_MouseWheel" Visibility="{Binding Path=Visibility, ElementName=OverlayGrid}">
                <Grid x:Name="OverlayGrid" Visibility="Collapsed" Opacity="0">

                    <Label x:Name="OverlayLabel" Content="{DynamicResource S.Preview}" VerticalAlignment="Top" HorizontalAlignment="Left" 
                           FontSize="16" FontWeight="Light" Foreground="#FF347E4B" Effect="{StaticResource Shadow.Border.Small}"/>

                    <AdornerDecorator Visibility="{Binding ElementName=CropGrid, Path=Visibility}">
                        <Grid x:Name="CropAreaGrid" VerticalAlignment="Center" HorizontalAlignment="Center" 
                              Width="{Binding ElementName=CaptionOverlayGrid, Path=Width, FallbackValue=0}" 
                              Height="{Binding ElementName=CaptionOverlayGrid, Path=Height, FallbackValue=0}"
                              Visibility="{Binding ElementName=CropGrid, Path=Visibility}"/>
                    </AdornerDecorator>

                    <Grid x:Name="CaptionOverlayGrid" VerticalAlignment="Center" HorizontalAlignment="Center" ClipToBounds="True"
                          Visibility="{Binding ElementName=CaptionGrid, Path=Visibility}">
                        <n:TextPath x:Name="CaptionOverlayLabel" FontFamily="{Binding ElementName=CaptionFontComboBox, Path=SelectedItem}" 
                                    FontStyle="{Binding ElementName=CaptionFontStyleComboBox, Path=SelectedValue}"
                                    FontWeight="{Binding ElementName=CaptionFontWeightComboBox, Path=SelectedValue}"
                                    FontSize="{Binding ElementName=CaptionFontSizeNumericUpDown, Path=Value}"
                                    Fill="{Binding ElementName=CaptionFontColorBox, Path=SelectedBrush}"
                                    Stroke="{Binding ElementName=CaptionOutlineColorBox, Path=SelectedBrush}"
                                    StrokeThickness="{Binding ElementName=CaptionOutlineThicknessNumericUpDown, Path=Value}"
                                    VerticalAlignment="{Binding ElementName=CaptionVerticalAligmentComboBox, Path=SelectedValue}"
                                    HorizontalAlignment="{Binding ElementName=CaptionHorizontalAligmentComboBox, Path=SelectedValue}"
                                    Margin="{Binding ElementName=CaptionMarginNumericUpDown, Path=Value}"
                                    Text="{Binding ElementName=CaptionTextBox, Path=Text}"/>
                    </Grid>

                    <n:MoveResizeControl x:Name="FreeTextOverlayControl" VerticalAlignment="Center" HorizontalAlignment="Center" ClipToBounds="True"
                                         Width="{Binding ElementName=CaptionOverlayGrid, Path=Width, FallbackValue=0}"
                                         Height="{Binding ElementName=CaptionOverlayGrid, Path=Height, FallbackValue=0}"
                                         Visibility="{Binding ElementName=FreeTextGrid, Path=Visibility}">
                        <TextBlock x:Name="FreeTextTextBlock" Padding="0"
                                   Text="{Binding ElementName=FreeTextTextBox, Path=Text}" 
                                   TextAlignment="{Binding ElementName=FreeTextTextAlignmentComboBox, Path=SelectedValue}" 
                                   TextDecorations="{Binding ElementName=FreeTextTextDecorationComboBox, Path=SelectedValue}"
                                   FontFamily="{Binding ElementName=FreeTextFontComboBox, Path=SelectedItem}" 
                                   FontStyle="{Binding ElementName=FreeTextFontStyleComboBox, Path=SelectedValue}"
                                   FontWeight="{Binding ElementName=FreeTextFontWeightComboBox, Path=SelectedValue}"
                                   FontSize="{Binding ElementName=FreeTextFontSizeNumericUpDown, Path=Value}"
                                   Foreground="{Binding ElementName=FreeTextFontColorBox, Path=SelectedBrush}">
                            <TextBlock.Resources>
                                <c:DoubleToBool x:Key="DoubleToBool"/>
                                <DropShadowEffect x:Key="DropShadowEffect" 
                                                  Color="{Binding Source={x:Static t:UserSettings.All}, Path=FreeTextShadowColor, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" 
                                                  BlurRadius="{Binding Source={x:Static t:UserSettings.All}, Path=FreeTextShadowBlurRadius, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" 
                                                  Direction="{Binding Source={x:Static t:UserSettings.All}, Path=FreeTextShadowDirection, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" 
                                                  Opacity="{Binding Source={x:Static t:UserSettings.All}, Path=FreeTextShadowOpacity, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" 
                                                  ShadowDepth="{Binding Source={x:Static t:UserSettings.All}, Path=FreeTextShadowDepth, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" />
                            </TextBlock.Resources>
                            <TextBlock.Style>
                                <Style>
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding ElementName=FreeTextTextAlignmentComboBox, Path=SelectedValue}" Value="Justify">
                                            <Setter Property="TextBlock.TextWrapping" Value="Wrap"/>
                                            <Setter Property="TextBlock.Width" Value="{Binding ElementName=FreeTextWidthNumericUpDown, Path=Value}"/>
                                        </DataTrigger>
                                        <DataTrigger Binding="{Binding Source={x:Static t:UserSettings.All}, Path=FreeTextShadowOpacity, Converter={StaticResource DoubleToBool}, ConverterParameter=0, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" Value="False">
                                            <Setter Property="TextBlock.Effect" Value="{StaticResource DropShadowEffect}"/>
                                        </DataTrigger>
                                    </Style.Triggers>
                                    <Style.Setters>
                                        <Setter Property="TextBlock.TextWrapping" Value="NoWrap"/>
                                        <Setter Property="TextBlock.Width" Value="Auto"/>
                                        <Setter Property="TextBlock.Effect" Value="{x:Null}"/>
                                    </Style.Setters>
                                </Style>
                            </TextBlock.Style>
                        </TextBlock>
                    </n:MoveResizeControl>

                    <Grid x:Name="TitleFrameOverlayGrid" VerticalAlignment="Center" HorizontalAlignment="Center" ClipToBounds="True"
                          Width="{Binding ElementName=CaptionOverlayGrid, Path=Width, FallbackValue=0}" 
                          Height="{Binding ElementName=CaptionOverlayGrid, Path=Height, FallbackValue=0}"
                          Visibility="{Binding ElementName=TitleFrameGrid, Path=Visibility}" 
                          Background="{Binding ElementName=TitleFrameBackgroundColorBox, Path=SelectedBrush}">
                        <TextBlock x:Name="TitleFrameTextBlock" Padding="0"
                                   Text="{Binding ElementName=TitleFrameTextBox, Path=Text}" 
                                   FontFamily="{Binding ElementName=TitleFrameFontComboBox, Path=SelectedItem}" 
                                   FontStyle="{Binding ElementName=TitleFrameFontStyleComboBox, Path=SelectedValue}"
                                   FontWeight="{Binding ElementName=TitleFrameFontWeightComboBox, Path=SelectedValue}"
                                   FontSize="{Binding ElementName=TitleFrameFontSizeNumericUpDown, Path=Value}"
                                   Foreground="{Binding ElementName=TitleFrameFontColorBox, Path=SelectedBrush}"
                                   VerticalAlignment="{Binding ElementName=TitleFrameVerticalAligmentComboBox, Path=SelectedValue}"
                                   HorizontalAlignment="{Binding ElementName=TitleFrameHorizontalAligmentComboBox, Path=SelectedValue}"
                                   Margin="{Binding ElementName=TitleFrameMarginNumericUpDown, Path=Value}"/>
                    </Grid>

                    <Grid x:Name="KeyStrokesOverlayGrid" ClipToBounds="True"
                          Height="{Binding ElementName=CaptionOverlayGrid, Path=Height, FallbackValue=0}"
                          Width="{Binding ElementName=CaptionOverlayGrid, Path=Width, FallbackValue=0}"
                          Visibility="{Binding ElementName=KeyStrokesGrid, Path=Visibility}">
                        <Grid x:Name="KeyStrokesInternalGrid" HorizontalAlignment="{Binding Source={x:Static t:UserSettings.All}, Path=KeyStrokesHorizontalAligment}" 
                              VerticalAlignment="{Binding Source={x:Static t:UserSettings.All}, Path=KeyStrokesVerticalAligment}"
                              Background="{Binding Source={x:Static t:UserSettings.All}, Path=KeyStrokesBackgroundColor, Converter={StaticResource ColorToBrush}}"
                              Margin="{Binding Source={x:Static t:UserSettings.All}, Path=KeyStrokesMargin}"
                              MinHeight="{Binding Source={x:Static t:UserSettings.All}, Path=KeyStrokesMinHeight}">
                            <n:TextPath x:Name="KeyStrokesLabel" Text="Control + C" VerticalAlignment="Center" HorizontalAlignment="Center"
                                        FontFamily="{Binding Source={x:Static t:UserSettings.All}, Path=KeyStrokesFontFamily}" 
                                        FontStyle="{Binding Source={x:Static t:UserSettings.All}, Path=KeyStrokesFontStyle}"
                                        FontWeight="{Binding Source={x:Static t:UserSettings.All}, Path=KeyStrokesFontWeight}"
                                        FontSize="{Binding Source={x:Static t:UserSettings.All}, Path=KeyStrokesFontSize}"
                                        Fill="{Binding Source={x:Static t:UserSettings.All}, Path=KeyStrokesFontColor, Converter={StaticResource ColorToBrush}}"
                                        Stroke="{Binding Source={x:Static t:UserSettings.All}, Path=KeyStrokesOutlineColor, Converter={StaticResource ColorToBrush}}"
                                        StrokeThickness="{Binding Source={x:Static t:UserSettings.All}, Path=KeyStrokesOutlineThickness}"
                                        Margin="{Binding Source={x:Static t:UserSettings.All}, Path=KeyStrokesPadding}"/>
                        </Grid>
                    </Grid>

                    <n:InkCanvasExtended x:Name="FreeDrawingInkCanvas" VerticalAlignment="Center" HorizontalAlignment="Center" ClipToBounds="True"
                                         Width="{Binding ElementName=CaptionOverlayGrid, Path=Width, FallbackValue=0}" MinWidth="10" 
                                         Height="{Binding ElementName=CaptionOverlayGrid, Path=Height, FallbackValue=0}" MinHeight="10"
                                         Visibility="{Binding ElementName=FreeDrawingGrid, Path=Visibility}" Background="Transparent"
                                         PreviewKeyDown="InkCanvas_PreviewKeyDown">

                        <n:InkCanvasExtended.EditingMode>
                            <MultiBinding Converter="{StaticResource SelectionToEditingModeConverter}">
                                <Binding ElementName="PenModeRadioButton" Path="IsChecked"/>
                                <Binding ElementName="EraserModeRadioButton" Path="IsChecked"/>
                                <Binding ElementName="SelectorModeRadioButton" Path="IsChecked"/>
                            </MultiBinding>
                        </n:InkCanvasExtended.EditingMode>

                        <n:InkCanvasExtended.DefaultDrawingAttributes>
                            <MultiBinding Converter="{StaticResource SelectionToDrawingAttributesConverter}">
                                <Binding ElementName="FreeDrawingHeightNumericUpDown" Path="Value"/>
                                <Binding ElementName="FreeDrawingWidthNumericUpDown" Path="Value"/>
                                <Binding ElementName="FreeDrawingColorBox" Path="SelectedColor"/>
                                <Binding ElementName="FitToCurveCheckBox" Path="IsChecked"/>
                                <Binding ElementName="IsHighLighterCheckBox" Path="IsChecked"/>
                                <Binding ElementName="RectangleRadioButton" Path="IsChecked"/>
                            </MultiBinding>
                        </n:InkCanvasExtended.DefaultDrawingAttributes>

                        <n:InkCanvasExtended.EraserShape>
                            <MultiBinding Converter="{StaticResource SelectionToStylusShapeConverter}">
                                <Binding ElementName="FreeDrawingEraserWidthNumericUpDown" Path="Value"/>
                                <Binding ElementName="FreeDrawingEraserHeightNumericUpDown" Path="Value"/>
                                <Binding ElementName="RectangleEraserRadioButton" Path="IsChecked"/>
                            </MultiBinding>
                        </n:InkCanvasExtended.EraserShape>
                    </n:InkCanvasExtended>

                    <n:DrawingCanvas x:Name="ShapeDrawingCanvas" VerticalAlignment="Center" HorizontalAlignment="Center" ClipToBounds="True" DrawingMode="Shape"
                                     Width="{Binding ElementName=CaptionOverlayGrid, Path=Width, FallbackValue=0}" MinWidth="10" CurrentShape="Arrow"
                                     Height="{Binding ElementName=CaptionOverlayGrid, Path=Height, FallbackValue=0}" MinHeight="10"
                                     Visibility="{Binding ElementName=ShapesGrid, Path=Visibility}" Background="Transparent"/>

                    <n:MoveResizeControl x:Name="WatermarkOverlayCanvas" VerticalAlignment="Center" HorizontalAlignment="Center" ClipToBounds="True" CanResize="True"
                                         Width="{Binding ElementName=CaptionOverlayGrid, Path=Width, FallbackValue=0}" 
                                         Height="{Binding ElementName=CaptionOverlayGrid, Path=Height, FallbackValue=0}"
                                         Visibility="{Binding ElementName=WatermarkGrid, Path=Visibility}"
                                         Top="{Binding ElementName=TopWatermarkDoubleUpDown, Path=Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, FallbackValue=0}"
                                         Left="{Binding ElementName=LeftWatermarkDoubleUpDown, Path=Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, FallbackValue=0}"
                                         ContentScale="{Binding Source={x:Static t:UserSettings.All}, Path=WatermarkSize}">
                        <Image x:Name="WatermarkImage" Stretch="Fill" RenderTransformOrigin="0.5,0.5"
                               Source="{Binding Source={x:Static t:UserSettings.All}, Path=WatermarkFilePath, Converter={StaticResource UriToBitmapConverter}}"
                               Opacity="{Binding Source={x:Static t:UserSettings.All}, Path=WatermarkOpacity}"/>
                    </n:MoveResizeControl>

                    <Border x:Name="BorderPositiveOverlayBorder" VerticalAlignment="Center" HorizontalAlignment="Center"
                            Width="{Binding ElementName=CaptionOverlayGrid, Path=Width, FallbackValue=0}" 
                            Height="{Binding ElementName=CaptionOverlayGrid, Path=Height, FallbackValue=0}"
                            BorderBrush="{Binding ElementName=BorderColorBox, Path=SelectedBrush}"
                            Visibility="{Binding ElementName=BorderGrid, Path=Visibility}">
                        <Border.BorderThickness>
                            <MultiBinding Converter="{StaticResource DoubleToThicknessConverter}" ConverterParameter="+">
                                <Binding ElementName="BorderLeftThicknessNumericUpDown" Path="Value"/>
                                <Binding ElementName="BorderTopThicknessNumericUpDown" Path="Value"/>
                                <Binding ElementName="BorderRightThicknessNumericUpDown" Path="Value"/>
                                <Binding ElementName="BorderBottomThicknessNumericUpDown" Path="Value"/>
                            </MultiBinding>
                        </Border.BorderThickness>

                        <!--<Border.CornerRadius>
                            <MultiBinding Converter="{StaticResource DoubleToRadiusConverter}">
                                <Binding ElementName="BorderLeftRadiusNumericUpDown" Path="Value"/>
                                <Binding ElementName="BorderTopRadiusNumericUpDown" Path="Value"/>
                                <Binding ElementName="BorderRightRadiusNumericUpDown" Path="Value"/>
                                <Binding ElementName="BorderBottomRadiusNumericUpDown" Path="Value"/>
                            </MultiBinding>
                        </Border.CornerRadius>-->
                    </Border>

                    <n:SelectControlOld x:Name="ObfuscateOverlaySelectControl" VerticalAlignment="Center" HorizontalAlignment="Center"
                                     Width="{Binding ElementName=CaptionOverlayGrid, Path=Width, FallbackValue=0}" 
                                     Height="{Binding ElementName=CaptionOverlayGrid, Path=Height, FallbackValue=0}"
                                     Visibility="{Binding ElementName=ObfuscateGrid, Path=Visibility}" EmbeddedMode="True"/>

                    <Grid x:Name="ProgressOverlayGrid" VerticalAlignment="Center" HorizontalAlignment="Center" ClipToBounds="True"
                          Width="{Binding ElementName=CaptionOverlayGrid, Path=Width, FallbackValue=0}" MinWidth="10" 
                          Height="{Binding ElementName=CaptionOverlayGrid, Path=Height, FallbackValue=0}" MinHeight="10"
                          Visibility="{Binding ElementName=ProgressGrid, Path=Visibility}" Background="Transparent">

                        <Grid Visibility="{Binding ProgressType, Source={x:Static t:UserSettings.All}, Converter={StaticResource EnumToVisibility}, ConverterParameter={x:Static u:ProgressType.Bar}}">
                            <Rectangle Name="ProgressHorizontalRectangle" Height="{Binding Source={x:Static t:UserSettings.All}, Path=ProgressThickness}"
                                       Visibility="{Binding ProgressOrientation, Source={x:Static t:UserSettings.All}, Converter={StaticResource EnumToVisibility}, ConverterParameter={x:Static Orientation.Horizontal}}"
                                       Fill="{Binding ProgressColor, Source={x:Static t:UserSettings.All}, Converter={StaticResourceExtension ColorToBrush}}" 
                                       VerticalAlignment="{Binding ProgressVerticalAligment, Source={x:Static t:UserSettings.All}}" 
                                       HorizontalAlignment="{Binding ProgressHorizontalAligment, Source={x:Static t:UserSettings.All}}"/>

                            <Rectangle Name="ProgressVerticalRectangle" Width="{Binding Source={x:Static t:UserSettings.All}, Path=ProgressThickness}"
                                       Visibility="{Binding ProgressOrientation, Source={x:Static t:UserSettings.All}, Converter={StaticResource EnumToVisibility}, ConverterParameter={x:Static Orientation.Vertical}}"
                                       Fill="{Binding ProgressColor, Source={x:Static t:UserSettings.All}, Converter={StaticResourceExtension ColorToBrush}}" 
                                       VerticalAlignment="{Binding ProgressVerticalAligment, Source={x:Static t:UserSettings.All}}" 
                                       HorizontalAlignment="{Binding ProgressHorizontalAligment, Source={x:Static t:UserSettings.All}}"/>
                        </Grid>

                        <TextBlock Name="ProgressHorizontalTextBlock" Padding="2,0" 
                                   Background="{Binding ProgressColor, Source={x:Static t:UserSettings.All}, Converter={StaticResourceExtension ColorToBrush}}" 
                                   Foreground="{Binding ProgressFontColor, Source={x:Static t:UserSettings.All}, Converter={StaticResourceExtension ColorToBrush}}" 
                                   VerticalAlignment="{Binding ProgressVerticalAligment, Source={x:Static t:UserSettings.All}}" 
                                   HorizontalAlignment="{Binding ProgressHorizontalAligment, Source={x:Static t:UserSettings.All}}"
                                   Visibility="{Binding ProgressType, Source={x:Static t:UserSettings.All}, Converter={StaticResource EnumToVisibility}, ConverterParameter={x:Static u:ProgressType.Text}}"
                                   FontFamily="{Binding ElementName=ProgressFontComboBox, Path=SelectedItem}" 
                                   FontStyle="{Binding ElementName=ProgressFontStyleComboBox, Path=SelectedValue}"
                                   FontWeight="{Binding ElementName=ProgressFontWeightComboBox, Path=SelectedValue}"
                                   FontSize="{Binding ElementName=ProgressFontSizeNumericUpDown, Path=Value}"/>
                    </Grid>

                    <n:InkCanvasExtended x:Name="CinemagraphInkCanvas" VerticalAlignment="Center" HorizontalAlignment="Center" ClipToBounds="True"
                                         Width="{Binding ElementName=CaptionOverlayGrid, Path=Width, FallbackValue=0}" MinWidth="10" 
                                         Height="{Binding ElementName=CaptionOverlayGrid, Path=Height, FallbackValue=0}" MinHeight="10"
                                         Visibility="{Binding ElementName=CinemagraphGrid, Path=Visibility}" Background="Transparent"
                                         PreviewKeyDown="InkCanvas_PreviewKeyDown">

                        <n:InkCanvasExtended.EditingMode>
                            <MultiBinding Converter="{StaticResource SelectionToEditingModeConverter}">
                                <Binding ElementName="PenMode2RadioButton" Path="IsChecked"/>
                                <Binding ElementName="EraserMode2RadioButton" Path="IsChecked"/>
                                <Binding ElementName="SelectorMode2RadioButton" Path="IsChecked"/>
                            </MultiBinding>
                        </n:InkCanvasExtended.EditingMode>

                        <n:InkCanvasExtended.DefaultDrawingAttributes>
                            <MultiBinding Converter="{StaticResource SelectionToDrawingAttributesConverter}">
                                <Binding ElementName="CinemagraphHeightNumericUpDown" Path="Value"/>
                                <Binding ElementName="CinemagraphWidthNumericUpDown" Path="Value"/>
                                <Binding Source="{x:Static t:UserSettings.All}" Path="CinemagraphColor"/>
                                <Binding ElementName="FitToCurve2CheckBox" Path="IsChecked"/>
                                <Binding Source="{x:Static t:UserSettings.All}" Path="CinemagraphIsHighlighter"/>
                                <Binding ElementName="Rectangle2RadioButton" Path="IsChecked"/>
                            </MultiBinding>
                        </n:InkCanvasExtended.DefaultDrawingAttributes>

                        <n:InkCanvasExtended.EraserShape>
                            <MultiBinding Converter="{StaticResource SelectionToStylusShapeConverter}">
                                <Binding ElementName="CinemagraphEraserWidthNumericUpDown" Path="Value"/>
                                <Binding ElementName="CinemagraphEraserHeightNumericUpDown" Path="Value"/>
                                <Binding ElementName="RectangleEraser2RadioButton" Path="IsChecked"/>
                            </MultiBinding>
                        </n:InkCanvasExtended.EraserShape>
                    </n:InkCanvasExtended>
                </Grid>
            </ScrollViewer>

            <Grid Grid.Row="1" Grid.Column="0" x:Name="WelcomeGrid" Background="{DynamicResource Panel.Background.Level3}" Visibility="Visible" AllowDrop="True" Drop="Control_Drop" DragEnter="Control_DragEnter">
                <Grid.ContextMenu>
                    <ContextMenu>
                        <n:ExtendedMenuItem Header="{DynamicResource S.Context.NewRecording}" Icon="{StaticResource Vector.Record.New}" ContentHeight="16" ContentWidth="16" Command="{StaticResource Command.NewRecording}"/>
                        <n:ExtendedMenuItem Header="{DynamicResource S.Context.NewWebcamRecording}" Icon="{StaticResource Vector.Camera.New}" ContentHeight="16" ContentWidth="16" Command="{StaticResource Command.NewWebcamRecording}"/>
                        <n:ExtendedMenuItem Header="{DynamicResource S.Context.NewBoardRecording}" Icon="{StaticResource Vector.Board.New}" ContentHeight="16" ContentWidth="16" Command="{StaticResource Command.NewBoardRecording}"/>
                        <n:ExtendedMenuItem Header="{DynamicResource S.Context.NewBlankAnimation}" Icon="{StaticResource Vector.File.New}" ContentHeight="16" ContentWidth="16" Command="{StaticResource Command.NewAnimation}"/>
                        <n:ExtendedMenuItem Header="{DynamicResource S.Context.NewFromMediaProject}" Icon="{StaticResource Vector.Open}" ContentHeight="16" ContentWidth="16" Command="{StaticResource Command.Load}"/>
                    </ContextMenu>
                </Grid.ContextMenu>

                <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
                    <TextBlock FontSize="28" Foreground="{DynamicResource Element.Foreground.Gray192}" FontFamily="Segoe UI Semilight" HorizontalAlignment="Center" Effect="{StaticResource Shadow.Background.Tiny}"
                               Text="{Binding Source={x:Static t:UserSettings.All}, Path=VersionText, StringFormat=ScreenToGif {0}}"/>

                    <Separator Height="1"/>

                    <TextBlock x:Name="WelcomeTextBlock" FontSize="16" Foreground="{DynamicResource Element.Foreground.Gray192}" FontFamily="Segoe UI Semilight" HorizontalAlignment="Center" 
                               TextWrapping="Wrap" Effect="{StaticResource Shadow.Background.Tiny}"/>

                    <!--<TextBlock FontSize="16" FontFamily="Segoe UI Semilight" HorizontalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Gray192}" Effect="{StaticResource Shadow.Border.Small}">
                        <Hyperlink Command="{StaticResource Command.LoadRecent}" Cursor="Hand" TextDecorations="{x:Null}">
                            <Run>Open recent projects...</Run>
                        </Hyperlink>
                    </TextBlock>-->

                    <TextBlock x:Name="SymbolTextBlock" Text=":D" Foreground="{DynamicResource Element.Foreground.Gray208}" FontSize="40" FontFamily="Segoe UI Semilight"
                               TextWrapping="WrapWithOverflow" VerticalAlignment="Center" HorizontalAlignment="Center" Effect="{StaticResource Shadow.Background.Tiny}"/>

                    <!--New update available-->
                    <StackPanel x:Name="UpdateStackPanel" HorizontalAlignment="Center" Margin="0,30,0,0" Visibility="Collapsed">
                        <Separator Height="1"/>

                        <TextBlock FontSize="18" FontFamily="Segoe UI Semilight" HorizontalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Gray192}" 
                                   Effect="{StaticResource Shadow.Background.Tiny}" Margin="3" ToolTip="{DynamicResource S.Editor.UpdateAvailable.Info}">
                            <Hyperlink Command="{Binding Source={StaticResource AppViewModel}, Path=PromptUpdate}" Cursor="Hand" TextDecorations="{x:Null}">
                                <Run Text="{DynamicResource S.Editor.UpdateAvailable}"/>
                            </Hyperlink>
                        </TextBlock>

                        <TextBlock FontSize="14" Foreground="{DynamicResource Element.Foreground.Gray192}" FontFamily="Segoe UI Semilight" 
                                   Effect="{StaticResource Shadow.Background.Tiny}" HorizontalAlignment="Center" TextAlignment="Center">
                            <Run Text="{DynamicResource S.Updater.Version}" FontSize="18"/>
                            <Run Name="UpdateVersionRun" Text="2.22" FontSize="18"/>
                            <LineBreak/>
                            <Run Name="UpdateSizeRun" Text="800 KB" FontSize="16"/>
                        </TextBlock>
                    </StackPanel>
                </StackPanel>
            </Grid>

            <Grid Grid.Row="0" Grid.Column="1" Grid.RowSpan="2" x:Name="ActionGrid" Width="0" Background="{DynamicResource Panel.Background.Level2}" Effect="{StaticResource Shadow.Border}">
                <Grid.RowDefinitions>
                    <RowDefinition Height="30"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>

                <!--Title-->
                <Grid Grid.Row="0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="30"/>
                        <ColumnDefinition/>
                        <ColumnDefinition Width="30"/>
                    </Grid.ColumnDefinitions>

                    <Border Grid.Column="0" x:Name="ActionIconBorder" Margin="5,3,0,3" Width="20" Height="20" Opacity="{DynamicResource Element.Opacity}"/>

                    <TextBlock Grid.Column="1" x:Name="ActionTitleTextBlock" Text="Title" Padding="5,0,0,0" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground}"/>

                    <n:ExtendedButton Grid.Column="2" x:Name="HideButton" Icon="{DynamicResource Vector.Close}" ContentHeight="16" ContentWidth="16" HorizontalContentAlignment="Center" 
                                      HorizontalAlignment="Center" Style="{DynamicResource Style.Button.NoText}" MinWidth="30" Command="{StaticResource Command.Cancel}"
                                      ToolTip="{DynamicResource S.Action.Hide}" ToolTipService.Placement="Top" ToolTipService.HorizontalOffset="-5"/>
                </Grid>

                <!--Content-->
                <ScrollViewer Grid.Row="1" x:Name="ActionScrollViewer" VerticalScrollBarVisibility="Auto">
                    <Grid x:Name="ActionInternalGrid">
                        <ContentControl x:Name="CustomContentControl" Visibility="Collapsed" Focusable="False" IsTabStop="False"/>
                        
                        <Grid x:Name="NewGrid" Visibility="Collapsed">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="27"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="27"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <n:LabelSeparator Grid.Row="0" Text="{DynamicResource S.Size}"/>
                            <Grid Grid.Row="1" Margin="10,0,0,0">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.ImportVideo.Width}" VerticalAlignment="Center" Padding="0" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:IntegerUpDown Grid.Row="0" Grid.Column="1" x:Name="NewImageWidthNumericUpDown" Minimum="10" Maximum="2000" Margin="10,5" MinWidth="80" 
                                                 Value="{Binding Source={x:Static t:UserSettings.All}, Path=NewAnimationWidth, Mode=TwoWay}"/>

                                <TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource S.ImportVideo.Height}" VerticalAlignment="Center" Padding="0"  Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:IntegerUpDown Grid.Row="1" Grid.Column="1" x:Name="NewImageHeightNumericUpDown" Minimum="10" Maximum="2000" Margin="10,5" MinWidth="80" 
                                                 Value="{Binding Source={x:Static t:UserSettings.All}, Path=NewAnimationHeight, Mode=TwoWay}"/>
                            </Grid>

                            <n:LabelSeparator Grid.Row="2" Text="{DynamicResource S.Background}"/>
                            <Grid Grid.Row="3" Margin="10,0,0,0">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource S.Color}" VerticalAlignment="Center" Padding="0" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:ColorBox Grid.Row="1" Grid.Column="1" SelectedColor="{Binding NewAnimationColor, Source={x:Static t:UserSettings.All}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="5,3"/>
                            </Grid>
                        </Grid>
                        
                        <Grid x:Name="LoadRecentGrid" Visibility="Collapsed" Height="{Binding ElementName=ActionScrollViewer, Path=ActualHeight, FallbackValue=100}">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="27"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>

                            <!--Two buttons modes: thumbnail, flat list-->
                            <!--Save mode-->

                            <n:LabelSeparator Grid.Row="0" Text="{DynamicResource S.Recent.Projects}" Margin="5,0" Padding="0,5"/>
                            <DataGrid Grid.Row="1" x:Name="RecentDataGrid" Margin="10,5,5,5" MinHeight="60" SelectionMode="Single" SelectionUnit="FullRow" 
                                      MouseDoubleClick="RecentDataGrid_MouseDoubleClick" PreviewKeyDown="RecentDataGrid_PreviewKeyDown">
                                <DataGrid.Columns>
                                    <DataGridTextColumn Header="{DynamicResource S.Recent.Date}" Width="*" IsReadOnly="True" Binding="{Binding Path=CreationDate, UpdateSourceTrigger=PropertyChanged, StringFormat='{}{0:G}', ConverterCulture={x:Static gl:CultureInfo.CurrentCulture}}"/>
                                    <DataGridTextColumn Header="{DynamicResource S.Recent.Frames}" Width="100" IsReadOnly="True" Binding="{Binding Path=Frames.Count, UpdateSourceTrigger=PropertyChanged}"/>
                                </DataGrid.Columns>
                            </DataGrid>
                        </Grid>

                        <Grid x:Name="ClipboardGrid" Visibility="Collapsed" Height="{Binding ElementName=ActionScrollViewer, Path=ActualHeight, FallbackValue=100}">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="27"/>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="27"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <n:LabelSeparator Grid.Row="0" Text="{DynamicResource S.Clipboard.Entries}"/>
                            <ListBox Grid.Row="1" x:Name="ClipboardListBox" Margin="10,5,5,5" MinHeight="60" VerticalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
                                <ListBox.Resources>
                                    <ContextMenu x:Key="ClipboardContextMenu">
                                        <n:ExtendedMenuItem Header="{DynamicResource S.Clipboard.Entry}" Icon="{StaticResource Vector.Paste}" ContentHeight="16" ContentWidth="16" IsHitTestVisible="False"/>
                                        <Separator/>
                                        <n:ExtendedMenuItem Header="{DynamicResource S.Clipboard.Explore}" Icon="{StaticResource Vector.Open}" ContentHeight="16" ContentWidth="16" Command="{StaticResource Command.ExploreClipboard}"/>
                                        <n:ExtendedMenuItem Header="{DynamicResource S.Clipboard.Remove}" Icon="{StaticResource Vector.Remove}" ContentHeight="16" ContentWidth="16" Command="{StaticResource Command.RemoveClipboardEntry}"/>
                                    </ContextMenu>
                                </ListBox.Resources>
                                
                                <ListBox.ItemContainerStyle>
                                    <Style TargetType="ListBoxItem">
                                        <Setter Property="ContextMenu" Value="{StaticResource ClipboardContextMenu}"/>
                                    </Style>
                                </ListBox.ItemContainerStyle>
                            </ListBox>

                            <n:LabelSeparator Grid.Row="2" Text="{DynamicResource S.Clipboard.Behavior}"/>
                            <RadioButton Grid.Row="3" x:Name="PasteBeforeRadioButton" Content="{DynamicResource S.Clipboard.Before}" Margin="10,5,5,5" 
                                         IsChecked="{Binding PasteBehavior, Source={x:Static t:UserSettings.All}, Converter={StaticResource EnumToBool}, ConverterParameter={x:Static u:PasteBehavior.BeforeSelected}}"/>
                            <RadioButton Grid.Row="4" x:Name="PasteAfterRadioButton" Content="{DynamicResource S.Clipboard.After}" Margin="10,5,5,5"
                                         IsChecked="{Binding PasteBehavior, Source={x:Static t:UserSettings.All}, Converter={StaticResource EnumToBool}, ConverterParameter={x:Static u:PasteBehavior.AfterSelected}}"/>
                        </Grid>

                        <Grid x:Name="ResizeGrid" Visibility="Collapsed">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="27"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="27"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="27"/>
                                <RowDefinition Height="Auto"/>                                
                            </Grid.RowDefinitions>

                            <n:LabelSeparator Grid.Row="0" Text="{DynamicResource S.Resize.CurrentProperties}"/>
                            <TextBlock Grid.Row="1" Margin="10,0,0,0" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}">
                                <Run x:Name="CurrentWidthRun" Text="100"/>
                                <Run Text=" x "/>
                                <Run x:Name="CurrentHeightRun" Text="100"/>
                                <Run Text=" • "/>
                                <Run x:Name="CurrentDpiRun" Text="100"/>
                                <Run Text="{DynamicResource S.Resize.Dpi}"/>
                            </TextBlock>

                            <n:LabelSeparator Grid.Row="2" Text="{DynamicResource S.Resize.NewProperties}"/>
                            <Grid Grid.Row="3" Margin="10,0,0,0">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Resize.Dpi2}" VerticalAlignment="Center" Padding="0" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:IntegerUpDown Grid.Row="0" Grid.Column="1" x:Name="DpiNumericUpDown" Minimum="72" Maximum="1000" Margin="10,5" MinWidth="70"/>

                                <TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource S.ImportVideo.Width}" VerticalAlignment="Center" Padding="0" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:IntegerUpDown Grid.Row="1" Grid.Column="1" x:Name="WidthResizeNumericUpDown" Minimum="1" Maximum="5000" Margin="10,5" 
                                                 MinWidth="70" ValueChanged="WidthResizeIntegerUpDown_ValueChanged"/>

                                <TextBlock Grid.Row="2" Grid.Column="0" Text="{DynamicResource S.ImportVideo.Height}" VerticalAlignment="Center" Padding="0" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:IntegerUpDown Grid.Row="2" Grid.Column="1" x:Name="HeightResizeNumericUpDown" Minimum="1" Maximum="5000" Margin="10,5" 
                                                 MinWidth="70" ValueChanged="HeightResizeIntegerUpDown_ValueChanged"/>

                                <Border Grid.Row="1" Grid.Column="2" Grid.RowSpan="2" Background="{StaticResource Vector.Lock}" Height="25" Width="25"
                                        Visibility="{Binding ElementName=KeepAspectCheckBox, Path=IsChecked, Converter={StaticResource Bool2Visibility}}"/>
                            </Grid>

                            <n:ExtendedCheckBox Grid.Row="4" x:Name="KeepAspectCheckBox" Text="{DynamicResource S.Resize.KeepAspect}" Margin="10,5" IsChecked="True" Checked="KeepAspectCheckBox_Checked"/>

                            <n:LabelSeparator Grid.Row="5" Text="{DynamicResource S.Resize.Options}"/>
                            <Grid Grid.Row="6" Margin="10,0,0,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                
                                <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Resize.ScalingQuality}" VerticalAlignment="Center" Padding="0" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <ComboBox Grid.Row="0" Grid.Column="1" x:Name="ResizeScalingQuality" Margin="10,5" MaxWidth="150" SelectedValuePath="Tag">
                                    <ComboBoxItem Tag="{x:Static u:ScalingMethod.Fant}" Content="{DynamicResource S.Resize.ScalingQuality.Fant}" />
                                    <ComboBoxItem Tag="{x:Static u:ScalingMethod.Linear}" Content="{DynamicResource S.Resize.ScalingQuality.Linear}" IsSelected="True"/>
                                    <ComboBoxItem Tag="{x:Static u:ScalingMethod.NearestNeighbor}" Content="{DynamicResource S.Resize.ScalingQuality.NearestNeighbor}"/>
                                </ComboBox>
                            </Grid>
                        </Grid>

                        <Grid x:Name="CropGrid" Visibility="Collapsed">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="27"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="27"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <n:LabelSeparator Grid.Row="0" Text="{DynamicResource S.Preview}"/>
                            <Image Grid.Row="1" x:Name="CropImage" Height="120" Stretch="Uniform" Margin="10,5,5,5" Effect="{StaticResource Shadow.Border.Large}"/>
                            <TextBlock Grid.Row="2" x:Name="CropSizeTextBlock" Text="0 × 0" HorizontalAlignment="Center" Padding="2" Foreground="{DynamicResource Element.Foreground.Medium}"/>

                            <n:LabelSeparator Grid.Row="3" Text="{DynamicResource S.Crop.Points}"/>
                            <Grid Grid.Row="4" Margin="10,0,0,0">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Crop.Top}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:IntegerUpDown Grid.Row="0" Grid.Column="1" x:Name="TopCropNumericUpDown" Minimum="0" Margin="10,3" MinWidth="70"
                                                 ValueChanged="CropIntegerUpDown_ValueChanged">
                                    <n:IntegerUpDown.Maximum>
                                        <MultiBinding Converter="{StaticResource MaximumValueConverter}" Mode="OneWay">
                                            <Binding RelativeSource="{RelativeSource Mode=Self}" Path="Minimum" FallbackValue="0"/>
                                            <Binding ElementName="BottomCropNumericUpDown" Path="Value" />
                                            <Binding ElementName="BottomCropNumericUpDown" Path="Minimum" FallbackValue="0"/>
                                        </MultiBinding>
                                    </n:IntegerUpDown.Maximum>
                                </n:IntegerUpDown>

                                <TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource S.Crop.Left}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:IntegerUpDown Grid.Row="1" Grid.Column="1" x:Name="LeftCropNumericUpDown" Minimum="0" Margin="10,3" MinWidth="70"
                                                 ValueChanged="CropIntegerUpDown_ValueChanged">
                                    <n:IntegerUpDown.Maximum>
                                        <MultiBinding Converter="{StaticResource MaximumValueConverter}" Mode="OneWay">
                                            <Binding RelativeSource="{RelativeSource Mode=Self}" Path="Minimum" FallbackValue="0"/>
                                            <Binding ElementName="RightCropNumericUpDown" Path="Value" />
                                            <Binding ElementName="RightCropNumericUpDown" Path="Minimum" FallbackValue="0"/>
                                        </MultiBinding>
                                    </n:IntegerUpDown.Maximum>
                                </n:IntegerUpDown>

                                <TextBlock Grid.Row="2" Grid.Column="0" Text="{DynamicResource S.Crop.Bottom}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:IntegerUpDown Grid.Row="2" Grid.Column="1" x:Name="BottomCropNumericUpDown" Minimum="10" Margin="10,3" 
                                                 MinWidth="70" ValueChanged="CropIntegerUpDown_ValueChanged">
                                    <n:IntegerUpDown.Maximum>
                                        <MultiBinding Converter="{StaticResource MaximumValueConverter}">
                                            <Binding RelativeSource="{RelativeSource Mode=Self}" Path="Minimum" FallbackValue="0"/>
                                            <Binding ElementName="CropAreaGrid" Path="Height" FallbackValue="0"/>
                                            <!--<Binding ElementName="TopCropNumericUpDown" Path="Value" FallbackValue="0"/>-->
                                        </MultiBinding>
                                    </n:IntegerUpDown.Maximum>
                                </n:IntegerUpDown>

                                <TextBlock Grid.Row="3" Grid.Column="0" Text="{DynamicResource S.Crop.Right}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:IntegerUpDown Grid.Row="3" Grid.Column="1" x:Name="RightCropNumericUpDown" Minimum="10" Margin="10,3" 
                                                 MinWidth="70" ValueChanged="CropIntegerUpDown_ValueChanged">
                                    <n:IntegerUpDown.Maximum>
                                        <MultiBinding Converter="{StaticResource MaximumValueConverter}" Mode="OneWay">
                                            <Binding RelativeSource="{RelativeSource Mode=Self}" Path="Minimum" FallbackValue="0"/>
                                            <Binding ElementName="CropAreaGrid" Path="Width" FallbackValue="0"/>
                                            <!--<Binding ElementName="LeftCropNumericUpDown" Path="Value" FallbackValue="0"/>-->
                                        </MultiBinding>
                                    </n:IntegerUpDown.Maximum>
                                </n:IntegerUpDown>
                            </Grid>
                        </Grid>

                        <Grid x:Name="FlipRotateGrid" Visibility="Collapsed">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="27"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <n:LabelSeparator Grid.Row="0" Text="{DynamicResource S.Editor.Image.FlipRotate}"/>
                            <Grid Grid.Row="1" Margin="10,0" HorizontalAlignment="Center">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>

                                <n:ExtendedRadioButton Grid.Row="0" x:Name="FlipHorizontalRadioButton" Text="{DynamicResource S.FlipRotate.FlipHorizontal}"
                                                       Icon="{StaticResource Vector.FlipHorizontal}" Cursor="Hand" ContentWidth="25" ContentHeight="25" Padding="0,5"
                                                       IsChecked="True"/>

                                <n:ExtendedRadioButton Grid.Row="1" x:Name="FlipVerticalRadioButton" Text="{DynamicResource S.FlipRotate.FlipVertical}"
                                                       Icon="{StaticResource Vector.FlipVertical}" Cursor="Hand" ContentWidth="25" ContentHeight="25" Padding="0,5"/>


                                <n:ExtendedRadioButton Grid.Row="2" x:Name="RotateLeftRadioButton" Text="{DynamicResource S.FlipRotate.RotateLeft}"
                                                       Icon="{StaticResource Vector.RotateLeft90}" Cursor="Hand" ContentWidth="25" ContentHeight="25" Padding="0,5"/>


                                <n:ExtendedRadioButton Grid.Row="3" x:Name="RotateRightRadioButton" Text="{DynamicResource S.FlipRotate.RotateRight}"
                                                       Icon="{StaticResource Vector.RotateRight90}" Cursor="Hand" ContentWidth="25" ContentHeight="25" Padding="0,5"/>
                            </Grid>
                        </Grid>

                        <Grid x:Name="CaptionGrid" Visibility="Collapsed">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="27"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <n:LabelSeparator Grid.Row="0" Text="{DynamicResource S.Caption.Text}"/>
                            <n:ExtendedTextBox Grid.Row="1" x:Name="CaptionTextBox" Margin="10,5,5,5" AcceptsReturn="True" AcceptsTab="True"
                                               Text="{Binding Source={x:Static t:UserSettings.All}, Path=CaptionText}"/>

                            <Expander Grid.Row="2" Header="{DynamicResource S.Caption.Font}" IsExpanded="{Binding IsCaptionFontGroupExpanded, Source={x:Static t:UserSettings.All}}">
                                <Grid Margin="10,0,0,0">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>

                                    <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Caption.Family}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <ComboBox Grid.Row="0" Grid.Column="1" x:Name="CaptionFontComboBox" Margin="10,5" MinWidth="100" MaxWidth="150" IsEditable="True"
                                              ItemTemplate="{DynamicResource FontTemplate}" SelectedItem="{Binding Source={x:Static t:UserSettings.All}, Path=CaptionFontFamily}">
                                        <ComboBox.ItemsSource>
                                            <Binding Source="{StaticResource MyFonts}"/>
                                        </ComboBox.ItemsSource>

                                        <ComboBox.ItemsPanel>
                                            <ItemsPanelTemplate>
                                                <VirtualizingStackPanel VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Recycling"/>
                                            </ItemsPanelTemplate>
                                        </ComboBox.ItemsPanel>
                                    </ComboBox>

                                    <TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource S.Caption.Style}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <ComboBox Grid.Row="1" Grid.Column="1" x:Name="CaptionFontStyleComboBox" Margin="10,5" MinWidth="100"
                                              SelectedValuePath="FontStyle" SelectedValue="{Binding Source={x:Static t:UserSettings.All}, Path=CaptionFontStyle}">
                                        <ComboBox.ItemTemplate>
                                            <DataTemplate>
                                                <VirtualizingStackPanel IsVirtualizing="True" VirtualizationMode="Recycling" ScrollViewer.IsDeferredScrollingEnabled="True">
                                                    <TextBlock FontStyle="{Binding FontStyle}" FontSize="14" Text="{Binding Text}"/>
                                                </VirtualizingStackPanel>
                                            </DataTemplate>
                                        </ComboBox.ItemTemplate>

                                        <TextBlock FontStyle="Normal" Text="{DynamicResource S.FontStyles.Normal}"/>
                                        <TextBlock FontStyle="Italic" Text="{DynamicResource S.FontStyles.Italic}"/>
                                        <TextBlock FontStyle="Oblique" Text="{DynamicResource S.FontStyles.Oblique}"/>
                                    </ComboBox>

                                    <TextBlock Grid.Row="2" Grid.Column="0" Text="{DynamicResource S.Caption.Weight}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <ComboBox Grid.Row="2" Grid.Column="1" x:Name="CaptionFontWeightComboBox" Margin="10,5" MinWidth="100"
                                              SelectedValuePath="FontWeight" SelectedValue="{Binding Source={x:Static t:UserSettings.All}, Path=CaptionFontWeight}">
                                        <ComboBox.ItemTemplate>
                                            <DataTemplate>
                                                <VirtualizingStackPanel IsVirtualizing="True" VirtualizationMode="Recycling" ScrollViewer.IsDeferredScrollingEnabled="True">
                                                    <TextBlock FontWeight="{Binding FontWeight}" FontSize="14" Text="{Binding Text}" />
                                                </VirtualizingStackPanel>
                                            </DataTemplate>
                                        </ComboBox.ItemTemplate>

                                        <TextBlock FontWeight="UltraLight" Text="{DynamicResource S.FontWeights.UltraLight}"/>
                                        <TextBlock FontWeight="ExtraLight" Text="{DynamicResource S.FontWeights.ExtraLight}"/>
                                        <TextBlock FontWeight="Light" Text="{DynamicResource S.FontWeights.Light}"/>
                                        <TextBlock FontWeight="Thin" Text="{DynamicResource S.FontWeights.Thin}"/>
                                        <TextBlock FontWeight="Normal" Text="{DynamicResource S.FontWeights.Normal}"/>
                                        <TextBlock FontWeight="Regular" Text="{DynamicResource S.FontWeights.Regular}"/>
                                        <TextBlock FontWeight="Medium" Text="{DynamicResource S.FontWeights.Medium}"/>
                                        <TextBlock FontWeight="SemiBold" Text="{DynamicResource S.FontWeights.SemiBold}"/>
                                        <TextBlock FontWeight="DemiBold" Text="{DynamicResource S.FontWeights.DemiBold}"/>
                                        <TextBlock FontWeight="Bold" Text="{DynamicResource S.FontWeights.Bold}"/>
                                        <TextBlock FontWeight="Black" Text="{DynamicResource S.FontWeights.Black}"/>
                                        <TextBlock FontWeight="Heavy" Text="{DynamicResource S.FontWeights.Heavy}"/>
                                        <TextBlock FontWeight="ExtraBold" Text="{DynamicResource S.FontWeights.ExtraBold}"/>
                                        <TextBlock FontWeight="ExtraBlack" Text="{DynamicResource S.FontWeights.ExtraBlack}"/>
                                        <TextBlock FontWeight="UltraBold" Text="{DynamicResource S.FontWeights.UltraBold}"/>
                                        <TextBlock FontWeight="UltraBlack" Text="{DynamicResource S.FontWeights.UltraBlack}"/>
                                    </ComboBox>

                                    <TextBlock Grid.Row="3" Grid.Column="0" Text="{DynamicResource S.Caption.Size}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <n:IntegerUpDown Grid.Row="3" Grid.Column="1" x:Name="CaptionFontSizeNumericUpDown" Minimum="10" Maximum="1000" Margin="10,5" MinWidth="70" 
                                                     Value="{Binding Source={x:Static t:UserSettings.All}, Path=CaptionFontSize, Mode=TwoWay}"/>

                                    <TextBlock Grid.Row="4" Grid.Column="0" Text="{DynamicResource S.Caption.Color}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <n:ColorBox Grid.Row="4" Grid.Column="1" x:Name="CaptionFontColorBox" Margin="10,5"
                                                SelectedColor="{Binding CaptionFontColor, Source={x:Static t:UserSettings.All}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                                </Grid>
                            </Expander>

                            <Expander Grid.Row="3" Header="{DynamicResource S.Caption.Outline}" IsExpanded="{Binding IsCaptionOutlineGroupExpanded, Source={x:Static t:UserSettings.All}}">
                                <Grid Margin="10,0,0,0">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>

                                    <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Caption.Thickness}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <n:IntegerUpDown Grid.Row="0" Grid.Column="1" x:Name="CaptionOutlineThicknessNumericUpDown" Minimum="0" Maximum="20" Margin="10,5" MinWidth="70" 
                                                     Value="{Binding Source={x:Static t:UserSettings.All}, Path=CaptionOutlineThickness, Mode=TwoWay}"/>

                                    <TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource S.Caption.Color}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <n:ColorBox Grid.Row="1" Grid.Column="1" x:Name="CaptionOutlineColorBox" Margin="10,5"
                                                SelectedColor="{Binding CaptionOutlineColor, Source={x:Static t:UserSettings.All}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                                </Grid>
                            </Expander>

                            <Expander Grid.Row="4" Header="{DynamicResource S.Caption.Layout}" IsExpanded="{Binding IsCaptionLayoutGroupExpanded, Source={x:Static t:UserSettings.All}}">
                                <Grid Margin="10,0,0,0">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>

                                    <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Caption.Vertical}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <ComboBox Grid.Row="0" Grid.Column="1" x:Name="CaptionVerticalAligmentComboBox" Margin="10,5" MinWidth="100" MaxWidth="110"
                                              SelectedValuePath="VerticalAlignment" SelectedValue="{Binding Source={x:Static t:UserSettings.All}, Path=CaptionVerticalAligment, Mode=TwoWay}">

                                        <TextBlock VerticalAlignment="Top" Text="{DynamicResource S.VerticalAlignment.Top}"/>
                                        <TextBlock VerticalAlignment="Center" Text="{DynamicResource S.VerticalAlignment.Center}"/>
                                        <TextBlock VerticalAlignment="Bottom" Text="{DynamicResource S.VerticalAlignment.Bottom}"/>
                                    </ComboBox>

                                    <TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource S.Caption.Horizontal}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <ComboBox Grid.Row="1" Grid.Column="1" x:Name="CaptionHorizontalAligmentComboBox" Margin="10,5" MinWidth="100" MaxWidth="110" 
                                              SelectedValuePath="HorizontalAlignment" SelectedValue="{Binding Source={x:Static t:UserSettings.All}, Path=CaptionHorizontalAligment, Mode=TwoWay}">

                                        <TextBlock HorizontalAlignment="Left" Text="{DynamicResource S.HorizontalAlignment.Left}"/>
                                        <TextBlock HorizontalAlignment="Center" Text="{DynamicResource S.HorizontalAlignment.Center}"/>
                                        <TextBlock HorizontalAlignment="Right" Text="{DynamicResource S.HorizontalAlignment.Right}"/>
                                    </ComboBox>

                                    <TextBlock Grid.Row="2" Grid.Column="0" Text="{DynamicResource S.Margin}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <n:IntegerUpDown Grid.Row="2" Grid.Column="1" x:Name="CaptionMarginNumericUpDown" Minimum="-100" Maximum="100" Margin="10,5" MinWidth="70" 
                                                     Value="{Binding Source={x:Static t:UserSettings.All}, Path=CaptionMargin, Mode=TwoWay}"/>
                                </Grid>
                            </Expander>
                        </Grid>

                        <Grid x:Name="FreeTextGrid" Visibility="Collapsed">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="27"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="27"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <n:LabelSeparator Grid.Row="0" Text="{DynamicResource S.Caption.Text}"/>
                            <n:ExtendedTextBox Grid.Row="1" x:Name="FreeTextTextBox"  Margin="10,5,5,5" AcceptsReturn="True" AcceptsTab="True"
                                               Text="{Binding Source={x:Static t:UserSettings.All}, Path=FreeTextText, Mode=TwoWay}"
                                               TextChanged="FreeTextTextBox_OnTextChanged"/>

                            <Expander Grid.Row="2" Header="{DynamicResource S.Caption.Font}" IsExpanded="{Binding IsFreeTextFontGroupExpanded, Source={x:Static t:UserSettings.All}}">
                                <Grid Margin="10,0,0,0">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>

                                    <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Caption.Family}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <ComboBox Grid.Row="0" Grid.Column="1" x:Name="FreeTextFontComboBox" Margin="10,5" MinWidth="100" MaxWidth="150" IsEditable="True"
                                              ItemTemplate="{DynamicResource FontTemplate}" 
                                              SelectedItem="{Binding Source={x:Static t:UserSettings.All}, Path=FreeTextFontFamily, Mode=TwoWay}">
                                        <ComboBox.ItemsSource>
                                            <Binding Source="{StaticResource MyFonts}" />
                                        </ComboBox.ItemsSource>

                                        <ComboBox.ItemsPanel>
                                            <ItemsPanelTemplate>
                                                <VirtualizingStackPanel VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Recycling"/>
                                            </ItemsPanelTemplate>
                                        </ComboBox.ItemsPanel>
                                    </ComboBox>

                                    <TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource S.Caption.Style}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <ComboBox Grid.Row="1" Grid.Column="1" x:Name="FreeTextFontStyleComboBox" Margin="10,5" MinWidth="100"
                                              SelectedValuePath="FontStyle" SelectedValue="{Binding Source={x:Static t:UserSettings.All}, Path=FreeTextFontStyle, Mode=TwoWay}">
                                        <ComboBox.ItemTemplate>
                                            <DataTemplate>
                                                <VirtualizingStackPanel IsVirtualizing="True" VirtualizationMode="Recycling" ScrollViewer.IsDeferredScrollingEnabled="True">
                                                    <TextBlock FontStyle="{Binding FontStyle}" FontSize="14" Text="{Binding Text}"/>
                                                </VirtualizingStackPanel>
                                            </DataTemplate>
                                        </ComboBox.ItemTemplate>

                                        <TextBlock FontStyle="Normal" Text="{DynamicResource S.FontStyles.Normal}"/>
                                        <TextBlock FontStyle="Italic" Text="{DynamicResource S.FontStyles.Italic}"/>
                                        <TextBlock FontStyle="Oblique" Text="{DynamicResource S.FontStyles.Oblique}"/>
                                    </ComboBox>

                                    <TextBlock Grid.Row="2" Grid.Column="0" Text="{DynamicResource S.Caption.Weight}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <ComboBox Grid.Row="2" Grid.Column="1" x:Name="FreeTextFontWeightComboBox" Margin="10,5" MinWidth="100"
                                              SelectedValuePath="FontWeight" SelectedValue="{Binding Source={x:Static t:UserSettings.All}, Path=FreeTextFontWeight, Mode=TwoWay}">
                                        <ComboBox.ItemTemplate>
                                            <DataTemplate>
                                                <VirtualizingStackPanel IsVirtualizing="True" VirtualizationMode="Recycling" ScrollViewer.IsDeferredScrollingEnabled="True">
                                                    <TextBlock FontWeight="{Binding FontWeight}" FontSize="14" Text="{Binding Text}"/>
                                                </VirtualizingStackPanel>
                                            </DataTemplate>
                                        </ComboBox.ItemTemplate>

                                        <TextBlock FontWeight="UltraLight" Text="{DynamicResource S.FontWeights.UltraLight}"/>
                                        <TextBlock FontWeight="ExtraLight" Text="{DynamicResource S.FontWeights.ExtraLight}"/>
                                        <TextBlock FontWeight="Light" Text="{DynamicResource S.FontWeights.Light}"/>
                                        <TextBlock FontWeight="Thin" Text="{DynamicResource S.FontWeights.Thin}"/>
                                        <TextBlock FontWeight="Normal" Text="{DynamicResource S.FontWeights.Normal}"/>
                                        <TextBlock FontWeight="Regular" Text="{DynamicResource S.FontWeights.Regular}"/>
                                        <TextBlock FontWeight="Medium" Text="{DynamicResource S.FontWeights.Medium}"/>
                                        <TextBlock FontWeight="SemiBold" Text="{DynamicResource S.FontWeights.SemiBold}"/>
                                        <TextBlock FontWeight="DemiBold" Text="{DynamicResource S.FontWeights.DemiBold}"/>
                                        <TextBlock FontWeight="Bold" Text="{DynamicResource S.FontWeights.Bold}"/>
                                        <TextBlock FontWeight="Black" Text="{DynamicResource S.FontWeights.Black}"/>
                                        <TextBlock FontWeight="Heavy" Text="{DynamicResource S.FontWeights.Heavy}"/>
                                        <TextBlock FontWeight="ExtraBold" Text="{DynamicResource S.FontWeights.ExtraBold}"/>
                                        <TextBlock FontWeight="ExtraBlack" Text="{DynamicResource S.FontWeights.ExtraBlack}"/>
                                        <TextBlock FontWeight="UltraBold" Text="{DynamicResource S.FontWeights.UltraBold}"/>
                                        <TextBlock FontWeight="UltraBlack" Text="{DynamicResource S.FontWeights.UltraBlack}"/>
                                    </ComboBox>

                                    <TextBlock Grid.Row="3" Grid.Column="0" Text="{DynamicResource S.Caption.Size}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <n:IntegerUpDown Grid.Row="3" Grid.Column="1" x:Name="FreeTextFontSizeNumericUpDown" Minimum="10" Maximum="1000" Margin="10,5" MinWidth="70" 
                                                     Value="{Binding Source={x:Static t:UserSettings.All}, Path=FreeTextFontSize, Mode=TwoWay}"/>

                                    <TextBlock Grid.Row="4" Grid.Column="0" Text="{DynamicResource S.Caption.Color}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <n:ColorBox Grid.Row="4" Grid.Column="1" x:Name="FreeTextFontColorBox" Margin="10,5"
                                                SelectedColor="{Binding FreeTextFontColor, Source={x:Static t:UserSettings.All}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>

                                    <TextBlock Grid.Row="5" Grid.Column="0" Text="{DynamicResource S.Caption.TextDecoration}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <ComboBox Grid.Row="5" Grid.Column="1" x:Name="FreeTextTextDecorationComboBox" Margin="10,5" MinWidth="100"
                                              SelectedValuePath="Tag" SelectedValue="{Binding Source={x:Static t:UserSettings.All}, Path=FreeTextTextDecoration, Mode=TwoWay}">
                                        <ComboBox.ItemTemplate>
                                            <DataTemplate>
                                                <VirtualizingStackPanel IsVirtualizing="True" VirtualizationMode="Recycling" ScrollViewer.IsDeferredScrollingEnabled="True">
                                                    <TextBlock TextDecorations="{Binding TextDecorations}" FontSize="14" Text="{Binding Text}"/>
                                                </VirtualizingStackPanel>
                                            </DataTemplate>
                                        </ComboBox.ItemTemplate>

                                        <TextBlock TextDecorations="None" Tag="None" Text="{DynamicResource S.TextDecorations.None}"/>
                                        <TextBlock TextDecorations="Underline" Tag="Underline" Text="{DynamicResource S.TextDecorations.Underline}"/>
                                        <TextBlock TextDecorations="Strikethrough" Tag="Strikethrough" Text="{DynamicResource S.TextDecorations.Strikethrough}"/>
                                        <TextBlock TextDecorations="OverLine" Tag="OverLine" Text="{DynamicResource S.TextDecorations.OverLine}"/>
                                        <TextBlock TextDecorations="Baseline" Tag="Baseline" Text="{DynamicResource S.TextDecorations.Baseline}"/>
                                    </ComboBox>
                                </Grid>
                            </Expander>

                            <Expander Grid.Row="3" Header="{DynamicResource S.Editor.Image.Shadow}" IsExpanded="{Binding Source={x:Static t:UserSettings.All}, Path=IsFreeTextShadowGroupExpanded, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
                                <Grid Margin="10,0,0,0">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <Grid.Resources>
                                        <c:PercentageToOpacity x:Key="PercentageToOpacity"/>
                                    </Grid.Resources>

                                    <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Shadow.ShadowColor}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <n:ColorBox Grid.Row="0" Grid.Column="1" Margin="10,5" AllowTransparency="False" SelectedColor="{Binding Source={x:Static t:UserSettings.All}, Path=FreeTextShadowColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>

                                    <TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource S.Shadow.BlurRadius}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <n:DoubleUpDown Grid.Row="1" Grid.Column="1" Minimum="0" Maximum="100" Margin="10,5" StepValue="0.5" Value="{Binding Source={x:Static t:UserSettings.All}, Path=FreeTextShadowBlurRadius, Mode=TwoWay}"/>

                                    <TextBlock Grid.Row="2" Grid.Column="0" Text="{DynamicResource S.Shadow.Direction}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <n:DoubleUpDown Grid.Row="2" Grid.Column="1" Minimum="0" Maximum="360" Margin="10,5" StepValue="0.5" Value="{Binding Source={x:Static t:UserSettings.All}, Path=FreeTextShadowDirection, Mode=TwoWay}"/>

                                    <TextBlock Grid.Row="3" Grid.Column="0" Text="{DynamicResource S.Watermark.Opacity}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <n:DoubleUpDown Grid.Row="3" Grid.Column="1" Minimum="0" Maximum="100" Margin="10,5" StepValue="0.5" Value="{Binding Source={x:Static t:UserSettings.All}, Path=FreeTextShadowOpacity, Converter={StaticResource PercentageToOpacity}, Mode=TwoWay}"/>

                                    <TextBlock Grid.Row="4" Grid.Column="0" Text="{DynamicResource S.Shadow.Depth}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <n:DoubleUpDown Grid.Row="4" Grid.Column="1" Minimum="0" Maximum="100" Margin="10,5" StepValue="0.5" Value="{Binding Source={x:Static t:UserSettings.All}, Path=FreeTextShadowDepth, Mode=TwoWay}"/>
                                </Grid>
                            </Expander>
                            
                            <n:LabelSeparator Grid.Row="4" Text="{DynamicResource S.Caption.Layout}"/>
                            <Grid Grid.Row="5" Margin="10,0,0,0">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Crop.Left}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:IntegerUpDown Grid.Row="0" Grid.Column="1" x:Name="FreeTextPositionXNumericUpDown" Margin="10,5" MinWidth="70" 
                                                 Value="{Binding ElementName=FreeTextOverlayControl, Path=Left, Converter={StaticResource DoubleToIntConverter}, Mode=TwoWay, FallbackValue=0}"
                                                 Maximum="{Binding ElementName=FreeTextOverlayControl, Path=ActualWidth, FallbackValue=1000}"/>

                                <TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource S.Crop.Top}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:IntegerUpDown Grid.Row="1" Grid.Column="1" x:Name="FreeTextPositionYNumericUpDown" Margin="10,5" MinWidth="70" 
                                                 Value="{Binding ElementName=FreeTextOverlayControl, Path=Top, Converter={StaticResource DoubleToIntConverter}, Mode=TwoWay, FallbackValue=0}"
                                                 Maximum="{Binding ElementName=FreeTextOverlayControl, Path=ActualHeight, FallbackValue=1000}"/>

                                <TextBlock Grid.Row="2" Grid.Column="0" Text="{DynamicResource S.Caption.TextAlignment}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <ComboBox Grid.Row="2" Grid.Column="1" x:Name="FreeTextTextAlignmentComboBox" Margin="10,5" MinWidth="70"
                                              SelectedValuePath="TextAlignment" SelectedValue="{Binding Source={x:Static t:UserSettings.All}, Path=FreeTextTextAlignment, Mode=TwoWay}">
                                    <ComboBox.ItemTemplate>
                                        <DataTemplate>
                                            <VirtualizingStackPanel IsVirtualizing="True" VirtualizationMode="Recycling" ScrollViewer.IsDeferredScrollingEnabled="True">
                                                <TextBlock FontStyle="{Binding FontStyle}" FontSize="14" Text="{Binding Text}"/>
                                            </VirtualizingStackPanel>
                                        </DataTemplate>
                                    </ComboBox.ItemTemplate>

                                    <TextBlock TextAlignment="Left" Text="{DynamicResource S.TextAlignment.Left}"/>
                                    <TextBlock TextAlignment="Center" Text="{DynamicResource S.TextAlignment.Center}"/>
                                    <TextBlock TextAlignment="Right" Text="{DynamicResource S.TextAlignment.Right}"/>
                                    <TextBlock TextAlignment="Justify" Text="{DynamicResource S.TextAlignment.Justify}"/>
                                </ComboBox>

                                <TextBlock Grid.Row="3" Grid.Column="0" Text="{DynamicResource S.FreeDrawing.Width}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:IntegerUpDown Grid.Row="3" Grid.Column="1" x:Name="FreeTextWidthNumericUpDown" Margin="10,5" MinWidth="70">
                                    <n:IntegerUpDown.Style>
                                        <Style>
                                            <Style.Triggers>
                                                <DataTrigger Binding="{Binding ElementName=FreeTextTextAlignmentComboBox, Path=SelectedValue}" Value="Justify">
                                                    <Setter Property="n:IntegerUpDown.IsEnabled" Value="True"/>
                                                    <Setter Property="n:IntegerUpDown.Value" Value="{Binding ElementName=FreeTextTextBlock, Path=ActualWidth, FallbackValue=0}"/>
                                                </DataTrigger>
                                            </Style.Triggers>
                                            <Style.Setters>
                                                <Setter Property="n:IntegerUpDown.IsEnabled" Value="False"/>
                                                <Setter Property="n:IntegerUpDown.Value" Value="{Binding ElementName=FreeTextTextBlock, Path=ActualWidth, FallbackValue=0}"/>
                                            </Style.Setters>
                                        </Style>
                                    </n:IntegerUpDown.Style>
                                </n:IntegerUpDown>
                            </Grid>
                        </Grid>

                        <Grid x:Name="TitleFrameGrid" Visibility="Collapsed">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="27"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="27"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="27"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="27"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <n:LabelSeparator Grid.Row="0" Text="{DynamicResource S.Caption.Text}"/>
                            <n:ExtendedTextBox Grid.Row="1" x:Name="TitleFrameTextBox" Margin="10,5,5,5" AcceptsReturn="True" AcceptsTab="True"
                                               Text="{Binding Source={x:Static t:UserSettings.All}, Path=TitleFrameText, Mode=TwoWay}"/>

                            <Expander Grid.Row="2" Header="{DynamicResource S.Caption.Font}" IsExpanded="{Binding IsTitleFrameFontGroupExpanded, Source={x:Static t:UserSettings.All}}">
                                <Grid Margin="10,0,0,0">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>

                                    <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Caption.Family}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <ComboBox Grid.Row="0" Grid.Column="1" x:Name="TitleFrameFontComboBox" Margin="10,5" MinWidth="100" MaxWidth="150" IsEditable="True"
                                              ItemTemplate="{DynamicResource FontTemplate}" SelectedItem="{Binding Source={x:Static t:UserSettings.All}, Path=TitleFrameFontFamily, Mode=TwoWay}">
                                        <ComboBox.ItemsSource>
                                            <Binding Source="{StaticResource MyFonts}" />
                                        </ComboBox.ItemsSource>
                                        <ComboBox.ItemsPanel>
                                            <ItemsPanelTemplate>
                                                <VirtualizingStackPanel VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Recycling"/>
                                            </ItemsPanelTemplate>
                                        </ComboBox.ItemsPanel>
                                    </ComboBox>

                                    <TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource S.Caption.Style}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <ComboBox Grid.Row="1" Grid.Column="1" x:Name="TitleFrameFontStyleComboBox" Margin="10,5" MinWidth="100"
                                              SelectedValuePath="FontStyle" SelectedValue="{Binding Source={x:Static t:UserSettings.All}, Path=TitleFrameFontStyle, Mode=TwoWay}">
                                        <ComboBox.ItemTemplate>
                                            <DataTemplate>
                                                <VirtualizingStackPanel IsVirtualizing="True" VirtualizationMode="Recycling" ScrollViewer.IsDeferredScrollingEnabled="True">
                                                    <TextBlock FontStyle="{Binding FontStyle}" FontSize="14" Text="{Binding Text}"/>
                                                </VirtualizingStackPanel>
                                            </DataTemplate>
                                        </ComboBox.ItemTemplate>

                                        <TextBlock FontStyle="Normal" Text="{DynamicResource S.FontStyles.Normal}"/>
                                        <TextBlock FontStyle="Italic" Text="{DynamicResource S.FontStyles.Italic}"/>
                                        <TextBlock FontStyle="Oblique" Text="{DynamicResource S.FontStyles.Oblique}"/>
                                    </ComboBox>

                                    <TextBlock Grid.Row="2" Grid.Column="0" Text="{DynamicResource S.Caption.Weight}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <ComboBox Grid.Row="2" Grid.Column="1" x:Name="TitleFrameFontWeightComboBox" Margin="10,5" MinWidth="100"
                                              SelectedValuePath="FontWeight" SelectedValue="{Binding Source={x:Static t:UserSettings.All}, Path=TitleFrameFontWeight, Mode=TwoWay}">
                                        <ComboBox.ItemTemplate>
                                            <DataTemplate>
                                                <VirtualizingStackPanel IsVirtualizing="True" VirtualizationMode="Recycling" ScrollViewer.IsDeferredScrollingEnabled="True">
                                                    <TextBlock FontWeight="{Binding FontWeight}" FontSize="14" Text="{Binding Text}" />
                                                </VirtualizingStackPanel>
                                            </DataTemplate>
                                        </ComboBox.ItemTemplate>

                                        <TextBlock FontWeight="UltraLight" Text="{DynamicResource S.FontWeights.UltraLight}"/>
                                        <TextBlock FontWeight="ExtraLight" Text="{DynamicResource S.FontWeights.ExtraLight}"/>
                                        <TextBlock FontWeight="Light" Text="{DynamicResource S.FontWeights.Light}"/>
                                        <TextBlock FontWeight="Thin" Text="{DynamicResource S.FontWeights.Thin}"/>
                                        <TextBlock FontWeight="Normal" Text="{DynamicResource S.FontWeights.Normal}"/>
                                        <TextBlock FontWeight="Regular" Text="{DynamicResource S.FontWeights.Regular}"/>
                                        <TextBlock FontWeight="Medium" Text="{DynamicResource S.FontWeights.Medium}"/>
                                        <TextBlock FontWeight="SemiBold" Text="{DynamicResource S.FontWeights.SemiBold}"/>
                                        <TextBlock FontWeight="DemiBold" Text="{DynamicResource S.FontWeights.DemiBold}"/>
                                        <TextBlock FontWeight="Bold" Text="{DynamicResource S.FontWeights.Bold}"/>
                                        <TextBlock FontWeight="Black" Text="{DynamicResource S.FontWeights.Black}"/>
                                        <TextBlock FontWeight="Heavy" Text="{DynamicResource S.FontWeights.Heavy}"/>
                                        <TextBlock FontWeight="ExtraBold" Text="{DynamicResource S.FontWeights.ExtraBold}"/>
                                        <TextBlock FontWeight="ExtraBlack" Text="{DynamicResource S.FontWeights.ExtraBlack}"/>
                                        <TextBlock FontWeight="UltraBold" Text="{DynamicResource S.FontWeights.UltraBold}"/>
                                        <TextBlock FontWeight="UltraBlack" Text="{DynamicResource S.FontWeights.UltraBlack}"/>
                                    </ComboBox>

                                    <TextBlock Grid.Row="3" Grid.Column="0" Text="{DynamicResource S.Caption.Size}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <n:IntegerUpDown Grid.Row="3" Grid.Column="1" x:Name="TitleFrameFontSizeNumericUpDown" Minimum="5" Maximum="200" Margin="10,5" MinWidth="70" 
                                                     Value="{Binding Source={x:Static t:UserSettings.All}, Path=TitleFrameFontSize, Mode=TwoWay}"/>

                                    <TextBlock Grid.Row="4" Grid.Column="0" Text="{DynamicResource S.Caption.Color}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <n:ColorBox Grid.Row="4" Grid.Column="1" x:Name="TitleFrameFontColorBox" Margin="10,5"
                                                SelectedColor="{Binding TitleFrameFontColor, Source={x:Static t:UserSettings.All}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                                </Grid>
                            </Expander>

                            <n:LabelSeparator Grid.Row="3" Text="{DynamicResource S.Delay}"/>
                            <Grid Grid.Row="4" Margin="10,0,0,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock Grid.Column="0" Text="{DynamicResource S.DelayMs}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:IntegerUpDown Grid.Column="1" x:Name="TitleFrameDelayIntegerUpDown" Minimum="10" Maximum="25500" Margin="10,5" MinWidth="70" 
                                                 Value="{Binding Source={x:Static t:UserSettings.All}, Path=TitleFrameDelay, Mode=TwoWay}"/>
                            </Grid>

                            <n:LabelSeparator Grid.Row="5" Text="{DynamicResource S.Caption.Layout}"/>
                            <Grid Grid.Row="6" Margin="10,0,0,0">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Caption.Vertical}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <ComboBox Grid.Row="0" Grid.Column="1" x:Name="TitleFrameVerticalAligmentComboBox" Margin="10,5" MinWidth="100" MaxWidth="150"
                                          SelectedValuePath="VerticalAlignment" SelectedValue="{Binding Source={x:Static t:UserSettings.All}, Path=TitleFrameVerticalAligment, Mode=TwoWay}">

                                    <TextBlock VerticalAlignment="Top" Text="{DynamicResource S.VerticalAlignment.Top}"/>
                                    <TextBlock VerticalAlignment="Center" Text="{DynamicResource S.VerticalAlignment.Center}"/>
                                    <TextBlock VerticalAlignment="Bottom" Text="{DynamicResource S.VerticalAlignment.Bottom}"/>
                                </ComboBox>

                                <TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource S.Caption.Horizontal}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <ComboBox Grid.Row="1" Grid.Column="1" x:Name="TitleFrameHorizontalAligmentComboBox" Margin="10,5" MinWidth="100" MaxWidth="150" 
                                          SelectedValuePath="HorizontalAlignment" SelectedValue="{Binding Source={x:Static t:UserSettings.All}, Path=TitleFrameHorizontalAligment, Mode=TwoWay}">

                                    <TextBlock HorizontalAlignment="Left" Text="{DynamicResource S.HorizontalAlignment.Left}"/>
                                    <TextBlock HorizontalAlignment="Center" Text="{DynamicResource S.HorizontalAlignment.Center}"/>
                                    <TextBlock HorizontalAlignment="Right" Text="{DynamicResource S.HorizontalAlignment.Right}"/>
                                </ComboBox>

                                <TextBlock Grid.Row="2" Grid.Column="0" Text="{DynamicResource S.Margin}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:IntegerUpDown Grid.Row="2" Grid.Column="1" x:Name="TitleFrameMarginNumericUpDown" Minimum="-100" Maximum="100" Margin="10,5" MinWidth="70" 
                                                 Value="{Binding Source={x:Static t:UserSettings.All}, Path=TitleFrameMargin, Mode=TwoWay}"/>
                            </Grid>

                            <n:LabelSeparator Grid.Row="7" Text="{DynamicResource S.Background}"/>
                            <Grid Grid.Row="8" Margin="10,0,0,0">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Caption.Color}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:ColorBox Grid.Row="0" Grid.Column="1" x:Name="TitleFrameBackgroundColorBox" Margin="10,5"
                                            SelectedColor="{Binding TitleFrameBackgroundColor, Source={x:Static t:UserSettings.All}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                            </Grid>
                        </Grid>

                        <Grid x:Name="KeyStrokesGrid" Visibility="Collapsed">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <Expander Grid.Row="0" Header="{DynamicResource S.KeyStrokes.Keys}" IsExpanded="{Binding IsKeyStrokesKeysExpanded, Source={x:Static t:UserSettings.All}}">
                                <Grid Margin="10,0,0,0">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>

                                    <n:ExtendedButton Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Text="{DynamicResource S.KeyStrokes.Edit}" Icon="{StaticResource Vector.Pen}"
                                                      Margin="0,3" ContentWidth="16" ContentHeight="16" HorizontalAlignment="Center" Padding="5" Click="EditKeyStrokesButton_Click"/>

                                    <n:ExtendedCheckBox Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3" Text="{DynamicResource S.KeyStrokes.IgnoreModifiers}" Margin="0,5"
                                                        IsChecked="{Binding Source={x:Static t:UserSettings.All}, Path=KeyStrokesIgnoreNonModifiers, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                                        ToolTip="{DynamicResource S.KeyStrokes.IgnoreModifiers.Info}"/>

                                    <n:ExtendedCheckBox Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" Text="{DynamicResource S.KeyStrokes.Extend}" Margin="0,5"
                                                        IsChecked="{Binding Source={x:Static t:UserSettings.All}, Path=KeyStrokesExtended, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>

                                    <StackPanel Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="3" Orientation="Horizontal" Margin="10,0,0,0" 
                                                Visibility="{Binding Source={x:Static t:UserSettings.All}, Path=KeyStrokesExtended, Converter={StaticResource Bool2Visibility}}">
                                        <TextBlock Text="{DynamicResource S.KeyStrokes.By}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                        <n:IntegerUpDown Minimum="10" Maximum="1000" Margin="5" MinWidth="70" Value="{Binding Source={x:Static t:UserSettings.All}, Path=KeyStrokesDelay, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                                    </StackPanel>

                                    <n:ExtendedCheckBox Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="3" Text="{DynamicResource S.KeyStrokes.Earlier}" Margin="0,5"
                                                        IsChecked="{Binding Source={x:Static t:UserSettings.All}, Path=KeyStrokesEarlier, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>

                                    <StackPanel Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="3" Orientation="Horizontal" Margin="10,0,0,0" 
                                                Visibility="{Binding Source={x:Static t:UserSettings.All}, Path=KeyStrokesEarlier, Converter={StaticResource Bool2Visibility}}">
                                        <TextBlock Text="{DynamicResource S.KeyStrokes.By}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                        <n:IntegerUpDown Minimum="10" Maximum="1000" Margin="5" MinWidth="70" Value="{Binding Source={x:Static t:UserSettings.All}, Path=KeyStrokesEarlierBy, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                                    </StackPanel>

                                    <TextBlock Grid.Row="6" Grid.Column="0" Text="{DynamicResource S.KeyStrokes.Separator}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <n:ExtendedTextBox Grid.Row="6" Grid.Column="1" Margin="5,3" MinWidth="70"
                                                       Text="{Binding Source={x:Static t:UserSettings.All}, Path=KeyStrokesSeparator, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                                </Grid>
                            </Expander>

                            <Expander Grid.Row="1" Header="{DynamicResource S.Caption.Font}" IsExpanded="{Binding IsKeyStrokesFontExpanded, Source={x:Static t:UserSettings.All}}">
                                <Grid Margin="10,0,0,0">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>

                                    <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Caption.Family}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <ComboBox Grid.Row="0" Grid.Column="1" Margin="10,5" MinWidth="100" MaxWidth="150" IsEditable="True"
                                              ItemTemplate="{DynamicResource FontTemplate}" SelectedItem="{Binding Source={x:Static t:UserSettings.All}, Path=KeyStrokesFontFamily}">
                                        <ComboBox.ItemsSource>
                                            <Binding Source="{StaticResource MyFonts}"/>
                                        </ComboBox.ItemsSource>

                                        <ComboBox.ItemsPanel>
                                            <ItemsPanelTemplate>
                                                <VirtualizingStackPanel VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Recycling"/>
                                            </ItemsPanelTemplate>
                                        </ComboBox.ItemsPanel>
                                    </ComboBox>

                                    <TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource S.Caption.Style}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <ComboBox Grid.Row="1" Grid.Column="1" Margin="10,5" MinWidth="100" SelectedValuePath="FontStyle" 
                                              SelectedValue="{Binding Source={x:Static t:UserSettings.All}, Path=KeyStrokesFontStyle}">
                                        <ComboBox.ItemTemplate>
                                            <DataTemplate>
                                                <VirtualizingStackPanel IsVirtualizing="True" VirtualizationMode="Recycling" ScrollViewer.IsDeferredScrollingEnabled="True">
                                                    <TextBlock FontStyle="{Binding FontStyle}" FontSize="14" Text="{Binding Text}"/>
                                                </VirtualizingStackPanel>
                                            </DataTemplate>
                                        </ComboBox.ItemTemplate>

                                        <TextBlock FontStyle="Normal" Text="{DynamicResource S.FontStyles.Normal}"/>
                                        <TextBlock FontStyle="Italic" Text="{DynamicResource S.FontStyles.Italic}"/>
                                        <TextBlock FontStyle="Oblique" Text="{DynamicResource S.FontStyles.Oblique}"/>
                                    </ComboBox>

                                    <TextBlock Grid.Row="2" Grid.Column="0" Text="{DynamicResource S.Caption.Weight}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <ComboBox Grid.Row="2" Grid.Column="1" Margin="10,5" MinWidth="100" SelectedValuePath="FontWeight" 
                                              SelectedValue="{Binding Source={x:Static t:UserSettings.All}, Path=KeyStrokesFontWeight}">
                                        <ComboBox.ItemTemplate>
                                            <DataTemplate>
                                                <VirtualizingStackPanel IsVirtualizing="True" VirtualizationMode="Recycling" ScrollViewer.IsDeferredScrollingEnabled="True">
                                                    <TextBlock FontWeight="{Binding FontWeight}" FontSize="14" Text="{Binding Text}" />
                                                </VirtualizingStackPanel>
                                            </DataTemplate>
                                        </ComboBox.ItemTemplate>

                                        <TextBlock FontWeight="UltraLight" Text="{DynamicResource S.FontWeights.UltraLight}"/>
                                        <TextBlock FontWeight="ExtraLight" Text="{DynamicResource S.FontWeights.ExtraLight}"/>
                                        <TextBlock FontWeight="Light" Text="{DynamicResource S.FontWeights.Light}"/>
                                        <TextBlock FontWeight="Thin" Text="{DynamicResource S.FontWeights.Thin}"/>
                                        <TextBlock FontWeight="Normal" Text="{DynamicResource S.FontWeights.Normal}"/>
                                        <TextBlock FontWeight="Regular" Text="{DynamicResource S.FontWeights.Regular}"/>
                                        <TextBlock FontWeight="Medium" Text="{DynamicResource S.FontWeights.Medium}"/>
                                        <TextBlock FontWeight="SemiBold" Text="{DynamicResource S.FontWeights.SemiBold}"/>
                                        <TextBlock FontWeight="DemiBold" Text="{DynamicResource S.FontWeights.DemiBold}"/>
                                        <TextBlock FontWeight="Bold" Text="{DynamicResource S.FontWeights.Bold}"/>
                                        <TextBlock FontWeight="Black" Text="{DynamicResource S.FontWeights.Black}"/>
                                        <TextBlock FontWeight="Heavy" Text="{DynamicResource S.FontWeights.Heavy}"/>
                                        <TextBlock FontWeight="ExtraBold" Text="{DynamicResource S.FontWeights.ExtraBold}"/>
                                        <TextBlock FontWeight="ExtraBlack" Text="{DynamicResource S.FontWeights.ExtraBlack}"/>
                                        <TextBlock FontWeight="UltraBold" Text="{DynamicResource S.FontWeights.UltraBold}"/>
                                        <TextBlock FontWeight="UltraBlack" Text="{DynamicResource S.FontWeights.UltraBlack}"/>
                                    </ComboBox>

                                    <TextBlock Grid.Row="3" Grid.Column="0" Text="{DynamicResource S.Caption.Size}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <n:IntegerUpDown Grid.Row="3" Grid.Column="1" Minimum="10" Maximum="1000" Margin="10,5" MinWidth="70" 
                                                     Value="{Binding Source={x:Static t:UserSettings.All}, Path=KeyStrokesFontSize, Mode=TwoWay}"/>

                                    <TextBlock Grid.Row="4" Grid.Column="0" Text="{DynamicResource S.Caption.Color}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <n:ColorBox Grid.Row="4" Grid.Column="1" SelectedColor="{Binding KeyStrokesFontColor, Source={x:Static t:UserSettings.All}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="10,5"/>
                                </Grid>
                            </Expander>

                            <Expander Grid.Row="2" Header="{DynamicResource S.Caption.Outline}" IsExpanded="{Binding IsKeyStrokesOutlineExpanded, Source={x:Static t:UserSettings.All}}">
                                <Grid Margin="10,0,0,0">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>

                                    <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Caption.Thickness}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <n:IntegerUpDown Grid.Row="0" Grid.Column="1" Minimum="0" Maximum="20" Margin="10,5" MinWidth="70" 
                                                     Value="{Binding Source={x:Static t:UserSettings.All}, Path=KeyStrokesOutlineThickness, Mode=TwoWay}"/>

                                    <TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource S.Caption.Color}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <n:ColorBox Grid.Row="1" Grid.Column="1" SelectedColor="{Binding KeyStrokesOutlineColor, Source={x:Static t:UserSettings.All}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="10,5"/>

                                    <TextBlock Grid.Row="2" Grid.Column="0" Text="{DynamicResource S.Background}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <n:ColorBox Grid.Row="2" Grid.Column="1" SelectedColor="{Binding KeyStrokesBackgroundColor, Source={x:Static t:UserSettings.All}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="10,5"/>
                                </Grid>
                            </Expander>

                            <Expander Grid.Row="3" Header="{DynamicResource S.Caption.Layout}" IsExpanded="{Binding IsKeyStrokesLayoutExpanded, Source={x:Static t:UserSettings.All}}">
                                <Grid Margin="10,0,0,0">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>

                                    <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Caption.Vertical}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <ComboBox Grid.Row="0" Grid.Column="1" Margin="10,5" MinWidth="100" MaxWidth="150" SelectedValuePath="VerticalAlignment" 
                                              SelectedValue="{Binding Source={x:Static t:UserSettings.All}, Path=KeyStrokesVerticalAligment, Mode=TwoWay}">

                                        <TextBlock VerticalAlignment="Top" Text="{DynamicResource S.VerticalAlignment.Top}"/>
                                        <TextBlock VerticalAlignment="Center" Text="{DynamicResource S.VerticalAlignment.Center}"/>
                                        <TextBlock VerticalAlignment="Bottom" Text="{DynamicResource S.VerticalAlignment.Bottom}"/>
                                        <TextBlock VerticalAlignment="Stretch" Text="{DynamicResource S.Alignment.Stretch}"/>
                                    </ComboBox>

                                    <TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource S.Caption.Horizontal}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <ComboBox Grid.Row="1" Grid.Column="1" Margin="10,5" MinWidth="100" MaxWidth="150" SelectedValuePath="HorizontalAlignment" 
                                              SelectedValue="{Binding Source={x:Static t:UserSettings.All}, Path=KeyStrokesHorizontalAligment, Mode=TwoWay}">

                                        <TextBlock HorizontalAlignment="Left" Text="{DynamicResource S.HorizontalAlignment.Left}"/>
                                        <TextBlock HorizontalAlignment="Center" Text="{DynamicResource S.HorizontalAlignment.Center}"/>
                                        <TextBlock HorizontalAlignment="Right" Text="{DynamicResource S.HorizontalAlignment.Right}"/>
                                        <TextBlock HorizontalAlignment="Stretch" Text="{DynamicResource S.Alignment.Stretch}"/>
                                    </ComboBox>

                                    <TextBlock Grid.Row="2" Grid.Column="0" Text="{DynamicResource S.Margin}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <n:IntegerUpDown Grid.Row="2" Grid.Column="1" Minimum="-100" Maximum="100" Margin="10,5" MinWidth="70" 
                                                     Value="{Binding Source={x:Static t:UserSettings.All}, Path=KeyStrokesMargin, Mode=TwoWay}"/>

                                    <TextBlock Grid.Row="3" Grid.Column="0" Text="{DynamicResource S.Padding}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <n:IntegerUpDown Grid.Row="3" Grid.Column="1" Minimum="0" Maximum="100" Margin="10,5" MinWidth="70" 
                                                     Value="{Binding Source={x:Static t:UserSettings.All}, Path=KeyStrokesPadding, Mode=TwoWay}"/>

                                    <TextBlock Grid.Row="4" Grid.Column="0" Text="{DynamicResource S.MinHeight}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <n:IntegerUpDown Grid.Row="4" Grid.Column="1" Minimum="0" Maximum="100" Margin="10,5" MinWidth="70" 
                                                     Value="{Binding Source={x:Static t:UserSettings.All}, Path=KeyStrokesMinHeight, Mode=TwoWay}"/>
                                </Grid>
                            </Expander>
                        </Grid>

                        <Grid x:Name="FreeDrawingGrid" Visibility="Collapsed">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="27"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <n:LabelSeparator Grid.Row="0" Text="{DynamicResource S.FreeDrawing.Mode}"/>
                            <Grid Grid.Row="1" Margin="10,0,0,0">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="*"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>

                                <n:ExtendedRadioButton Grid.Row="0" Grid.Column="0" x:Name="PenModeRadioButton" Icon="{StaticResource Vector.Pen}" 
                                                       Text="{DynamicResource S.FreeDrawing.Pen}" Cursor="Hand" ContentWidth="20" ContentHeight="20" Margin="0,2" Padding="2" MinHeight="30" IsChecked="True"/>
                                <n:ExtendedRadioButton Grid.Row="0" Grid.Column="1" x:Name="EraserModeRadioButton" Icon="{StaticResource Vector.Eraser}" 
                                                       Text="{DynamicResource S.FreeDrawing.Eraser}" Cursor="Hand" ContentWidth="20" ContentHeight="20" Margin="0,2" Padding="2" MinHeight="30"/>

                                <n:ExtendedRadioButton Grid.Row="1" Grid.Column="0" x:Name="SelectorModeRadioButton" Icon="{StaticResource Vector.Select}" 
                                                       Text="{DynamicResource S.FreeDrawing.Select}" Cursor="Hand" ContentWidth="20" ContentHeight="20" Margin="0,2" Padding="2" MinHeight="30"/>
                                <n:ExtendedRadioButton Grid.Row="1" Grid.Column="1" x:Name="EraserStrokeModeRadioButton" Icon="{StaticResource Vector.StrokeEraser}" 
                                                       Text="{DynamicResource S.FreeDrawing.StrokeEraser}" Cursor="Hand" ContentWidth="20" ContentHeight="20" Margin="0,2" Padding="2" MinHeight="30"/>
                            </Grid>

                            <n:LabelSeparator Grid.Row="2" Text="{DynamicResource S.FreeDrawing.Pen}" Visibility="{Binding ElementName=PenModeRadioButton, Path=IsChecked, Converter={StaticResource Bool2Visibility}}"/>
                            <Grid Grid.Row="3" Margin="10,0,0,0" Visibility="{Binding ElementName=PenModeRadioButton, Path=IsChecked, Converter={StaticResource Bool2Visibility}}">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.FreeDrawing.Width}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:IntegerUpDown Grid.Row="0" Grid.Column="1" x:Name="FreeDrawingWidthNumericUpDown" Minimum="1" Maximum="100" Margin="10,5" MinWidth="70" 
                                                 Value="{Binding Source={x:Static t:UserSettings.All}, Path=FreeDrawingPenWidth, Mode=TwoWay}"/>

                                <TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource S.FreeDrawing.Height}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:IntegerUpDown Grid.Row="1" Grid.Column="1" x:Name="FreeDrawingHeightNumericUpDown" Minimum="1" Maximum="100" Margin="10,5" MinWidth="70" 
                                                 Value="{Binding Source={x:Static t:UserSettings.All}, Path=FreeDrawingPenHeight, Mode=TwoWay}"/>

                                <TextBlock Grid.Row="2" Grid.Column="0" Text="{DynamicResource S.Caption.Color}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:ColorBox Grid.Row="2" Grid.Column="1" x:Name="FreeDrawingColorBox" Margin="10,5"
                                            SelectedColor="{Binding FreeDrawingColor, Source={x:Static t:UserSettings.All}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />

                                <TextBlock Grid.Row="3" Grid.Column="0" Text="{DynamicResource S.FreeDrawing.Tip}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <Grid Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>

                                    <n:ExtendedRadioButton Grid.Row="0" Grid.Column="0" x:Name="RectangleRadioButton" Icon="{StaticResource Vector.Rectangle}" 
                                                           Text="{DynamicResource S.FreeDrawing.Rectangle}" Cursor="Hand" ContentWidth="20" ContentHeight="20" Margin="3,3" Padding="3"
                                                           IsChecked="{Binding FreeDrawingStylusTip, Source={x:Static t:UserSettings.All},
                                                           Converter={StaticResource StylusTipToBoolConverter}, ConverterParameter=Rectangle}"/>
                                    <n:ExtendedRadioButton Grid.Row="0" Grid.Column="1" x:Name="EllipseRadioButton" Icon="{StaticResource Vector.Ellipse}" 
                                                           Text="{DynamicResource S.FreeDrawing.Ellipse}" Cursor="Hand" ContentWidth="20" ContentHeight="20" Margin="0,3" Padding="3"
                                                           IsChecked="{Binding FreeDrawingStylusTip, Source={x:Static t:UserSettings.All},
                                                           Converter={StaticResource StylusTipToBoolConverter}, ConverterParameter=Ellipse}"/>
                                </Grid>

                                <TextBlock Grid.Row="4" Grid.Column="0" Text="{DynamicResource S.FreeDrawing.Other}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:ExtendedCheckBox Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="2" x:Name="IsHighLighterCheckBox" Text="{DynamicResource S.FreeDrawing.Highlighter}" Margin="5"
                                                    IsChecked="{Binding Source={x:Static t:UserSettings.All}, Path=FreeDrawingIsHighlighter, Mode=TwoWay}"/>
                                <n:ExtendedCheckBox Grid.Row="5" Grid.Column="1" Grid.ColumnSpan="2" x:Name="FitToCurveCheckBox" Text="{DynamicResource S.FreeDrawing.FitToCurve}" Margin="5"
                                                    IsChecked="{Binding Source={x:Static t:UserSettings.All}, Path=FreeDrawingFitToCurve, Mode=TwoWay}"/>
                            </Grid>

                            <n:LabelSeparator Grid.Row="4" Text="{DynamicResource S.FreeDrawing.Eraser}" Visibility="{Binding ElementName=EraserModeRadioButton, Path=IsChecked, Converter={StaticResource Bool2Visibility}}"/>
                            <Grid Grid.Row="5" Margin="10,0,0,0" Visibility="{Binding ElementName=EraserModeRadioButton, Path=IsChecked, Converter={StaticResource Bool2Visibility}}">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.FreeDrawing.Width}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:IntegerUpDown Grid.Row="0" Grid.Column="1" x:Name="FreeDrawingEraserWidthNumericUpDown" Minimum="1" Maximum="100" Margin="10,5" MinWidth="70" 
                                                 Value="{Binding Source={x:Static t:UserSettings.All}, Path=FreeDrawingEraserWidth, Mode=TwoWay}"/>

                                <TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource S.FreeDrawing.Height}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:IntegerUpDown Grid.Row="1" Grid.Column="1" x:Name="FreeDrawingEraserHeightNumericUpDown" Minimum="1" Maximum="100" Margin="10,5" MinWidth="70" 
                                                 Value="{Binding Source={x:Static t:UserSettings.All}, Path=FreeDrawingEraserHeight, Mode=TwoWay}"/>

                                <TextBlock Grid.Row="2" Grid.Column="0" Text="{DynamicResource S.FreeDrawing.Tip}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <Grid Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>

                                    <n:ExtendedRadioButton Grid.Row="0" Grid.Column="0" x:Name="RectangleEraserRadioButton" Icon="{StaticResource Vector.Rectangle}" 
                                                           Text="{DynamicResource S.FreeDrawing.Rectangle}" Cursor="Hand" ContentWidth="20" ContentHeight="20" Margin="3,3" Padding="3"
                                                           IsChecked="{Binding FreeDrawingEraserStylusTip, Source={x:Static t:UserSettings.All},
                                                           Converter={StaticResource StylusTipToBoolConverter}, ConverterParameter=Rectangle}"/>
                                    <n:ExtendedRadioButton Grid.Row="0" Grid.Column="1" x:Name="ElipseEraserRadioButton" Icon="{StaticResource Vector.Ellipse}" 
                                                           Text="{DynamicResource S.FreeDrawing.Ellipse}" Cursor="Hand" ContentWidth="20" ContentHeight="20" Margin="0,3" Padding="3"
                                                           IsChecked="{Binding FreeDrawingEraserStylusTip, Source={x:Static t:UserSettings.All},
                                                           Converter={StaticResource StylusTipToBoolConverter}, ConverterParameter=Ellipse}"/>
                                </Grid>
                            </Grid>
                        </Grid>

                        <Grid x:Name="ShapesGrid" Visibility="Collapsed">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="27"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <n:LabelSeparator Grid.Row="0" Text="{DynamicResource S.FreeDrawing.Mode}"/>
                            <Grid Grid.Row="1" Margin="10,0,0,0">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="*"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>

                                <n:ExtendedRadioButton Grid.Row="0" Grid.Column="0" x:Name="AddModeRadioButton" Icon="{StaticResource Vector.Add}" Margin="0,2" Padding="2" MinHeight="30"  
                                                       Text="{DynamicResource S.Shapes.Mode.Insert}" Cursor="Hand" ContentWidth="20" ContentHeight="20" IsChecked="True" Checked="ShapeModes_Checked"/>

                                <n:ExtendedRadioButton Grid.Row="0" Grid.Column="1" x:Name="SelectModeRadioButton" Icon="{StaticResource Vector.Select}" Margin="0,2" Padding="2" MinHeight="30" 
                                                       Text="{DynamicResource S.FreeDrawing.Select}" Cursor="Hand" ContentWidth="20" ContentHeight="20" Checked="ShapeModes_Checked"/>
                            </Grid>

                            <n:LabelSeparator Grid.Row="2" Text="{DynamicResource S.Shapes.Shapes}" Visibility="{Binding ElementName=AddModeRadioButton, Path=IsChecked, Converter={StaticResource Bool2Visibility}}"/>
                            <Grid Grid.Row="3" Margin="10,0,5,0" Visibility="{Binding ElementName=AddModeRadioButton, Path=IsChecked, Converter={StaticResource Bool2Visibility}}">
                                <ListBox x:Name="ShapesListBox" SelectedIndex="0" SelectionChanged="ShapeType_SelectionChanged">
                                    <ListBox.ItemsPanel>
                                        <ItemsPanelTemplate>
                                            <WrapPanel/>
                                        </ItemsPanelTemplate>
                                    </ListBox.ItemsPanel>

                                    <Rectangle Width="25" Height="20" Stroke="{DynamicResource Element.Glyph}" Fill="{DynamicResource Element.Background}"/>
                                    <Ellipse Width="25" Height="20" Stroke="{DynamicResource Element.Glyph}" Fill="{DynamicResource Element.Background}"/>
                                    <h:Triangle Width="25" Height="20" Stroke="{DynamicResource Element.Glyph}" Fill="{DynamicResource Element.Background}"/>
                                    <h:Arrow Width="25" Height="20" Stroke="{DynamicResource Element.Glyph}" Fill="{DynamicResource Element.Background}" X1="1" Y1="1" X2="10" Y2="10"/>
                                </ListBox>
                            </Grid>

                            <n:LabelSeparator Grid.Row="4" Text="{DynamicResource S.Caption.Outline}"/>
                            <Grid Grid.Row="5" Margin="10,0,0,0">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Caption.Thickness}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:DoubleUpDown Grid.Row="0" Grid.Column="1" x:Name="ShapeOutlineDoubleUpDown" Minimum="0" Maximum="100" Margin="10,5" MinWidth="70" 
                                                Value="{Binding Source={x:Static t:UserSettings.All}, Path=ShapesThickness, Mode=TwoWay}" UpdateOnInput="True" ValueChanged="ShapeProperties_Changed"/>

                                <TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource S.Caption.Color}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:ColorBox Grid.Row="1" Grid.Column="1" x:Name="ShapeOutlineColorBox" Margin="10,5"
                                            SelectedColor="{Binding ShapesOutlineColor, Source={x:Static t:UserSettings.All}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                            ColorChanged="ShapeProperties_Changed"/>

                                <TextBlock Grid.Row="3" Grid.Column="0" Text="{DynamicResource S.Shapes.Shapes.Radius}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:DoubleUpDown Grid.Row="3" Grid.Column="1" x:Name="ShapeRadiusDoubleUpDown" Minimum="0" Maximum="100" Margin="10,5" MinWidth="70" 
                                                Value="{Binding Source={x:Static t:UserSettings.All}, Path=ShapesRadius, Mode=TwoWay}" UpdateOnInput="True" ValueChanged="ShapeProperties_Changed"/>
                            </Grid>

                            <n:LabelSeparator Grid.Row="6" Text="{DynamicResource S.Shapes.Fill}"/>
                            <Grid Grid.Row="7" Margin="10,0,0,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Caption.Color}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:ColorBox Grid.Row="0" Grid.Column="1" x:Name="ShapesFillColorBox" Margin="10,5"
                                            SelectedColor="{Binding ShapesFillColor, Source={x:Static t:UserSettings.All}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 
                                            ColorChanged="ShapeProperties_Changed"/>
                            </Grid>
                        </Grid>

                        <Grid x:Name="MouseClicksGrid" Visibility="Collapsed">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="27"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="27"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <n:LabelSeparator Grid.Row="0" Text="{DynamicResource S.Border.Appearance}"/>
                            <Grid Grid.Row="1" Margin="10,0,0,0">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>

                                <!--Format(rectangle, circle, perforated circle), edit clicks? -->
                                <!--Cursor highlight option, always on-->
                                
                                <!--<TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Caption.Style}" VerticalAlignment="Center"/>
                                <ComboBox Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" Margin="10,5" MinWidth="100" SelectedValuePath="FontStyle" 
                                          SelectedValue="{Binding Source={x:Static t:UserSettings.All}, Path=KeyStrokesFontStyle}">
                                    <ComboBox.ItemTemplate>
                                        <DataTemplate>
                                            <Grid>
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="20"/>
                                                    <ColumnDefinition/>
                                                </Grid.ColumnDefinitions>
                                                
                                                <Viewbox Margin="2">
                                                    <ContentPresenter Content="{Binding Tag}"/>
                                                </Viewbox>

                                                <TextBlock Grid.Column="1" FontSize="14" Text="{Binding Text}"/>
                                            </Grid>
                                        </DataTemplate>
                                    </ComboBox.ItemTemplate>

                                    <TextBlock Text="Ellipse" Tag="{StaticResource Vector.Ellipse}"/>
                                    <TextBlock Text="Rectangle" Tag="{StaticResource Vector.Rectangle}"/>
                                </ComboBox>-->

                                <TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource S.MouseClicks.Color.Left}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:ColorBox Grid.Row="1" Grid.Column="1" x:Name="LeftButtonClickColor" Margin="10,5"
                                            SelectedColor="{Binding Source={x:Static t:UserSettings.All}, Path=LeftMouseButtonClicksColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>

                                <TextBlock Grid.Row="2" Grid.Column="0" Text="{DynamicResource S.MouseClicks.Color.Middle}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:ColorBox Grid.Row="2" Grid.Column="1" x:Name="MiddleButtonClickColor" Margin="10,5"
                                            SelectedColor="{Binding Source={x:Static t:UserSettings.All}, Path=MiddleMouseButtonClicksColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>

                                <TextBlock Grid.Row="3" Grid.Column="0" Text="{DynamicResource S.MouseClicks.Color.Right}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:ColorBox Grid.Row="3" Grid.Column="1" x:Name="RightButtonClickColor" Margin="10,5"
                                            SelectedColor="{Binding Source={x:Static t:UserSettings.All}, Path=RightMouseButtonClicksColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>

                                <TextBlock Grid.Row="4" Grid.Column="0" Text="{DynamicResource S.FreeDrawing.Width}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:DoubleUpDown Grid.Row="4" Grid.Column="1" x:Name="ClickWidthDoubleUpDown" Minimum="1" Maximum="1000" Margin="10,5" MinWidth="70"
                                                Value="{Binding Source={x:Static t:UserSettings.All}, Path=MouseClicksWidth, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>

                                <TextBlock Grid.Row="5" Grid.Column="0" Text="{DynamicResource S.FreeDrawing.Height}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:DoubleUpDown Grid.Row="5" Grid.Column="1" x:Name="ClickHeightDoubleUpDown" Minimum="1" Maximum="1000" Margin="10,5" MinWidth="70"
                                                Value="{Binding Source={x:Static t:UserSettings.All}, Path=MouseClicksHeight, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                            </Grid>
                            <!--<n:LabelSeparator Grid.Row="2" Text="{DynamicResource S.Preview}"/>
                            <Grid Grid.Row="3" x:Name="PreviewGrid" Margin="10,5">
                                <Viewbox x:Name="PreviewViewBox" Child="{StaticResource Vector.Cursor}" Height="20" Width="20" Stretch="Uniform">
                                    <Viewbox.Margin>
                                        <MultiBinding Converter="{StaticResource DoubleToThicknessConverter}">
                                            <Binding Source="{x:Static t:UserSettings.All}" Path="MouseClicksWidth"/>
                                            <Binding Source="{x:Static t:UserSettings.All}" Path="MouseClicksHeight"/>
                                        </MultiBinding>
                                    </Viewbox.Margin>
                                </Viewbox>

                                <Ellipse Fill="{Binding ElementName=MouseBackgroundColor, Path=SelectedBrush, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
                                         Width="{Binding Source={x:Static t:UserSettings.All}, Path=MouseClicksWidth, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
                                         Height="{Binding Source={x:Static t:UserSettings.All}, Path=MouseClicksHeight, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
                                         HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="None"/>
                            </Grid>-->
                        </Grid>

                        <Grid x:Name="WatermarkGrid" Visibility="Collapsed">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="27"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="27"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <n:LabelSeparator Grid.Row="0" Text="{DynamicResource S.Watermark.Image}"/>
                            <Grid Grid.Row="1" Margin="10,0,0,0">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" MinHeight="35"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>

                                <Label Grid.Row="0" Grid.Column="0" Content="{DynamicResource S.Watermark.File}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <TextBlock Grid.Row="0" Grid.Column="1" x:Name="ImagePathLabel" Margin="3" Padding="0" FontStyle="Italic" Foreground="{DynamicResource Element.Foreground.Medium}" VerticalAlignment="Center"
                                           Text="{Binding Source={x:Static t:UserSettings.All}, Path=WatermarkFilePath, Converter={StaticResource PathToFilenameConverter}}" TextWrapping="WrapWithOverflow"
                                           ToolTip="{Binding Source={x:Static t:UserSettings.All}, Path=WatermarkFilePath}" ToolTipService.Placement="Top" ToolTipService.HorizontalOffset="-5"/>

                                <n:ExtendedButton Grid.Row="1" Grid.Column="1" x:Name="SelectWatermarkButton" Text="{DynamicResource S.FreeDrawing.Select}" 
                                                  HorizontalAlignment="Right" Icon="{StaticResource Vector.Image}" ContentWidth="20" ContentHeight="20"
                                                  Margin="5,3" MinWidth="70" Padding="2,5" Click="SelectWatermark_Click"/>
                            </Grid>

                            <Grid Grid.Row="2" Margin="10,0,0,0">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Watermark.Opacity}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:IntegerUpDown Grid.Row="0" Grid.Column="1" x:Name="OpacityWatermarkNumericUpDown"  
                                                 Minimum="1" Maximum="100" Margin="5" Width="70" HorizontalAlignment="Left"
                                                 Value="{Binding Source={x:Static t:UserSettings.All}, Path=WatermarkOpacity, 
                                                 Converter={StaticResource DoubleTimesAHundredToIntConverter}, Mode=TwoWay, FallbackValue=70}"/>
                                <TextBlock Grid.Row="0" Grid.Column="2" Text="%" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>

                                <TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource S.ImportVideo.Scale}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:IntegerUpDown Grid.Row="1" Grid.Column="1" x:Name="SizeWatermarkNumericUpDown" 
                                                 Minimum="1" Maximum="200" Margin="5" Width="70" HorizontalAlignment="Left"
                                                 Value="{Binding Source={x:Static t:UserSettings.All}, Path=WatermarkSize, 
                                                 Converter={StaticResource DoubleTimesAHundredToIntConverter}, Mode=TwoWay, FallbackValue=100}"/>
                                <TextBlock Grid.Row="1" Grid.Column="2" Text="%" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                            </Grid>

                            <n:LabelSeparator Grid.Row="3" Text="{DynamicResource S.Crop.Points}"/>
                            <Grid Grid.Row="4" Margin="10,0,0,0">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Crop.Top}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:DoubleUpDown Grid.Row="0" Grid.Column="1" x:Name="TopWatermarkDoubleUpDown" Minimum="-999" Margin="10,3" MinWidth="70"
                                                Maximum="{Binding ElementName=EditorWindow, Path=FrameSize.Height, FallbackValue=1000, UpdateSourceTrigger=PropertyChanged}"/>

                                <TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource S.Crop.Left}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:DoubleUpDown Grid.Row="1" Grid.Column="1" x:Name="LeftWatermarkDoubleUpDown" Minimum="-999" Margin="10,3" MinWidth="70"
                                                Maximum="{Binding ElementName=EditorWindow, Path=FrameSize.Width, FallbackValue=1000, UpdateSourceTrigger=PropertyChanged}"/>
                            </Grid>
                        </Grid>

                        <Grid x:Name="BorderGrid" Visibility="Collapsed">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="27"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <n:LabelSeparator Grid.Row="0" Text="{DynamicResource S.Border.Appearance}"/>
                            <Grid Grid.Row="1" Margin="10,0,0,0">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <!--<RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>-->
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Caption.Color}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:ColorBox Grid.Row="0" Grid.Column="1" x:Name="BorderColorBox" Margin="10,5"
                                            SelectedColor="{Binding BorderColor, Source={x:Static t:UserSettings.All}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>

                                <TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource S.Caption.Thickness}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <Grid Grid.Row="1" Grid.Column="1">
                                    <Grid.RowDefinitions>
                                        <RowDefinition/>
                                        <RowDefinition/>
                                        <RowDefinition/>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>

                                    <Grid Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4" HorizontalAlignment="Center">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition/>
                                            <ColumnDefinition/>
                                        </Grid.ColumnDefinitions>

                                        <Border Grid.Column="0" Background="{StaticResource Vector.Arrow.Blue.Top}" Width="15" Height="15" Opacity="{DynamicResource Element.Opacity}"/>
                                        <n:IntegerUpDown Grid.Column="1" x:Name="BorderTopThicknessNumericUpDown" Minimum="-500" Maximum="50" Margin="3,5" Width="55" 
                                                         Value="{Binding Source={x:Static t:UserSettings.All}, Path=BorderTopThickness, Mode=TwoWay}" ValueChanged="BorderProperties_ValueChanged"/>
                                    </Grid>

                                    <Border Grid.Row="1" Grid.Column="0" Background="{StaticResource Vector.Arrow.Blue.Left}" Width="15" Height="15" Margin="5,0,0,0" Opacity="{DynamicResource Element.Opacity}"/>
                                    <n:IntegerUpDown Grid.Row="1" Grid.Column="1" x:Name="BorderLeftThicknessNumericUpDown" Minimum="-500" Maximum="50" Margin="3,5" Width="55" 
                                                     Value="{Binding Source={x:Static t:UserSettings.All}, Path=BorderLeftThickness, Mode=TwoWay}" ValueChanged="BorderProperties_ValueChanged"/>

                                    <Border Grid.Row="1" Grid.Column="3" Background="{StaticResource Vector.Arrow.Blue.Right}" Width="15" Height="15" Opacity="{DynamicResource Element.Opacity}"/>
                                    <n:IntegerUpDown Grid.Row="1" Grid.Column="2" x:Name="BorderRightThicknessNumericUpDown" Minimum="-500" Maximum="50" Margin="3,5" Width="55" 
                                                     Value="{Binding Source={x:Static t:UserSettings.All}, Path=BorderRightThickness, Mode=TwoWay}" ValueChanged="BorderProperties_ValueChanged"/>

                                    <Grid Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="4" HorizontalAlignment="Center">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition/>
                                            <ColumnDefinition/>
                                        </Grid.ColumnDefinitions>

                                        <Border Grid.Column="0" Background="{StaticResource Vector.Arrow.Blue.Bottom}" Width="15" Height="15" Opacity="{DynamicResource Element.Opacity}"/>
                                        <n:IntegerUpDown Grid.Column="1" x:Name="BorderBottomThicknessNumericUpDown" Minimum="-500" Maximum="50" Margin="3,5" Width="55" 
                                                         Value="{Binding Source={x:Static t:UserSettings.All}, Path=BorderBottomThickness, Mode=TwoWay}" ValueChanged="BorderProperties_ValueChanged"/>
                                    </Grid>
                                </Grid>

                                <!--<TextBlock Grid.Row="2" Grid.Column="0" Text="{DynamicResource S.Shadow.BackgroundColor}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:ColorBox Grid.Row="2" Grid.Column="1" x:Name="BorderBackgroundColorBox" Margin="10,5"
                                            SelectedColor="{Binding BorderBackgroundColor, Source={x:Static t:UserSettings.All}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                                
                                <TextBlock Grid.Row="3" Grid.Column="0" Text="{DynamicResource S.Border.CornerRadius}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <Grid Grid.Row="3" Grid.Column="1">
                                    <Grid.RowDefinitions>
                                        <RowDefinition/>
                                        <RowDefinition/>
                                        <RowDefinition/>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>

                                    <Grid Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4" HorizontalAlignment="Center">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition/>
                                            <ColumnDefinition/>
                                        </Grid.ColumnDefinitions>

                                        <Viewbox Grid.Column="0" Child="{StaticResource Vector.Arrow.Blue.Top}" MaxWidth="15" MaxHeight="15" Opacity="{DynamicResource Element.Opacity}"/>
                                        <n:IntegerUpDown Grid.Column="1" x:Name="BorderTopRadiusNumericUpDown" Minimum="0" Maximum="1000" Margin="3,5" Width="55" 
                                                         Value="{Binding Source={x:Static t:UserSettings.All}, Path=BorderTopRadius, Mode=TwoWay}" ValueChanged="BorderProperties_ValueChanged"/>
                                    </Grid>

                                    <Viewbox Grid.Row="1" Grid.Column="0" Child="{StaticResource Vector.Arrow.Blue.Left}" MaxWidth="15" MaxHeight="15" Margin="5,0,0,0" Opacity="{DynamicResource Element.Opacity}"/>
                                    <n:IntegerUpDown Grid.Row="1" Grid.Column="1" x:Name="BorderLeftRadiusNumericUpDown" Minimum="0" Maximum="1000" Margin="3,5" Width="55" 
                                                     Value="{Binding Source={x:Static t:UserSettings.All}, Path=BorderLeftRadius, Mode=TwoWay}" ValueChanged="BorderProperties_ValueChanged"/>

                                    <Viewbox Grid.Row="1" Grid.Column="3" Child="{StaticResource Vector.Arrow.Blue.Right}" MaxWidth="15" MaxHeight="15" Opacity="{DynamicResource Element.Opacity}"/>
                                    <n:IntegerUpDown Grid.Row="1" Grid.Column="2" x:Name="BorderRightRadiusNumericUpDown" Minimum="0" Maximum="1000" Margin="3,5" Width="55" 
                                                     Value="{Binding Source={x:Static t:UserSettings.All}, Path=BorderRightRadius, Mode=TwoWay}" ValueChanged="BorderProperties_ValueChanged"/>

                                    <Grid Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="4" HorizontalAlignment="Center">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition/>
                                            <ColumnDefinition/>
                                        </Grid.ColumnDefinitions>

                                        <Viewbox Grid.Column="0" Child="{StaticResource Vector.Arrow.Blue.Bottom}" MaxWidth="15" MaxHeight="15" Opacity="{DynamicResource Element.Opacity}"/>
                                        <n:IntegerUpDown Grid.Column="1" x:Name="BorderBottomRadiusNumericUpDown" Minimum="0" Maximum="1000" Margin="3,5" Width="55" 
                                                         Value="{Binding Source={x:Static t:UserSettings.All}, Path=BorderBottomRadius, Mode=TwoWay}" ValueChanged="BorderProperties_ValueChanged"/>
                                    </Grid>
                                </Grid>-->
                            </Grid>

                            <Grid Grid.Row="2" Grid.Column="0" Margin="10,10,5,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>

                                <Border Grid.Column="0" Width="15" Height="15" Background="{StaticResource Vector.Info}" Opacity="{DynamicResource Element.Opacity}"/>
                                <TextBlock Grid.Column="1" Text="{DynamicResource S.Border.Info}" Foreground="{DynamicResource Element.Foreground.Detail}" 
                                           FontStyle="Italic" FontSize="12" Padding="3" TextWrapping="WrapWithOverflow"/>
                            </Grid>
                        </Grid>

                        <Grid x:Name="ShadowGrid" Visibility="Collapsed">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="27"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <Grid.Resources>
                                <c:PercentageToOpacity x:Key="PercentageToOpacity"/>
                            </Grid.Resources>

                            <n:LabelSeparator Grid.Row="0" Text="{DynamicResource S.Border.Appearance}"/>
                            <Grid Grid.Row="1" Margin="10,0,0,0">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Shadow.ShadowColor}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:ColorBox Grid.Row="0" Grid.Column="1" x:Name="ShadowColorBox" Margin="10,5" AllowTransparency="False"
                                            SelectedColor="{Binding Source={x:Static t:UserSettings.All}, Path=ShadowColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>

                                <TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource S.Shadow.BackgroundColor}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:ColorBox Grid.Row="1" Grid.Column="1" x:Name="ShadowBackgroundColorBox" Margin="10,5" AllowTransparency="False"
                                            SelectedColor="{Binding Source={x:Static t:UserSettings.All}, Path=ShadowBackgroundColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>

                                <TextBlock Grid.Row="2" Grid.Column="0" Text="{DynamicResource S.Shadow.BlurRadius}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:DoubleUpDown Grid.Row="2" Grid.Column="1" Minimum="0" Maximum="100" Margin="10,5" StepValue="0.5" Value="{Binding Source={x:Static t:UserSettings.All}, Path=ShadowBlurRadius, Mode=TwoWay}"
                                                ValueChanged="ShadowProperties_ValueChanged"/>

                                <TextBlock Grid.Row="3" Grid.Column="0" Text="{DynamicResource S.Shadow.Direction}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:DoubleUpDown Grid.Row="3" Grid.Column="1" Minimum="0" Maximum="360" Margin="10,5" StepValue="0.5" Value="{Binding Source={x:Static t:UserSettings.All}, Path=ShadowDirection, Mode=TwoWay}"
                                                ValueChanged="ShadowProperties_ValueChanged"/>

                                <TextBlock Grid.Row="4" Grid.Column="0" Text="{DynamicResource S.Watermark.Opacity}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:DoubleUpDown Grid.Row="4" Grid.Column="1" Minimum="0" Maximum="100" Margin="10,5" StepValue="0.5" 
                                                Value="{Binding Source={x:Static t:UserSettings.All}, Path=ShadowOpacity, Converter={StaticResource PercentageToOpacity}, Mode=TwoWay}" ValueChanged="ShadowProperties_ValueChanged"/>

                                <TextBlock Grid.Row="5" Grid.Column="0" Text="{DynamicResource S.Shadow.Depth}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:DoubleUpDown Grid.Row="5" Grid.Column="1" Minimum="0" Maximum="100" Margin="10,5" StepValue="0.5" Value="{Binding Source={x:Static t:UserSettings.All}, Path=ShadowDepth, Mode=TwoWay}"
                                                ValueChanged="ShadowProperties_ValueChanged"/>
                            </Grid>
                        </Grid>

                        <Grid x:Name="ObfuscateGrid" Visibility="Collapsed">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <n:LabelSeparator Grid.Row="0" Text="{DynamicResource S.Progress.Type}"/>
                            <Grid Grid.Row="1" Margin="10,0,0,0">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>

                                <n:ExtendedRadioButton Grid.Row="0" Grid.Column="0" x:Name="PixelationRadioButton" Icon="{StaticResource Vector.Pixelate}" Text="{DynamicResource S.Obfuscate.Type.Pixelate}" 
                                                       IsChecked="{Binding ObfuscationMode, Source={x:Static t:UserSettings.All}, Converter={StaticResource EnumToBool}, 
                                                       ConverterParameter={x:Static u:ObfuscationMode.Pixelation}}" Margin="0,2" Padding="2" MinHeight="30"/>

                                <n:ExtendedRadioButton Grid.Row="0" Grid.Column="1" x:Name="BlurRadioButton" Icon="{StaticResource Vector.Blur}" Text="{StaticResource S.Obfuscate.Type.Blur}"
                                                       IsChecked="{Binding ObfuscationMode, Source={x:Static t:UserSettings.All}, Converter={StaticResource EnumToBool}, 
                                                       ConverterParameter={x:Static u:ObfuscationMode.Blur}}" Margin="0,2" Padding="2" MinHeight="30"/>

                                <n:ExtendedRadioButton Grid.Row="1" Grid.Column="0" x:Name="DarkenRadioButton" Icon="{StaticResource Vector.Darken}" Text="{StaticResource S.Obfuscate.Type.Darken}"
                                                       IsChecked="{Binding ObfuscationMode, Source={x:Static t:UserSettings.All}, Converter={StaticResource EnumToBool}, 
                                                       ConverterParameter={x:Static u:ObfuscationMode.Darken}}" Margin="0,2" Padding="2" MinHeight="30"/>

                                <n:ExtendedRadioButton Grid.Row="1" Grid.Column="1" x:Name="LightenRadioButton" Icon="{StaticResource Vector.Lighten}" Text="{StaticResource S.Obfuscate.Type.Lighten}"
                                                       IsChecked="{Binding ObfuscationMode, Source={x:Static t:UserSettings.All}, Converter={StaticResource EnumToBool}, 
                                                       ConverterParameter={x:Static u:ObfuscationMode.Lighten}}" Margin="0,2" Padding="2" MinHeight="30"/>
                            </Grid>
                            
                            <n:LabelSeparator Grid.Row="2" Text="{DynamicResource S.Obfuscate.Options}"/>
                            <Grid Grid.Row="3" Margin="10,0,0,0">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Obfuscate.PixelSize}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"
                                           Visibility="{Binding ElementName=PixelSizeIntegerUpDown, Path=Visibility}"/>
                                <n:IntegerUpDown Grid.Row="0" Grid.Column="1" x:Name="PixelSizeIntegerUpDown" Minimum="2" Maximum="100" Margin="10,5" MinWidth="80" 
                                                 Value="{Binding Source={x:Static t:UserSettings.All}, Path=PixelSize, Mode=TwoWay}"
                                                 Visibility="{Binding ElementName=PixelationRadioButton, Path=IsChecked, Converter={StaticResource Bool2Visibility}}"/>
                                
                                <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Obfuscate.BlurLevel}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"
                                           Visibility="{Binding ElementName=BlurSizeIntegerUpDown, Path=Visibility}"/>
                                <n:IntegerUpDown Grid.Row="0" Grid.Column="1" x:Name="BlurSizeIntegerUpDown" Minimum="2" Maximum="5" Margin="10,5" MinWidth="80" 
                                                 Value="{Binding Source={x:Static t:UserSettings.All}, Path=BlurLevel, Mode=TwoWay}"
                                                 Visibility="{Binding ElementName=BlurRadioButton, Path=IsChecked, Converter={StaticResource Bool2Visibility}}"/>

                                <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Obfuscate.DarkenLevel}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"
                                           Visibility="{Binding ElementName=DarknessDoubleUpDown, Path=Visibility}"/>
                                <n:DoubleUpDown Grid.Row="0" Grid.Column="1" x:Name="DarknessDoubleUpDown" Minimum="2" Maximum="100" Margin="10,5" MinWidth="80" 
                                                Value="{Binding Source={x:Static t:UserSettings.All}, Path=DarkenLevel, Mode=TwoWay}"
                                                Visibility="{Binding ElementName=DarkenRadioButton, Path=IsChecked, Converter={StaticResource Bool2Visibility}}"/>

                                <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Obfuscate.LightenLevel}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"
                                           Visibility="{Binding ElementName=LightnessDoubleUpDown, Path=Visibility}"/>
                                <n:DoubleUpDown Grid.Row="0" Grid.Column="1" x:Name="LightnessDoubleUpDown" Minimum="2" Maximum="100" Margin="10,5" MinWidth="80" 
                                                Value="{Binding Source={x:Static t:UserSettings.All}, Path=LightenLevel, Mode=TwoWay}"
                                                Visibility="{Binding ElementName=LightenRadioButton, Path=IsChecked, Converter={StaticResource Bool2Visibility}}"/>
                                
                                
                                <n:ExtendedCheckBox Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3" x:Name="UseMedianCheckBox" Text="{DynamicResource S.Obfuscate.UseAverage}"
                                                    IsChecked="{Binding Source={x:Static t:UserSettings.All}, Path=UseMedian}" Margin="3,5"
                                                    Visibility="{Binding ElementName=PixelationRadioButton, Path=IsChecked, Converter={StaticResource Bool2Visibility}}"/>

                                <n:ExtendedCheckBox Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" Text="{DynamicResource S.Obfuscate.Invert}"
                                                    IsChecked="{Binding Source={x:Static t:UserSettings.All}, Path=ObfuscationInvertedSelection}" Margin="3,5"/>
                            </Grid>

                            <n:LabelSeparator Grid.Row="4" Text="{DynamicResource S.Obfuscate.Smoothness}"/>
                            <Grid Grid.Row="5" Margin="10,0,0,0">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Shapes.Shapes.Radius}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:IntegerUpDown Grid.Row="0" Grid.Column="1" Minimum="0" Maximum="100" Margin="10,5" MinWidth="80" 
                                                 Value="{Binding Source={x:Static t:UserSettings.All}, Path=ObfuscationSmoothnessRadius, Mode=TwoWay}"/>
                                <TextBlock Grid.Row="0" Grid.Column="2" Text="px" VerticalAlignment="Center" HorizontalAlignment="Left" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                
                                <TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource S.Watermark.Opacity}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:DoubleUpDown Grid.Row="1" Grid.Column="1" Minimum="0" Maximum="100" Margin="10,5" MinWidth="80" 
                                                Value="{Binding Source={x:Static t:UserSettings.All}, Path=ObfuscationSmoothnessOpacity, Mode=TwoWay}"/>
                                <TextBlock Grid.Row="1" Grid.Column="2" Text="%" VerticalAlignment="Center" HorizontalAlignment="Left" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                            </Grid>
                            
                            <Grid Grid.Row="6" Grid.Column="0" Margin="10,10,5,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>

                                <Border Grid.Column="0" Width="15" Height="15" Background="{StaticResource Vector.Info}" Opacity="{DynamicResource Element.Opacity}"/>
                                <TextBlock Grid.Column="1" Text="{DynamicResource S.Obfuscate.Info}" Foreground="{DynamicResource Element.Foreground.Detail}" 
                                           FontStyle="Italic" FontSize="12" Padding="3" TextWrapping="WrapWithOverflow"
                                           Visibility="{Binding Source={x:Static t:UserSettings.All}, Path=ObfuscationInvertedSelection, Converter={StaticResource InvertedBoolToVisibility}}"/>                                
                                
                                <TextBlock Grid.Column="1" Text="{DynamicResource S.Obfuscate.Info2}" Foreground="{DynamicResource Element.Foreground.Detail}" 
                                           FontStyle="Italic" FontSize="12" Padding="3" TextWrapping="WrapWithOverflow" 
                                           Visibility="{Binding Source={x:Static t:UserSettings.All}, Path=ObfuscationInvertedSelection, Converter={StaticResource Bool2Visibility}}"/>
                            </Grid>
                        </Grid>

                        <Grid x:Name="ProgressGrid" Visibility="Collapsed">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="23"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="23"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="23"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <n:LabelSeparator Grid.Row="0" Text="{DynamicResource S.Progress.Type}"/>
                            <Grid Grid.Row="1" Margin="10,0,0,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>

                                <n:ExtendedRadioButton Grid.Column="0" x:Name="BarRadioButton" Icon="{StaticResource Vector.Progress}" Text="{DynamicResource S.Progress.Type.Bar}" 
                                                       IsChecked="{Binding ProgressType, Source={x:Static t:UserSettings.All}, Converter={StaticResource EnumToBool}, 
                                                       ConverterParameter={x:Static u:ProgressType.Bar}}" Margin="0,2" Padding="2" MinHeight="30"/>

                                <n:ExtendedRadioButton Grid.Column="1" x:Name="TextRadioButton" Icon="{StaticResource Vector.FreeText}" Text="{StaticResource S.Progress.Type.Text}"
                                                       IsChecked="{Binding ProgressType, Source={x:Static t:UserSettings.All}, Converter={StaticResource EnumToBool}, 
                                                       ConverterParameter={x:Static u:ProgressType.Text}}" Margin="0,2" Padding="2" MinHeight="30"/>
                            </Grid>

                            <Expander Grid.Row="2" Header="{DynamicResource S.Caption.Font}" IsExpanded="{Binding IsProgressFontGroupExpanded, Source={x:Static t:UserSettings.All}}"
                                      Visibility="{Binding IsChecked, ElementName=TextRadioButton, Converter={StaticResource Bool2Visibility}}">
                                <Grid Margin="10,0,0,0">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>

                                    <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Caption.Family}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <ComboBox Grid.Row="0" Grid.Column="1" x:Name="ProgressFontComboBox" Margin="10,5" MinWidth="100" MaxWidth="150" IsEditable="True"
                                              ItemTemplate="{DynamicResource FontTemplate}" SelectedItem="{Binding Source={x:Static t:UserSettings.All}, Path=ProgressFontFamily, Mode=TwoWay}">
                                        <ComboBox.ItemsSource>
                                            <Binding Source="{StaticResource MyFonts}" />
                                        </ComboBox.ItemsSource>

                                        <ComboBox.ItemsPanel>
                                            <ItemsPanelTemplate>
                                                <VirtualizingStackPanel VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Recycling"/>
                                            </ItemsPanelTemplate>
                                        </ComboBox.ItemsPanel>
                                    </ComboBox>

                                    <TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource S.Caption.Style}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <ComboBox Grid.Row="1" Grid.Column="1" x:Name="ProgressFontStyleComboBox" Margin="10,5" MinWidth="100"
                                              SelectedValuePath="FontStyle" SelectedValue="{Binding Source={x:Static t:UserSettings.All}, Path=ProgressFontStyle, Mode=TwoWay}">
                                        <ComboBox.ItemTemplate>
                                            <DataTemplate>
                                                <VirtualizingStackPanel IsVirtualizing="True" VirtualizationMode="Recycling" ScrollViewer.IsDeferredScrollingEnabled="True">
                                                    <TextBlock FontStyle="{Binding FontStyle}" FontSize="14" Text="{Binding Text}"/>
                                                </VirtualizingStackPanel>
                                            </DataTemplate>
                                        </ComboBox.ItemTemplate>

                                        <TextBlock FontStyle="Normal" Text="{DynamicResource S.FontStyles.Normal}"/>
                                        <TextBlock FontStyle="Italic" Text="{DynamicResource S.FontStyles.Italic}"/>
                                        <TextBlock FontStyle="Oblique" Text="{DynamicResource S.FontStyles.Oblique}"/>
                                    </ComboBox>

                                    <TextBlock Grid.Row="2" Grid.Column="0" Text="{DynamicResource S.Caption.Weight}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <ComboBox Grid.Row="2" Grid.Column="1" x:Name="ProgressFontWeightComboBox" Margin="10,5" MinWidth="100"
                                              SelectedValuePath="FontWeight" SelectedValue="{Binding Source={x:Static t:UserSettings.All}, Path=ProgressFontWeight, Mode=TwoWay}">
                                        <ComboBox.ItemTemplate>
                                            <DataTemplate>
                                                <VirtualizingStackPanel IsVirtualizing="True" VirtualizationMode="Recycling" ScrollViewer.IsDeferredScrollingEnabled="True">
                                                    <TextBlock FontWeight="{Binding FontWeight}" FontSize="14" Text="{Binding Text}" />
                                                </VirtualizingStackPanel>
                                            </DataTemplate>
                                        </ComboBox.ItemTemplate>

                                        <TextBlock FontWeight="UltraLight" Text="{DynamicResource S.FontWeights.UltraLight}"/>
                                        <TextBlock FontWeight="ExtraLight" Text="{DynamicResource S.FontWeights.ExtraLight}"/>
                                        <TextBlock FontWeight="Light" Text="{DynamicResource S.FontWeights.Light}"/>
                                        <TextBlock FontWeight="Thin" Text="{DynamicResource S.FontWeights.Thin}"/>
                                        <TextBlock FontWeight="Normal" Text="{DynamicResource S.FontWeights.Normal}"/>
                                        <TextBlock FontWeight="Regular" Text="{DynamicResource S.FontWeights.Regular}"/>
                                        <TextBlock FontWeight="Medium" Text="{DynamicResource S.FontWeights.Medium}"/>
                                        <TextBlock FontWeight="SemiBold" Text="{DynamicResource S.FontWeights.SemiBold}"/>
                                        <TextBlock FontWeight="DemiBold" Text="{DynamicResource S.FontWeights.DemiBold}"/>
                                        <TextBlock FontWeight="Bold" Text="{DynamicResource S.FontWeights.Bold}"/>
                                        <TextBlock FontWeight="Black" Text="{DynamicResource S.FontWeights.Black}"/>
                                        <TextBlock FontWeight="Heavy" Text="{DynamicResource S.FontWeights.Heavy}"/>
                                        <TextBlock FontWeight="ExtraBold" Text="{DynamicResource S.FontWeights.ExtraBold}"/>
                                        <TextBlock FontWeight="ExtraBlack" Text="{DynamicResource S.FontWeights.ExtraBlack}"/>
                                        <TextBlock FontWeight="UltraBold" Text="{DynamicResource S.FontWeights.UltraBold}"/>
                                        <TextBlock FontWeight="UltraBlack" Text="{DynamicResource S.FontWeights.UltraBlack}"/>
                                    </ComboBox>

                                    <TextBlock Grid.Row="3" Grid.Column="0" Text="{DynamicResource S.Caption.Size}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <n:IntegerUpDown Grid.Row="3" Grid.Column="1" x:Name="ProgressFontSizeNumericUpDown" Minimum="10" Maximum="1000" Margin="10,5" MinWidth="70" 
                                                     Value="{Binding Source={x:Static t:UserSettings.All}, Path=ProgressFontSize, Mode=TwoWay}"/>

                                    <TextBlock Grid.Row="4" Grid.Column="0" Text="{DynamicResource S.Caption.Color}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                    <n:ColorBox Grid.Row="4" Grid.Column="1" SelectedColor="{Binding ProgressFontColor, Source={x:Static t:UserSettings.All}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="10,5"/>
                                </Grid>
                            </Expander>

                            <n:LabelSeparator Grid.Row="3" Text="{DynamicResource S.Border.Appearance}"/>
                            <Grid Grid.Row="4" Margin="10,0,0,0">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Color}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:ColorBox Grid.Row="0" Grid.Column="1" SelectedColor="{Binding ProgressColor, Source={x:Static t:UserSettings.All}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="10,5"/>

                                <TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource S.Progress.Precision}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"
                                           Visibility="{Binding IsChecked, ElementName=TextRadioButton, Converter={StaticResource Bool2Visibility}}"/>
                                <ComboBox Grid.Row="1" Grid.Column="1" x:Name="ProgressPrecisionComboBox" Margin="10,5" MinWidth="100" MaxWidth="150" IsEditable="True"
                                          SelectedIndex="{Binding Source={x:Static t:UserSettings.All}, Path=ProgressPrecision, Mode=TwoWay}"
                                          Visibility="{Binding IsChecked, ElementName=TextRadioButton, Converter={StaticResource Bool2Visibility}}"
                                          SelectionChanged="ProgressPrecisionComboBox_SelectionChanged">
                                    <ComboBoxItem Content="{DynamicResource S.Progress.Precision.Minutes}"/>
                                    <ComboBoxItem Content="{DynamicResource S.Progress.Precision.Seconds}"/>
                                    <ComboBoxItem Content="{DynamicResource S.Progress.Precision.Milliseconds}"/>
                                    <ComboBoxItem Content="{DynamicResource S.Progress.Precision.Percentage}"/>
                                    <ComboBoxItem Content="{DynamicResource S.Progress.Precision.Count}"/>
                                    <ComboBoxItem Content="{DynamicResource S.Progress.Precision.Custom}"/>
                                    <ComboBoxItem Content="{DynamicResource S.Progress.Precision.DateOfRecording}"/>
                                </ComboBox>

                                <n:ExtendedCheckBox Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2" Text="{DynamicResource S.Progress.Precision.ShowTotal}" Margin="10,5,5,5"
                                                    IsChecked="{Binding ProgressShowTotal, Source={x:Static t:UserSettings.All}, Mode=TwoWay}"
                                                    Visibility="{Binding IsChecked, ElementName=TextRadioButton, Converter={StaticResource Bool2Visibility}}"
                                                    CheckedChanged="ExtendedCheckBox_CheckedChanged"/>

                                <TextBlock Grid.Row="2" Grid.Column="0" x:Name="ProgressFormatTextBlock" Text="{DynamicResource S.Progress.Format}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}">
                                    <TextBlock.Visibility>
                                        <MultiBinding Converter="{StaticResource BoolAndToVisibility}">
                                            <Binding ElementName="ProgressPrecisionComboBox" Path="SelectedIndex" Converter="{StaticResource IntToBool}" ConverterParameter="5"/>
                                            <Binding ElementName="TextRadioButton" Path="IsChecked"/>
                                        </MultiBinding>
                                    </TextBlock.Visibility>
                                </TextBlock>
                                <n:ExtendedTextBox Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2" x:Name="CustomProgressTextBox" Margin="10,5"
                                                   Text="{Binding Source={x:Static t:UserSettings.All}, Path=ProgressFormat, Mode=TwoWay}"
                                                   Visibility="{Binding ElementName=ProgressFormatTextBlock, Path=Visibility}" TextChanged="CustomProgressTextBox_TextChanged">
                                    <n:ExtendedTextBox.ToolTip>
                                        <n:HeaderedTooltip Header="{DynamicResource S.Progress.Format.Header}" StaysOpen="True">
                                            <Run Text="{DynamicResource S.Progress.Format.Milliseconds}"/>
                                            <LineBreak/>
                                            <Run Text="{DynamicResource S.Progress.Format.Seconds}"/>
                                            <LineBreak/>
                                            <Run Text="{DynamicResource S.Progress.Format.Minutes}"/>
                                            <LineBreak/>
                                            <Run Text="{DynamicResource S.Progress.Format.Percentage}"/>
                                            <LineBreak/>
                                            <Run Text="{DynamicResource S.Progress.Format.FrameNumber}"/>
                                            <LineBreak/>
                                            <LineBreak/>
                                            <Run Text="{DynamicResource S.Progress.Format.Totals}" FontWeight="SemiBold"/>
                                            <LineBreak/>
                                            <Run Text="@ms, @s, @m, @p, @f"/>
                                            <LineBreak/>
                                            <LineBreak/>
                                            <Run Text="{DynamicResource S.Progress.Format.Examples}" FontWeight="SemiBold"/>
                                            <LineBreak/>
                                            <Run Text="'$s/@s s' = 2/10 s"/>
                                            <LineBreak/>
                                            <Run Text="'$p/@p%' = 25/100%"/>
                                        </n:HeaderedTooltip>
                                    </n:ExtendedTextBox.ToolTip>
                                </n:ExtendedTextBox>

                                <TextBlock Grid.Row="3" Grid.Column="0" x:Name="ProgressStartNumberTextBlock" Text="{DynamicResource S.Progress.Precision.StartNumber}" VerticalAlignment="Center" 
                                           Foreground="{DynamicResource Element.Foreground.Medium}">
                                    <TextBlock.Visibility>
                                        <MultiBinding Converter="{StaticResource BoolAndOrOrToVisibility}">
                                            <Binding ElementName="TextRadioButton" Path="IsChecked"/>
                                            <Binding ElementName="ProgressPrecisionComboBox" Path="SelectedIndex" Converter="{StaticResource IntToBool}" ConverterParameter="4"/>
                                            <Binding ElementName="ProgressPrecisionComboBox" Path="SelectedIndex" Converter="{StaticResource IntToBool}" ConverterParameter="5"/>
                                        </MultiBinding>
                                    </TextBlock.Visibility>
                                </TextBlock>
                                <n:IntegerUpDown Grid.Row="3" Grid.Column="1" x:Name="ProgressStartNumberIntegerUpDown" Minimum="0" Maximum="1000" Margin="10,5" MinWidth="70" 
                                                 Value="{Binding Source={x:Static t:UserSettings.All}, Path=ProgressStartNumber, Mode=TwoWay}"
                                                 Visibility="{Binding ElementName=ProgressStartNumberTextBlock, Path=Visibility}" ToolTip="{DynamicResource S.Progress.Precision.StartNumber.ToolTip}"
                                                 ValueChanged="ExtendedCheckBox_CheckedChanged"/>

                                <TextBlock Grid.Row="4" Grid.Column="0" x:Name="ProgressDateFormatTextBlock" Text="{DynamicResource S.Progress.Format}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}">
                                    <TextBlock.Visibility>
                                        <MultiBinding Converter="{StaticResource BoolAndToVisibility}">
                                            <Binding ElementName="ProgressPrecisionComboBox" Path="SelectedIndex" Converter="{StaticResource IntToBool}" ConverterParameter="6"/>
                                            <Binding ElementName="TextRadioButton" Path="IsChecked"/>
                                        </MultiBinding>
                                    </TextBlock.Visibility>
                                </TextBlock>
                                <n:ExtendedTextBox Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="2" x:Name="CustomProgressDateTextBox" Margin="10,5"
                                                   Text="{Binding Source={x:Static t:UserSettings.All}, Path=ProgressDateFormat, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                                   Visibility="{Binding ElementName=ProgressDateFormatTextBlock, Path=Visibility}" ToolTip="{DynamicResource S.Progress.Format.Date}" 
                                                   TextChanged="CustomProgressTextBox_TextChanged"/>

                                <TextBlock Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="3" VerticalAlignment="Center" HorizontalAlignment="Center" ToolTip="docs.microsoft.com"
                                           Visibility="{Binding ElementName=ProgressDateFormatTextBlock, Path=Visibility}">

                                    <Hyperlink NavigateUri="https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings" RequestNavigate="Hyperlink_RequestNavigate">
                                        <Run Text="{DynamicResource S.Progress.Format.Date.Standard}"/>
                                    </Hyperlink>
                                    <Run Text="/" Foreground="{DynamicResource Element.Foreground}"/>
                                    <Hyperlink NavigateUri="https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings" RequestNavigate="Hyperlink_RequestNavigate">
                                        <Run Text="{DynamicResource  S.Progress.Format.Date.Custom}"/>
                                    </Hyperlink>
                                </TextBlock>

                                <TextBlock Grid.Row="3" Grid.Column="0" Text="{DynamicResource S.Caption.Thickness}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"
                                           Visibility="{Binding IsChecked, ElementName=BarRadioButton, Converter={StaticResource Bool2Visibility}}"/>
                                <n:IntegerUpDown Grid.Row="3" Grid.Column="1" x:Name="ProgressThicknessNumericUpDown" Minimum="1" Maximum="30" Margin="10,5" MinWidth="70" 
                                                 Value="{Binding ProgressThickness, Source={x:Static t:UserSettings.All}, Mode=TwoWay}"
                                                 Visibility="{Binding IsChecked, ElementName=BarRadioButton, Converter={StaticResource Bool2Visibility}}"/>
                            </Grid>

                            <n:LabelSeparator Grid.Row="5" Text="{DynamicResource S.Caption.Layout}"/>
                            <Grid Grid.Row="6" Margin="10,0,0,0">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Caption.Vertical}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <ComboBox Grid.Row="0" Grid.Column="1" x:Name="ProgressVerticalComboBox" Margin="10,5" MinWidth="100" MaxWidth="150"
                                          SelectedValuePath="VerticalAlignment" SelectedValue="{Binding Source={x:Static t:UserSettings.All}, Path=ProgressVerticalAligment, Mode=TwoWay}">

                                    <TextBlock VerticalAlignment="Top" Text="{DynamicResource S.VerticalAlignment.Top}"/>
                                    <TextBlock VerticalAlignment="Center" Text="{DynamicResource S.VerticalAlignment.Center}"/>
                                    <TextBlock VerticalAlignment="Bottom" Text="{DynamicResource S.VerticalAlignment.Bottom}"/>
                                </ComboBox>

                                <TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource S.Caption.Horizontal}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <ComboBox Grid.Row="1" Grid.Column="1" x:Name="ProgressHorizontalComboBox" Margin="10,5" MinWidth="100" MaxWidth="150" 
                                          SelectedValuePath="HorizontalAlignment" SelectedValue="{Binding Source={x:Static t:UserSettings.All}, Path=ProgressHorizontalAligment, Mode=TwoWay}">

                                    <TextBlock HorizontalAlignment="Left" Text="{DynamicResource S.HorizontalAlignment.Left}"/>
                                    <TextBlock HorizontalAlignment="Center" Text="{DynamicResource S.HorizontalAlignment.Center}"/>
                                    <TextBlock HorizontalAlignment="Right" Text="{DynamicResource S.HorizontalAlignment.Right}"/>
                                </ComboBox>

                                <TextBlock Grid.Row="2" Grid.Column="0" Text="{DynamicResource S.Progress.Orientation}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"
                                           Visibility="{Binding IsChecked, ElementName=BarRadioButton, Converter={StaticResource Bool2Visibility}}"/>
                                <ComboBox Grid.Row="2" Grid.Column="1" x:Name="ProgressOrientationComboBox" Margin="10,5" MinWidth="100" MaxWidth="110" 
                                          SelectedValuePath="Tag" SelectedValue="{Binding Source={x:Static t:UserSettings.All}, Path=ProgressOrientation, Mode=TwoWay}"
                                          Visibility="{Binding IsChecked, ElementName=BarRadioButton, Converter={StaticResource Bool2Visibility}}">

                                    <TextBlock Text="{DynamicResource S.Orientation.Horizontal}">
                                        <TextBlock.Tag>
                                            <x:Static Member="Orientation.Horizontal"/>
                                        </TextBlock.Tag>
                                    </TextBlock>
                                    <TextBlock Text="{DynamicResource S.Orientation.Vertical}">
                                        <TextBlock.Tag>
                                            <x:Static Member="Orientation.Vertical"/>
                                        </TextBlock.Tag>
                                    </TextBlock>
                                </ComboBox>
                            </Grid>
                        </Grid>

                        <Grid x:Name="CinemagraphGrid" Visibility="Collapsed">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <n:LabelSeparator Grid.Row="0" Text="{DynamicResource S.FreeDrawing.Mode}"/>
                            <Grid Grid.Row="1" Margin="10,0,0,0">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="*"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>

                                <n:ExtendedRadioButton Grid.Row="0" Grid.Column="0" x:Name="PenMode2RadioButton" Icon="{StaticResource Vector.Pen}" 
                                                       Text="{DynamicResource S.FreeDrawing.Pen}" Cursor="Hand" ContentWidth="20" ContentHeight="20" Margin="0,2" Padding="2" MinHeight="30" IsChecked="True"/>
                                <n:ExtendedRadioButton Grid.Row="0" Grid.Column="1" x:Name="EraserMode2RadioButton" Icon="{StaticResource Vector.Eraser}" 
                                                       Text="{DynamicResource S.FreeDrawing.Eraser}" Cursor="Hand" ContentWidth="20" ContentHeight="20" Margin="0,2" Padding="2" MinHeight="30"/>

                                <n:ExtendedRadioButton Grid.Row="1" Grid.Column="0" x:Name="SelectorMode2RadioButton" Icon="{StaticResource Vector.Select}" 
                                                       Text="{DynamicResource S.FreeDrawing.Select}" Cursor="Hand" ContentWidth="20" ContentHeight="20" Margin="0,2" Padding="2" MinHeight="30"/>
                                <n:ExtendedRadioButton Grid.Row="1" Grid.Column="1" x:Name="EraserStrokeMode2RadioButton" Icon="{StaticResource Vector.StrokeEraser}" 
                                                       Text="{DynamicResource S.FreeDrawing.StrokeEraser}" Cursor="Hand" ContentWidth="20" ContentHeight="20" Margin="0,2" Padding="2" MinHeight="30"/>
                            </Grid>

                            <n:LabelSeparator Grid.Row="2" Text="{DynamicResource S.FreeDrawing.Pen}" Visibility="{Binding ElementName=PenMode2RadioButton, Path=IsChecked, Converter={StaticResource Bool2Visibility}}"/>
                            <Grid Grid.Row="3" Margin="10,0,0,0" 
                                  Visibility="{Binding ElementName=PenMode2RadioButton, Path=IsChecked, Converter={StaticResource Bool2Visibility}}">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.FreeDrawing.Width}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:IntegerUpDown Grid.Row="0" Grid.Column="1" x:Name="CinemagraphWidthNumericUpDown" Minimum="1" Maximum="100" Margin="10,5" MinWidth="70" 
                                                 Value="{Binding Source={x:Static t:UserSettings.All}, Path=CinemagraphPenWidth, Mode=TwoWay}"/>

                                <TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource S.FreeDrawing.Height}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:IntegerUpDown Grid.Row="1" Grid.Column="1" x:Name="CinemagraphHeightNumericUpDown" Minimum="1" Maximum="100" Margin="10,5" MinWidth="70" 
                                                 Value="{Binding Source={x:Static t:UserSettings.All}, Path=CinemagraphPenHeight, Mode=TwoWay}"/>

                                <TextBlock Grid.Row="2" Grid.Column="0" Text="{DynamicResource S.FreeDrawing.Tip}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <Grid Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>

                                    <n:ExtendedRadioButton Grid.Row="0" Grid.Column="0" x:Name="Rectangle2RadioButton" Icon="{StaticResource Vector.Rectangle}" 
                                                           Text="{DynamicResource S.FreeDrawing.Rectangle}" Cursor="Hand" ContentWidth="20" ContentHeight="20" Margin="3,3" Padding="3"
                                                           IsChecked="{Binding CinemagraphStylusTip, Source={x:Static t:UserSettings.All}, 
                                                           Converter={StaticResource StylusTipToBoolConverter}, ConverterParameter=Rectangle}"/>
                                    <n:ExtendedRadioButton Grid.Row="0" Grid.Column="1" x:Name="Ellipse2RadioButton" Icon="{StaticResource Vector.Ellipse}" 
                                                           Text="{DynamicResource S.FreeDrawing.Ellipse}" Cursor="Hand" ContentWidth="20" ContentHeight="20" Margin="0,3" Padding="3"
                                                           IsChecked="{Binding CinemagraphStylusTip, Source={x:Static t:UserSettings.All}, 
                                                           Converter={StaticResource StylusTipToBoolConverter}, ConverterParameter=Ellipse}"/>
                                </Grid>

                                <TextBlock Grid.Row="3" Grid.Column="0" Text="{DynamicResource S.FreeDrawing.Other}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:ExtendedCheckBox Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" x:Name="FitToCurve2CheckBox" Text="{DynamicResource S.FreeDrawing.FitToCurve}" Margin="5"
                                                    IsChecked="{Binding Source={x:Static t:UserSettings.All}, Path=CinemagraphFitToCurve, Mode=TwoWay}"/>
                            </Grid>

                            <n:LabelSeparator Grid.Row="2" Text="{DynamicResource S.FreeDrawing.Eraser}" Visibility="{Binding ElementName=EraserMode2RadioButton, Path=IsChecked, Converter={StaticResource Bool2Visibility}}"/>
                            <Grid Grid.Row="3" Margin="10,0,0,0"
                                  Visibility="{Binding ElementName=EraserMode2RadioButton, Path=IsChecked, Converter={StaticResource Bool2Visibility}}">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.FreeDrawing.Width}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:IntegerUpDown Grid.Row="0" Grid.Column="1" x:Name="CinemagraphEraserWidthNumericUpDown" Minimum="1" Maximum="100" Margin="10,5" MinWidth="70" 
                                                 Value="{Binding Source={x:Static t:UserSettings.All}, Path=CinemagraphEraserWidth, Mode=TwoWay}"/>

                                <TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource S.FreeDrawing.Height}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:IntegerUpDown Grid.Row="1" Grid.Column="1" x:Name="CinemagraphEraserHeightNumericUpDown" Minimum="1" Maximum="100" Margin="10,5" MinWidth="70" 
                                                 Value="{Binding Source={x:Static t:UserSettings.All}, Path=CinemagraphEraserHeight, Mode=TwoWay}"/>

                                <TextBlock Grid.Row="2" Grid.Column="0" Text="{DynamicResource S.FreeDrawing.Tip}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <Grid Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>

                                    <n:ExtendedRadioButton Grid.Row="0" Grid.Column="0" x:Name="RectangleEraser2RadioButton" Icon="{StaticResource Vector.Rectangle}" 
                                                           Text="{DynamicResource S.FreeDrawing.Rectangle}" Cursor="Hand" ContentWidth="20" ContentHeight="20" Margin="3,3" Padding="3"
                                                           IsChecked="{Binding CinemagraphEraserStylusTip, Source={x:Static t:UserSettings.All}, 
                                                           Converter={StaticResource StylusTipToBoolConverter}, ConverterParameter=Rectangle}"/>
                                    <n:ExtendedRadioButton Grid.Row="0" Grid.Column="1" x:Name="ElipseEraser2RadioButton" Icon="{StaticResource Vector.Ellipse}" 
                                                           Text="{DynamicResource S.FreeDrawing.Ellipse}" Cursor="Hand" ContentWidth="20" ContentHeight="20" Margin="0,3" Padding="3"
                                                           IsChecked="{Binding CinemagraphEraserStylusTip, Source={x:Static t:UserSettings.All}, 
                                                           Converter={StaticResource StylusTipToBoolConverter}, ConverterParameter=Ellipse}"/>
                                </Grid>
                            </Grid>

                            <Grid Grid.Row="4" Grid.Column="0" Margin="10,10,5,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>

                                <Border Grid.Column="0" Width="15" Height="15" Background="{StaticResource Vector.Info}" Opacity="{DynamicResource Element.Opacity}"/>
                                <TextBlock Grid.Column="1" Text="{DynamicResource S.Cinemagraph.Info}" Foreground="{DynamicResource Element.Foreground.Detail}" 
                                           FontStyle="Italic" FontSize="12" Padding="3" TextWrapping="WrapWithOverflow"/>
                            </Grid>
                        </Grid>

                        <Grid x:Name="OverrideDelayGrid" Visibility="Collapsed">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="27"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <n:LabelSeparator Grid.Row="0" Text="{DynamicResource S.Delay.NewValue}"/>
                            <Grid Grid.Row="1" Margin="10,0,0,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.DelayMs}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:IntegerUpDown Grid.Row="0" Grid.Column="1" x:Name="NewDelayIntegerUpDown" Minimum="10" Maximum="25500" Margin="10,5" MinWidth="80" 
                                                 Value="{Binding Source={x:Static t:UserSettings.All}, Path=OverrideDelay, Mode=TwoWay}"/>
                                <TextBlock Grid.Row="0" Grid.Column="2" Text="ms" VerticalAlignment="Center" HorizontalAlignment="Left" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                            </Grid>

                            <Grid Grid.Row="2" Grid.Column="0" Margin="10,10,5,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>

                                <Border Grid.Column="0" Width="15" Height="15" Background="{StaticResource Vector.Info}" Opacity="{DynamicResource Element.Opacity}"/>
                                <TextBlock Grid.Column="1" Text="{DynamicResource S.Delay.Override.Info}" Foreground="{DynamicResource Element.Foreground.Detail}" 
                                           FontStyle="Italic" FontSize="12" Padding="3" TextWrapping="WrapWithOverflow"/>
                            </Grid>
                        </Grid>

                        <Grid x:Name="IncreaseDecreaseDelayGrid" Visibility="Collapsed">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="27"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <n:LabelSeparator Grid.Row="0" Text="{DynamicResource S.Delay.DecreaseIncrease}"/>
                            <Grid Grid.Row="1" Margin="10,0,0,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.ValueMs}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:IntegerUpDown Grid.Row="0" Grid.Column="1" x:Name="IncreaseDecreaseDelayIntegerUpDown" Minimum="-10000" Maximum="10000" Margin="10,5" MinWidth="80" 
                                                 Value="{Binding Source={x:Static t:UserSettings.All}, Path=IncrementDecrementDelay, Mode=TwoWay}"/>
                                <TextBlock Grid.Row="0" Grid.Column="2" Text="ms" VerticalAlignment="Center" HorizontalAlignment="Left" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                            </Grid>

                            <Grid Grid.Row="2" Grid.Column="0" Margin="10,10,5,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>

                                <Border Grid.Column="0" Width="15" Height="15" Background="{StaticResource Vector.Info}" Opacity="{DynamicResource Element.Opacity}"/>
                                <TextBlock Grid.Column="1" Text="{DynamicResource S.Delay.IncreaseDecrease.Info}" Foreground="{DynamicResource Element.Foreground.Detail}" 
                                           FontStyle="Italic" FontSize="12" Padding="3" TextWrapping="WrapWithOverflow"/>
                            </Grid>
                        </Grid>

                        <Grid x:Name="ScaleDelayGrid" Visibility="Collapsed">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="27"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <n:LabelSeparator Grid.Row="0" Text="{DynamicResource S.Delay.Scale}"/>
                            <Grid Grid.Row="1" Margin="10,0,0,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.ScaleValue}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:IntegerUpDown Grid.Row="0" Grid.Column="1" x:Name="ScaleDelayIntegerUpDown" Minimum="1" Maximum="1000" Margin="10,5" MinWidth="80" 
                                                 Value="{Binding Source={x:Static t:UserSettings.All}, Path=ScaleDelay, Mode=TwoWay}"/>
                                <TextBlock Grid.Row="0" Grid.Column="2" Text="%" VerticalAlignment="Center" HorizontalAlignment="Left" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                            </Grid>

                            <Grid Grid.Row="2" Grid.Column="0" Margin="10,10,5,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>

                                <Border Grid.Column="0" Width="15" Height="15" Background="{StaticResource Vector.Info}" Opacity="{DynamicResource Element.Opacity}"/>
                                <TextBlock Grid.Column="1" Text="{DynamicResource S.Delay.Scale.Info}" Foreground="{DynamicResource Element.Foreground.Detail}" 
                                           FontStyle="Italic" FontSize="12" Padding="3" TextWrapping="WrapWithOverflow"/>
                            </Grid>
                        </Grid>

                        <Grid x:Name="FadeGrid" Visibility="Collapsed">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <n:LabelSeparator Grid.Row="0" Text="{DynamicResource S.Transitions.FadeTo}"/>
                            <Grid Grid.Row="1" Margin="10,0,0,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>

                                <n:ExtendedRadioButton Grid.Row="0" Grid.Column="0" x:Name="FadeToFrameRadioButton" Icon="{StaticResource Vector.Image}" 
                                                       IsChecked="{Binding FadeToType, Source={x:Static t:UserSettings.All}, Converter={StaticResource EnumToBool}, ConverterParameter={x:Static u:FadeToType.NextFrame}}"
                                                       Text="{DynamicResource S.Transitions.FadeTo.Frame}" Cursor="Hand" ContentWidth="20" ContentHeight="20" Margin="0,2" Padding="2" MinHeight="30"/>

                                <n:ExtendedRadioButton Grid.Row="0" Grid.Column="1" x:Name="FadeToColorRadioButton" Icon="{StaticResource Vector.Colors}" 
                                                       IsChecked="{Binding FadeToType, Source={x:Static t:UserSettings.All}, Converter={StaticResource EnumToBool}, ConverterParameter={x:Static u:FadeToType.Color}}"
                                                       Text="{DynamicResource S.Transitions.FadeTo.Color}" Cursor="Hand" ContentWidth="20" ContentHeight="20" Margin="0,2" Padding="2" MinHeight="30"/>
                            </Grid>

                            <n:LabelSeparator Grid.Row="2" Text="{DynamicResource S.Transitions.Color}" Visibility="{Binding ElementName=FadeToColorRadioButton, Path=IsChecked, Converter={StaticResource Bool2Visibility}}"/>
                            <Grid Grid.Row="3" Margin="10,0,0,0" Visibility="{Binding ElementName=FadeToColorRadioButton, Path=IsChecked, Converter={StaticResource Bool2Visibility}}">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Caption.Color}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:ColorBox Grid.Row="0" Grid.Column="1" SelectedColor="{Binding FadeToColor, Source={x:Static t:UserSettings.All}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="10,5"/>
                            </Grid>

                            <n:LabelSeparator Grid.Row="4" Text="{DynamicResource S.Transitions.Length}"/>
                            <Slider Grid.Row="5" Grid.Column="0" x:Name="FadeSlider" Margin="10,5,5,5" Minimum="1" Maximum="25" 
                                    AutoToolTipPlacement="TopLeft" SmallChange="1" IsSnapToTickEnabled="True"
                                    Value="{Binding Source={x:Static t:UserSettings.All}, Path=FadeTransitionLength, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>

                            <n:LabelSeparator Grid.Row="6" Text="{DynamicResource S.Transitions.Delay}"/>
                            <Grid Grid.Row="7" Margin="10,0,0,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.DelayMs}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:IntegerUpDown Grid.Row="0" Grid.Column="1" x:Name="FadeDelayIntegerUpDown" Minimum="10" Maximum="25500" Margin="10,5" MinWidth="80" 
                                                 Value="{Binding Source={x:Static t:UserSettings.All}, Path=FadeTransitionDelay, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                            </Grid>

                            <Grid Grid.Row="8" Margin="5,3">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>

                                <Image Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" x:Name="TransitionImage"
                                       Source="{Binding Path=ImageSource, Converter={StaticResource UriToBitmapConverter}}" Stretch="Uniform"
                                       Effect="{StaticResource Shadow.Border.Large}">
                                    <Image.Style>
                                        <Style TargetType="FrameworkElement">
                                            <Style.Triggers>
                                                <DataTrigger Binding="{Binding ElementName=FadeGrid, Path=Visibility}" Value="Visible">
                                                    <Setter Property="DataContext" Value="{Binding ElementName=ZoomBoxControl}"/>
                                                </DataTrigger>
                                            </Style.Triggers>
                                            <Style.Setters>
                                                <Setter Property="DataContext" Value="{x:Null}"/>
                                            </Style.Setters>
                                        </Style>
                                    </Image.Style>
                                </Image>

                                <TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding ElementName=FadeSlider, Path=Value, StringFormat='{} {0}x'}" 
                                           FontSize="16" Padding="2,0" Foreground="{DynamicResource Element.Foreground.Detail}" VerticalAlignment="Center"/>

                                <Border Grid.Row="1" Grid.Column="1" Background="{StaticResource Vector.Arrow.Blue.Right}" Width="13" Height="15" Opacity="{DynamicResource Element.Opacity}"/>

                                <Border Grid.Row="0" Grid.Column="2" Grid.RowSpan="2" BorderThickness="0" 
                                        Background="{Binding FadeToColor, Source={x:Static t:UserSettings.All}, Converter={StaticResourceExtension ColorToBrush}}"
                                        Width="{Binding ElementName=TransitionImage, Path=ActualWidth, Mode=OneWay}" Height="{Binding ElementName=TransitionImage, Path=ActualHeight, Mode=OneWay}"
                                        Effect="{StaticResource Shadow.Border.Large}" Visibility="{Binding ElementName=FadeToColorRadioButton, Path=IsChecked, Converter={StaticResource Bool2Visibility}}"/>

                                <TextBlock Grid.Row="0" Grid.Column="2" Grid.RowSpan="2" Text="{DynamicResource S.Transitions.FadeTo.Frame}"
                                           VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"
                                           Visibility="{Binding ElementName=FadeToFrameRadioButton, Path=IsChecked, Converter={StaticResource Bool2Visibility}}"/>
                            </Grid>

                            <Grid Grid.Row="9" Grid.Column="0" Margin="10,10,5,0"
                                  Visibility="{Binding ElementName=FadeToFrameRadioButton, Path=IsChecked, Converter={StaticResource Bool2Visibility}}">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>

                                <Border Grid.Column="0" Width="15" Height="15" Background="{StaticResource Vector.Info}" Opacity="{DynamicResource Element.Opacity}"/>
                                <TextBlock Grid.Column="1" Text="{DynamicResource S.Transitions.Info}" Foreground="{DynamicResource Element.Foreground.Detail}" 
                                           FontStyle="Italic" FontSize="12" Padding="3" TextWrapping="WrapWithOverflow"/>
                            </Grid>
                        </Grid>

                        <Grid x:Name="SlideGrid" Visibility="Collapsed">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <n:LabelSeparator Grid.Row="0" Text="{DynamicResource S.Transitions.Length}"/>
                            <Slider Grid.Row="1" Grid.Column="0" x:Name="SlideSlider" Minimum="1" Maximum="20" 
                                    AutoToolTipPlacement="TopLeft" SmallChange="1" IsSnapToTickEnabled="True" Margin="10,5,5,5"/>

                            <n:LabelSeparator Grid.Row="2" Text="{DynamicResource S.Transitions.Delay}"/>
                            <Grid Grid.Row="3" Margin="10,0,0,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.DelayMs}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:IntegerUpDown Grid.Row="0" Grid.Column="1" x:Name="SlideDelayIntegerUpDown" Minimum="10" Maximum="25500" Margin="10,5" MinWidth="80" 
                                                 Value="{Binding Source={x:Static t:UserSettings.All}, Path=SlideTransitionDelay, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                            </Grid>

                            <Grid Grid.Row="4" Margin="5,3">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>

                                <Image Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" x:Name="TransitionImage2"
                                       Source="{Binding Path=ImageSource, Converter={StaticResource UriToBitmapConverter}}" Stretch="Uniform"
                                       Effect="{StaticResource Shadow.Border.Large}">
                                    <Image.Style>
                                        <Style TargetType="FrameworkElement">
                                            <Style.Triggers>
                                                <DataTrigger Binding="{Binding ElementName=SlideGrid, Path=Visibility}" Value="Visible">
                                                    <Setter Property="DataContext" Value="{Binding ElementName=ZoomBoxControl}"/>
                                                </DataTrigger>
                                            </Style.Triggers>
                                            <Style.Setters>
                                                <Setter Property="DataContext" Value="{x:Null}"/>
                                            </Style.Setters>
                                        </Style>
                                    </Image.Style>
                                </Image>

                                <TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding ElementName=SlideSlider, Path=Value, StringFormat='{} {0}x'}" 
                                           FontSize="16" Padding="2,0" Foreground="{DynamicResource Element.Foreground.Detail}" VerticalAlignment="Center"/>

                                <Border Grid.Row="1" Grid.Column="1" Background="{StaticResource Vector.Arrow.Blue.Right}" Width="13" Height="15" Opacity="{DynamicResource Element.Opacity}"/>

                                <Border Grid.Row="0" Grid.Column="2" Grid.RowSpan="2" BorderThickness="0" 
                                        Width="{Binding ElementName=TransitionImage, Path=ActualWidth, Mode=OneWay}" Height="{Binding ElementName=TransitionImage, Path=ActualHeight, Mode=OneWay}"
                                        Effect="{StaticResource Shadow.Border.Large}" Visibility="{Binding ElementName=FadeToColorRadioButton, Path=IsChecked, Converter={StaticResource Bool2Visibility}}"/>

                                <TextBlock Grid.Row="0" Grid.Column="2" Grid.RowSpan="2" Text="{DynamicResource S.Transitions.FadeTo.Frame}" Foreground="{DynamicResource Element.Foreground.Medium}"
                                           VerticalAlignment="Center" HorizontalAlignment="Center"/>
                            </Grid>

                            <!--<Grid Grid.Row="2" Visibility="Visible">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition/>
                                    <ColumnDefinition/>
                                    <ColumnDefinition/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>

                                <n:ExtendedRadioButton Grid.Column="0" x:Name="FromRightRadioButton" Icon="{StaticResource Vector.Info}" 
                                                       Cursor="Hand" MaxSize="20" Margin="0,3" Padding="0,5" IsChecked="True"/>

                                <n:ExtendedRadioButton Grid.Column="1" x:Name="FromTopRadioButton" Icon="{StaticResource Vector.Info}" 
                                                       Cursor="Hand" MaxSize="20" Margin="0,3" Padding="0,5"/>

                                <n:ExtendedRadioButton Grid.Column="2" x:Name="FromLeftRadioButton" Icon="{StaticResource Vector.Info}" 
                                                       Cursor="Hand" MaxSize="20" Margin="0,3" Padding="0,5"/>

                                <n:ExtendedRadioButton Grid.Column="3" x:Name="FromBottomRadioButton" Icon="{StaticResource Vector.Info}" 
                                                       Cursor="Hand" MaxSize="20" Margin="0,3" Padding="0,5"/>
                            </Grid>-->

                            <Grid Grid.Row="5" Margin="10,10,5,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>

                                <Border Grid.Column="0" Width="15" Height="15" Background="{StaticResource Vector.Info}" Opacity="{DynamicResource Element.Opacity}"/>
                                <TextBlock Grid.Column="1" Text="{DynamicResource S.Transitions.Info}" Foreground="{DynamicResource Element.Foreground.Detail}"
                                           FontStyle="Italic" FontSize="12" Padding="3" TextWrapping="WrapWithOverflow"/>
                            </Grid>
                        </Grid>

                        <Grid x:Name="ReduceGrid" Visibility="Collapsed">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="27"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <n:LabelSeparator Grid.Row="0" Text="{DynamicResource S.Reduce.Header}"/>
                            <Grid Grid.Row="1" Margin="10,0,0,0">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.Reduce.Factor}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:IntegerUpDown Grid.Row="0" Grid.Column="1" x:Name="ReduceFactorIntegerUpDown" Minimum="1" Maximum="20" Margin="10,5" MinWidth="80" 
                                                 Value="{Binding Source={x:Static t:UserSettings.All}, Path=ReduceFactor, Mode=TwoWay}"/>

                                <TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource S.Reduce.Count}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:IntegerUpDown Grid.Row="1" Grid.Column="1" x:Name="ReduceCountIntegerUpDown" Minimum="1" Maximum="20" Margin="10,5" MinWidth="80" 
                                                 Value="{Binding Source={x:Static t:UserSettings.All}, Path=ReduceCount, Mode=TwoWay}"/>

                                <TextBlock Grid.Row="2" Grid.Column="0" Text="{DynamicResource S.Reduce.Delay}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <ComboBox Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2" Margin="10,5" 
                                          SelectedIndex="{Binding Source={x:Static t:UserSettings.All}, Path=ReduceDelay, Converter={StaticResource EnumToInt}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
                                    <ComboBoxItem Content="{DynamicResource S.Reduce.Delay.NoAdjustment}"/>
                                    <ComboBoxItem Content="{DynamicResource S.Reduce.Delay.Previous}"/>
                                    <ComboBoxItem Content="{DynamicResource S.Reduce.Delay.Evenly}"/>
                                </ComboBox>
                                
                                <n:ExtendedCheckBox Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="3" Text="{DynamicResource S.Reduce.ApplyToAll}" Margin="0,5"
                                                    IsChecked="{Binding Source={x:Static t:UserSettings.All}, Path=ReduceApplyToAll, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                                    ToolTip="{DynamicResource S.Reduce.ApplyToAll.Info}"/>
                            </Grid>

                            <Grid Grid.Row="2" Grid.Column="0" Margin="10,10,5,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>

                                <Border Grid.Column="0" Width="15" Height="15" Background="{StaticResource Vector.Info}" Opacity="{DynamicResource Element.Opacity}"/>
                                <TextBlock Grid.Column="1" x:Name="ReduceTextBlock" Foreground="{DynamicResource Element.Foreground.Detail}" Tag="{DynamicResource S.Reduce.Info}"
                                           FontStyle="Italic" FontSize="12" Padding="3" TextWrapping="WrapWithOverflow">
                                    <TextBlock.Text>
                                        <MultiBinding Converter="{StaticResource FormatConverter}">
                                            <Binding ElementName="ReduceTextBlock" Path="Tag"/>
                                            <Binding Source="{x:Static t:UserSettings.All}" Path="ReduceCount"/>
                                            <Binding Source="{x:Static t:UserSettings.All}" Path="ReduceFactor"/>
                                        </MultiBinding>
                                    </TextBlock.Text>
                                </TextBlock>
                            </Grid>
                        </Grid>

                        <Grid x:Name="RemoveDuplicatesGrid" Visibility="Collapsed">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="27"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <n:LabelSeparator Grid.Row="0" Text="{DynamicResource S.RemoveDuplicates.Header}"/>
                            <Grid Grid.Row="1" Margin="10,0,0,0">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource S.RemoveDuplicates.Similarity}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <n:DoubleUpDown Grid.Row="0" Grid.Column="1" x:Name="DuplicatesSimilarityDoubleUpDown" Minimum="0.1" Maximum="100" Margin="10,5" MinWidth="80" 
                                                Value="{Binding Source={x:Static t:UserSettings.All}, Path=DuplicatesSimilarity, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>

                                <TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource S.RemoveDuplicates.Removal}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <ComboBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Margin="10,5" 
                                          SelectedIndex="{Binding Source={x:Static t:UserSettings.All}, Path=DuplicatesRemoval, Converter={StaticResource EnumToInt}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
                                    <ComboBoxItem Content="{DynamicResource S.RemoveDuplicates.Removal.First}"/>
                                    <ComboBoxItem Content="{DynamicResource S.RemoveDuplicates.Removal.Last}"/>
                                </ComboBox>

                                <TextBlock Grid.Row="2" Grid.Column="0" Text="{DynamicResource S.RemoveDuplicates.Delay}" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                                <ComboBox Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2" Margin="10,5" 
                                          SelectedIndex="{Binding Source={x:Static t:UserSettings.All}, Path=DuplicatesDelay, Converter={StaticResource EnumToInt}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
                                    <ComboBoxItem Content="{DynamicResource S.RemoveDuplicates.Delay.NoAdjustment}"/>
                                    <ComboBoxItem Content="{DynamicResource S.RemoveDuplicates.Delay.Average}"/>
                                    <ComboBoxItem Content="{DynamicResource S.RemoveDuplicates.Delay.Sum}"/>
                                </ComboBox>
                            </Grid>

                            <Grid Grid.Row="2" Grid.Column="0" Margin="10,10,5,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>

                                <Border Grid.Column="0" Width="15" Height="15" Background="{StaticResource Vector.Info}" Opacity="{DynamicResource Element.Opacity}"/>
                                <TextBlock Grid.Column="1" x:Name="DuplicatesTextBlock" Foreground="{DynamicResource Element.Foreground.Detail}" Tag="{DynamicResource S.RemoveDuplicates.Info}"
                                           FontStyle="Italic" FontSize="12" Padding="3" TextWrapping="WrapWithOverflow">
                                    <TextBlock.Text>
                                        <MultiBinding Converter="{StaticResource FormatConverter}">
                                            <Binding ElementName="DuplicatesTextBlock" Path="Tag"/>
                                            <Binding Source="{x:Static t:UserSettings.All}" Path="DuplicatesSimilarity"/>
                                        </MultiBinding>
                                    </TextBlock.Text>
                                </TextBlock>
                            </Grid>
                        </Grid>
                    </Grid>
                </ScrollViewer>

                <!--Apply/Save or Cancel-->
                <Grid Grid.Row="2" x:Name="ActionLowerGrid" Background="{DynamicResource Panel.Background.Level3}" Height="44">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>

                    <n:ExtendedButton Grid.Column="0" x:Name="ApplyButton" Text="{DynamicResource S.Action.Apply}" Padding="2,0" MinWidth="90" KeyGesture="Alt + E / Enter"
                                      FontSize="13" Margin="5" ContentHeight="22" Icon="{StaticResource Vector.Ok}" Command="{StaticResource Command.Ok}"/>

                    <n:ExtendedButton Grid.Column="1" x:Name="CancelButton" Text="{DynamicResource S.Action.Cancel}" Padding="2,0" MinWidth="90" KeyGesture="Esc"
                                      FontSize="13" Margin="5" ContentHeight="22" Icon="{StaticResource Vector.Cancel}" Command="{StaticResource Command.Cancel}"/>
                </Grid>
            </Grid>
        </Grid>

        <!--Lower part of the Window-->
        <ListView Grid.Row="2" x:Name="FrameListView" BorderThickness="0,1,0,0" IsTabStop="False" Focusable="False" Style="{StaticResource Style.ListView.Frames}"
                  IsEnabled="{Binding Path=IsLoading, ElementName=EditorWindow, Converter={StaticResource InvertedBoolConverter}}"
                  Visibility="{Binding RelativeSource={RelativeSource Self}, Path=HasItems, Converter={StaticResource Bool2Visibility}}"
                  SelectionChanged="FrameListView_SelectionChanged" PreviewKeyDown="FrameListView_OnPreviewKeyDown">

            <ListView.Resources>
                <ContextMenu x:Key="FrameListContextMenu">
                    <n:ExtendedMenuItem Header="{DynamicResource S.Editor.List.OpenImage}" Icon="{StaticResource Vector.Image}" ContentHeight="16" ContentWidth="16" Command="{StaticResource Command.OpenImage}"/>
                    <n:ExtendedMenuItem Header="{DynamicResource S.Editor.List.ExploreFolder}" Icon="{StaticResource Vector.Open}" ContentHeight="16" ContentWidth="16" Command="{StaticResource Command.ExploreFolder}"/>
                </ContextMenu>
            </ListView.Resources>

            <ListView.ItemContainerStyle>
                <Style TargetType="ListBoxItem">
                    <EventSetter Event="PreviewMouseLeftButtonDown" Handler="Item_PreviewMouseLeftButtonDown"/>
                    <Setter Property="ContextMenu" Value="{StaticResource FrameListContextMenu}"/>
                </Style>
            </ListView.ItemContainerStyle>
        </ListView>

        <!--Status bar-->
        <Border Grid.Row="3" x:Name="LowerGrid" Height="20">
            <Grid x:Name="LowerStatusBar" Height="20" Background="{DynamicResource Panel.Background.Level3}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="7"/>
                    <ColumnDefinition/>
                    <ColumnDefinition Width="5"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="5"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="5"/>
                    <ColumnDefinition Width="200"/>
                </Grid.ColumnDefinitions>

                <Grid x:Name="StatusGrid" Grid.Column="0" Visibility="Collapsed">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>

                    <Label Grid.Column="0" x:Name="StatusLabel" Content="Status" Padding="0" VerticalContentAlignment="Center" Margin="5,0" Foreground="{DynamicResource Element.Foreground.Medium}"/>
                    <ProgressBar Grid.Column="1" x:Name="StatusProgressBar" Height="8" Width="200" Margin="2,0" VerticalAlignment="Center"/>
                    <n:ExtendedButton Grid.Column="2" x:Name="CancelLoadingButton" Width="25" Icon="{StaticResource Vector.Cancel}" Style="{StaticResource Style.Button.NoText}" ContentWidth="15" ContentHeight="15"
                                      ToolTip="{DynamicResource S.Editor.CancelDiscard}" Visibility="{Binding ElementName=EditorWindow, Path=IsCancelable, Converter={StaticResource Bool2Visibility}}" 
                                      Click="CancelLoadingButton_Click"/>
                </Grid>

                <Separator Grid.Column="1" Width="1" Margin="3,2"/>

                <StackPanel Grid.Column="2" x:Name="HintStackPanel" Orientation="Horizontal" VerticalAlignment="Stretch" HorizontalAlignment="Center" Visibility="Collapsed" ToolTip="{Binding ElementName=HintTextBlock, Path=Text}">
                    <Border Background="{StaticResource Vector.Info}" Height="14" Width="14" Margin="0,0,8,0" VerticalAlignment="Center" Opacity="{DynamicResource Element.Opacity}"/>
                    <TextBlock x:Name="HintTextBlock" Foreground="{DynamicResource Element.Foreground.Hint}" FontSize="13" VerticalAlignment="Center" Margin="0,-1,0,0" TextTrimming="CharacterEllipsis" TextDecorations="{x:Null}"/>
                </StackPanel>

                <Separator Grid.Column="3" Width="1" Margin="1,2" Visibility="{Binding ElementName=WelcomeGrid, Path=Visibility, Converter={StaticResource InvertedVisibilityConverter}, ConverterParameter=0}"/>

                <StackPanel Grid.Column="4" Orientation="Horizontal" Visibility="{Binding ElementName=WelcomeGrid, Path=Visibility, Converter={StaticResource InvertedVisibilityConverter}, ConverterParameter=0}"
                            IsEnabled="{Binding ElementName=Zoom100Button, Path=IsEnabled}" ToolTip="{DynamicResource S.Editor.Home.Zoom}">
                    <Border Background="{StaticResource Vector.Zoom}" Height="16" Width="16" Opacity="{DynamicResource Element.Opacity}"/>
                    <n:IntegerUpDown Margin="1" Minimum="5" Maximum="500" Style="{StaticResource IntegerUpDown.Minimal}"
                                     Value="{Binding Zoom, Converter={StaticResource IntToDecimalConverter}, ElementName=ZoomBoxControl, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                    <TextBlock Text="%" VerticalAlignment="Center" Foreground="{DynamicResource Element.Foreground.Gray112}"/>
                </StackPanel>

                <Separator Grid.Column="5" Width="1" Margin="1,2" Visibility="{Binding ElementName=WelcomeGrid, Path=Visibility, Converter={StaticResource InvertedVisibilityConverter}, ConverterParameter=0}"/>

                <Grid Grid.Column="6" x:Name="InfoGrid" Visibility="{Binding ElementName=WelcomeGrid, Path=Visibility, Converter={StaticResource InvertedVisibilityConverter}, ConverterParameter=0}"
                      ToolTip="{DynamicResource S.Editor.FrameNumbersInfo}" ToolTipService.Placement="Bottom">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>

                    <Label Grid.Column="0" Content="{Binding ElementName=FrameListView, Path=Items.Count}" Padding="0" VerticalContentAlignment="Center" 
                           FontSize="14" Foreground="#FF00A000" Margin="3,0,3,0"/>
                    <Label Grid.Column="1" Content="{Binding ElementName=FrameListView, Path=SelectedItems.Count}" Padding="0" VerticalContentAlignment="Center" 
                           FontSize="14" Foreground="#FFC80000" Margin="3,0,3,0"/>
                    <Label Grid.Column="2" Content="{Binding ElementName=FrameListView, Path=SelectedIndex}" Padding="0" VerticalContentAlignment="Center" 
                           FontSize="14" Foreground="#FF0064C8" Margin="3,0,3,0"/>
                </Grid>

                <Separator Grid.Column="7" Width="1" Margin="1,2"/>

                <Grid Grid.Column="8" x:Name="CommandGrid">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="40"/>
                        <ColumnDefinition Width="40"/>
                        <ColumnDefinition Width="40"/>
                        <ColumnDefinition Width="40"/>
                        <ColumnDefinition Width="40"/>
                    </Grid.ColumnDefinitions>

                    <n:ExtendedButton Grid.Column="0" x:Name="FirstRepeatButton" Icon="{StaticResource Vector.First.Green}" ContentWidth="20" ContentHeight="12"
                                      Width="40" Text="" Style="{StaticResource Style.Button.NoText}" Command="{StaticResource Command.FirstFrame}"
                                      ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                      ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>
                    <n:ExtendedRepeatButton Grid.Column="1" x:Name="PreviousRepeatButton" Icon="{StaticResource Vector.Previous.Green}" ContentWidth="17" ContentHeight="17"
                                            Width="40" Style="{StaticResource Style.RepeatButton.NoText}" Command="{StaticResource Command.PreviousFrame}"
                                            ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                            ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                    <n:ExtendedButton Grid.Column="2" x:Name="PlayPauseButton" Icon="{StaticResource Vector.Play}" ContentWidth="15" ContentHeight="15"
                                      Width="40" Style="{StaticResource Style.Button.NoText}" Command="{StaticResource Command.Play}"
                                      ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                      ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>

                    <n:ExtendedRepeatButton Grid.Column="3" x:Name="NextRepeatButton" Icon="{StaticResource Vector.Next.Green}" ContentWidth="17" ContentHeight="17"
                                            Width="40" Style="{StaticResource Style.RepeatButton.NoText}" Command="{StaticResource Command.NextFrame}"
                                            ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                            ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>
                    <n:ExtendedButton Grid.Column="4" x:Name="LastRepeatButton" Icon="{StaticResource Vector.Last.Green}" ContentWidth="20" ContentHeight="12"
                                      Width="40" Style="{StaticResource Style.Button.NoText}" Command="{StaticResource Command.LastFrame}"
                                      ToolTip="{Binding Command, RelativeSource={RelativeSource Self}, Converter={StaticResource CommandToInputGestureText}}" 
                                      ToolTipService.Placement="Bottom" ToolTipService.HorizontalOffset="-5"/>
                </Grid>
            </Grid>
        </Border>
    </Grid>
</Window>
