<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:n="clr-namespace:ScreenToGif.Controls"
                    xmlns:c="clr-namespace:ScreenToGif.Util.Converters"
                    xmlns:s="clr-namespace:System;assembly=mscorlib">

    <c:MultiLineTitle x:Key="MultiLineTitleConverter"/>

    
    <!--Button • Border • Horizontal • Text-->
    <Style TargetType="{x:Type n:ExtendedButton}" BasedOn="{StaticResource {x:Type Button}}">
        <Setter Property="Foreground" Value="{DynamicResource Element.Foreground}"/>
        <Setter Property="Background" Value="{DynamicResource Brush.Button.Background}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Border}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="Padding" Value="3,1"/>
        <Setter Property="ContentWidth" Value="16"/>
        <Setter Property="ContentHeight" Value="16"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type n:ExtendedButton}">
                    <Border x:Name="MainBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" MinHeight="{TemplateBinding MinHeight}" Background="{TemplateBinding Background}">
                        <Border x:Name="InnerBorder" Background="Transparent">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>

                                <Border Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Background="{TemplateBinding Icon}" Margin="5,3,0,3" Opacity="{DynamicResource Element.Opacity}"
                                        Height="{TemplateBinding ContentHeight}" Width="{TemplateBinding ContentWidth}" VerticalAlignment="Center" HorizontalAlignment="Center"/>

                                <TextBlock Grid.Row="0" Grid.Column="1" x:Name="TextBlockInternal" MaxWidth="{Binding Path=ActualWidth, RelativeSource={RelativeSource TemplatedParent}}"
                                           HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" Foreground="{TemplateBinding Foreground}"
                                           VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Text="{TemplateBinding Text}" TextWrapping="{TemplateBinding TextWrapping}" Effect="{TemplateBinding Effect}"/>

                                <TextBlock Grid.Row="1" Grid.Column="1" x:Name="KeyGestureTextBlock" Text="{TemplateBinding KeyGesture}" Foreground="{DynamicResource Element.Foreground.Gray112}" 
                                           FontSize="10" HorizontalAlignment="Center" Margin="0" Padding="0" Height="12"/>
                            </Grid>
                        </Border>
                    </Border>

                    <ControlTemplate.Triggers>
                        <Trigger Property="KeyGesture" Value="{x:Static s:String.Empty}">
                            <Setter TargetName="KeyGestureTextBlock" Property="Visibility" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="IsKeyboardFocused" Value="True">
                            <Setter TargetName="MainBorder" Property="Margin" Value="-1"/>
                            <Setter TargetName="InnerBorder" Property="Background" Value="{DynamicResource Brush.Button.Background.Focused}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Hover}"/>
                <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Border.Hover}"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Pressed}"/>
                <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Border.Pressed}"/>
            </Trigger>
            <Trigger Property="IsKeyboardFocused" Value="True">
                <Setter Property="BorderThickness" Value="1.5"/>
                <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Border.Focused}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Opacity" Value="0.7"/>
            </Trigger>
        </Style.Triggers>
    </Style>
    
    <!--Button • Border • Vertical • Text-->
    <Style TargetType="{x:Type n:ExtendedButton}" BasedOn="{StaticResource {x:Type Button}}" x:Key="Style.Button.Vertical.Border">
        <Setter Property="Foreground" Value="{DynamicResource Element.Foreground}"/>
        <Setter Property="Background" Value="{DynamicResource Brush.Button.Background}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Border}"/>
        <Setter Property="TextWrapping" Value="WrapWithOverflow"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type n:ExtendedButton}">
                    <Border x:Name="MainBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" MinHeight="{TemplateBinding MinHeight}" Background="{TemplateBinding Background}">
                        <Border x:Name="InnerBorder" Background="Transparent">
                            <StackPanel Orientation="Vertical" SnapsToDevicePixels="True" HorizontalAlignment="Center" VerticalAlignment="Center">
                                <Border Background="{TemplateBinding Icon}" Margin="2,0" Opacity="{DynamicResource Element.Opacity}"
                                        Height="{TemplateBinding ContentHeight}" Width="{TemplateBinding ContentWidth}" VerticalAlignment="Center" HorizontalAlignment="Center"/>

                                <TextBlock x:Name="TextBlockInternal" MaxWidth="{Binding Path=ActualWidth, RelativeSource={RelativeSource TemplatedParent}}" 
                                           HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" 
                                           VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Text="{TemplateBinding Text}" 
                                           TextWrapping="{TemplateBinding TextWrapping}" Effect="{TemplateBinding Effect}" Padding="2"/>
                            </StackPanel>
                        </Border>
                    </Border>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsKeyboardFocused" Value="True">
                            <Setter TargetName="MainBorder" Property="Margin" Value="-1"/>
                            <Setter TargetName="InnerBorder" Property="Background" Value="{DynamicResource Brush.Button.Background.Focused}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Hover}"/>
                <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Border.Hover}"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Pressed}"/>
                <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Border.Pressed}"/>
            </Trigger>
            <Trigger Property="IsKeyboardFocused" Value="True">
                <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
                <Setter Property="BorderThickness" Value="1.5"/>
                <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Border.Focused}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Opacity" Value="0.7"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <!--Button • Border • Horizontal • Text • Yellow-->
    <Style TargetType="{x:Type n:ExtendedButton}" BasedOn="{StaticResource {x:Type Button}}" x:Key="Style.Button.Horizontal.Special">
        <Setter Property="Background" Value="{DynamicResource Brush.Button.Paypal.Background}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Paypal.Border}"/>
        <Setter Property="Foreground" Value="{DynamicResource Brush.Button.Paypal.Foreground}"/>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type n:ExtendedButton}">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" MinHeight="{TemplateBinding MinHeight}" Background="{TemplateBinding Background}">
                        <StackPanel Orientation="Horizontal" SnapsToDevicePixels="True" HorizontalAlignment="Center" VerticalAlignment="Center">
                            <Border Background="{TemplateBinding Icon}" Margin="2,0" Opacity="{DynamicResource Element.Opacity}"
                                    Height="{TemplateBinding ContentHeight}" Width="{TemplateBinding ContentWidth}" VerticalAlignment="Center" HorizontalAlignment="Center"/>

                            <TextBlock x:Name="TextBlockInternal" MaxWidth="{Binding Path=ActualWidth, RelativeSource={RelativeSource TemplatedParent}}" 
                                       HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" 
                                       VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Text="{TemplateBinding Text}" Foreground="{TemplateBinding Foreground}"
                                       TextWrapping="{TemplateBinding TextWrapping}" Effect="{TemplateBinding Effect}" Padding="2"/>
                        </StackPanel>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Paypal.Background.Hover}"/>
                <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Paypal.Border.Hover}"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Paypal.Background.Pressed}"/>
                <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Paypal.Border.Pressed}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Opacity" Value="0.7"/>
            </Trigger>
        </Style.Triggers>
    </Style>


    <!--Button • No Border • Horizontal • Text-->
    <Style TargetType="{x:Type n:ExtendedButton}" BasedOn="{StaticResource {x:Type Button}}" x:Key="Style.Button.Horizontal">
        <Setter Property="Foreground" Value="{DynamicResource Element.Foreground}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="TextWrapping" Value="WrapWithOverflow"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type n:ExtendedButton}">
                    <Border x:Name="MainBorder" MinHeight="{TemplateBinding MinHeight}" Background="{TemplateBinding Background}" BorderThickness="0">
                        <Grid x:Name="InnerGrid" Margin="{TemplateBinding Padding}">
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>

                            <Border Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Background="{TemplateBinding Icon}" Margin="2" Opacity="{DynamicResource Element.Opacity}"
                                    Height="{TemplateBinding ContentHeight}" Width="{TemplateBinding ContentWidth}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                            
                            <TextBlock Grid.Row="0" Grid.Column="1" x:Name="TextBlockInternal" MaxWidth="{Binding Path=ActualWidth, RelativeSource={RelativeSource TemplatedParent}}" 
                                       HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="2,0" Foreground="{TemplateBinding Foreground}"
                                       VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Text="{TemplateBinding Text}" 
                                       TextWrapping="{TemplateBinding TextWrapping}" Effect="{TemplateBinding Effect}"/>

                            <TextBlock Grid.Row="1" Grid.Column="1" x:Name="KeyGestureTextBlock" Text="{TemplateBinding KeyGesture}" Margin="0,-10,2,0" Padding="0" Height="13"
                                       Foreground="{DynamicResource Element.Foreground.Gray112}" FontSize="10" HorizontalAlignment="Right"/>
                        </Grid>
                    </Border>

                    <ControlTemplate.Triggers>
                        <Trigger Property="KeyGesture" Value="{x:Static s:String.Empty}">
                            <Setter TargetName="KeyGestureTextBlock" Property="Visibility" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="IsKeyboardFocused" Value="True">
                            <Setter TargetName="InnerGrid" Property="Background" Value="{DynamicResource Brush.Button.Background.Focused}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Hover}"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Pressed}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Opacity" Value="0.7"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <!--Button • No Border • Horizontal • Text • No Image-->
    <Style TargetType="{x:Type n:ExtendedButton}" BasedOn="{StaticResource {x:Type Button}}" x:Key="Style.Button.Horizontal.NoImage">
        <Setter Property="Foreground" Value="{DynamicResource Element.Foreground}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="TextWrapping" Value="WrapWithOverflow"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type n:ExtendedButton}">
                    <Border x:Name="MainBorder" MinHeight="{TemplateBinding MinHeight}" Background="{TemplateBinding Background}">
                        <Grid x:Name="InnerGrid" Margin="{TemplateBinding Padding}">
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <TextBlock Grid.Row="0" x:Name="TextBlockInternal" Text="{TemplateBinding Text}" Margin="2,0" Foreground="{TemplateBinding Foreground}"
                                       HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" 
                                       TextWrapping="{TemplateBinding TextWrapping}" Effect="{TemplateBinding Effect}"/>

                            <TextBlock Grid.Row="1" x:Name="KeyGestureTextBlock" Text="{TemplateBinding KeyGesture}" Margin="0,-10,2,0" Padding="0" Height="13"
                                       Foreground="{DynamicResource Element.Foreground.Gray112}" FontSize="10" HorizontalAlignment="Right"/>
                        </Grid>
                    </Border>

                    <ControlTemplate.Triggers>
                        <Trigger Property="KeyGesture" Value="{x:Static s:String.Empty}">
                            <Setter TargetName="KeyGestureTextBlock" Property="Visibility" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="IsKeyboardFocused" Value="True">
                            <Setter TargetName="InnerGrid" Property="Background" Value="{DynamicResource Brush.Button.Background.Focused}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Hover}"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Pressed}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Opacity" Value="0.7"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <!--Button • No Border • Horizontal • Text • White-->
    <Style TargetType="{x:Type n:ExtendedButton}" BasedOn="{StaticResource {x:Type Button}}" x:Key="Style.Button.Horizontal.White">
        <Setter Property="Foreground" Value="{DynamicResource Element.Foreground}"/>
        <Setter Property="Background" Value="#20FFFFFF"/>
        <Setter Property="TextWrapping" Value="WrapWithOverflow"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type n:ExtendedButton}">
                    <Border x:Name="MainBorder" MinHeight="{TemplateBinding MinHeight}" Background="{TemplateBinding Background}">
                        <StackPanel x:Name="InnerStackPanel" Orientation="Horizontal" Background="Transparent">
                            <Border Background="{TemplateBinding Icon}" Margin="2" Opacity="{DynamicResource Element.Opacity}"
                                    Height="{TemplateBinding ContentHeight}" Width="{TemplateBinding ContentWidth}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
  
                            <Grid Margin="{TemplateBinding Padding}">
                                <Grid.RowDefinitions>
                                    <RowDefinition/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>

                                <TextBlock Grid.Row="0" x:Name="TextBlockInternal" MaxWidth="{Binding Path=ActualWidth, RelativeSource={RelativeSource TemplatedParent}}" 
                                           HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="2,0" Foreground="{TemplateBinding Foreground}"
                                           VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Text="{TemplateBinding Text}" 
                                           TextWrapping="{TemplateBinding TextWrapping}" Effect="{TemplateBinding Effect}"/>

                                <TextBlock Grid.Row="1" x:Name="KeyGestureTextBlock" Text="{TemplateBinding KeyGesture}" Margin="0,-10,2,0" Padding="0" Height="13"
                                           Foreground="{DynamicResource Element.Foreground.Gray112}" FontSize="10" HorizontalAlignment="Right"/>
                            </Grid>
                        </StackPanel>
                    </Border>

                    <ControlTemplate.Triggers>
                        <Trigger Property="KeyGesture" Value="{x:Static s:String.Empty}">
                            <Setter TargetName="KeyGestureTextBlock" Property="Visibility" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="IsKeyboardFocused" Value="True">
                            <Setter TargetName="InnerStackPanel" Property="Background" Value="{DynamicResource Brush.Button.Background.Focused}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Hover}"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Pressed}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Opacity" Value="0.7"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <!--Button • No Border • Horizontal • Text • Fade-->
    <Style TargetType="{x:Type n:ExtendedButton}" BasedOn="{StaticResource {x:Type Button}}" x:Key="Style.Button.Horizontal.Fade">
        <Setter Property="Foreground" Value="{DynamicResource Element.Foreground}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="TextWrapping" Value="WrapWithOverflow"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Opacity" Value="0.7"/>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type n:ExtendedButton}">
                    <Border x:Name="MainBorder" MinHeight="{TemplateBinding MinHeight}" Background="{TemplateBinding Background}">
                        <StackPanel x:Name="InnerStackPanel" Orientation="Horizontal" Background="Transparent">
                            <Border Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Background="{TemplateBinding Icon}" Margin="2" Opacity="{DynamicResource Element.Opacity}"
                                    Height="{TemplateBinding ContentHeight}" Width="{TemplateBinding ContentWidth}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
    
                            <Grid Margin="{TemplateBinding Padding}">
                                <Grid.RowDefinitions>
                                    <RowDefinition/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>

                                <TextBlock Grid.Row="0" x:Name="TextBlockInternal" MaxWidth="{Binding Path=ActualWidth, RelativeSource={RelativeSource TemplatedParent}}" 
                                           HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="2,0" Foreground="{TemplateBinding Foreground}"
                                           VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Text="{TemplateBinding Text}" 
                                           TextWrapping="{TemplateBinding TextWrapping}" Effect="{TemplateBinding Effect}"/>

                                <TextBlock Grid.Row="1" x:Name="KeyGestureTextBlock" Text="{TemplateBinding KeyGesture}" Margin="0,-10,2,0" Padding="0" Height="13"
                                           Foreground="{DynamicResource Element.Foreground.Gray112}" FontSize="10" HorizontalAlignment="Right"/>
                            </Grid>
                        </StackPanel>
                    </Border>

                    <ControlTemplate.Triggers>
                        <Trigger Property="KeyGesture" Value="{x:Static s:String.Empty}">
                            <Setter TargetName="KeyGestureTextBlock" Property="Visibility" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="IsKeyboardFocused" Value="True">
                            <Setter Property="Opacity" Value="0.9"/>
                            <Setter TargetName="InnerStackPanel" Property="Background" Value="{DynamicResource Brush.Button.Background.Focused}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Style.Triggers>
            <DataTrigger Binding="{Binding Path=IsMouseOver, RelativeSource={RelativeSource Self}}" Value="True">
                <DataTrigger.EnterActions>
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="Opacity" To="1"/>
                        </Storyboard>
                    </BeginStoryboard>
                </DataTrigger.EnterActions>
                <DataTrigger.ExitActions>
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="Opacity"/>
                        </Storyboard>
                    </BeginStoryboard>
                </DataTrigger.ExitActions>

                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Hover}"/>
            </DataTrigger>

            <Trigger Property="IsPressed" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Pressed}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Opacity" Value="0.7"/>
            </Trigger>
        </Style.Triggers>
    </Style>


    <!--Button • No Border • Vertical • Text-->
    <Style TargetType="{x:Type n:ExtendedButton}" BasedOn="{StaticResource {x:Type Button}}" x:Key="Style.Button.Vertical">
        <Setter Property="Foreground" Value="{DynamicResource Element.Foreground}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="MinWidth" Value="50"/>
        <Setter Property="TextWrapping" Value="Wrap"/>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type n:ExtendedButton}">
                    <Border x:Name="MainBorder" MinHeight="{TemplateBinding MinHeight}" MinWidth="{TemplateBinding MinWidth}" Background="{TemplateBinding Background}">
                        <Grid x:Name="InnerGrid">
                            <Grid.RowDefinitions>
                                <RowDefinition MinHeight="{TemplateBinding ContentHeight}"/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>

                            <Border Grid.Row="0" Background="{TemplateBinding Icon}" Margin="0" Opacity="{DynamicResource Element.Opacity}"
                                    Height="{TemplateBinding ContentHeight}" Width="{TemplateBinding ContentWidth}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                            
                            <TextBlock Grid.Row="1" x:Name="TextBlockInternal" Margin="2,0" HorizontalAlignment="Stretch" VerticalAlignment="Top" 
                                       Text="{TemplateBinding Text, Converter={StaticResource MultiLineTitleConverter}}" TextWrapping="{TemplateBinding TextWrapping}" 
                                       Effect="{TemplateBinding Effect}" TextAlignment="Center"/>

                            <TextBlock Grid.Row="1" x:Name="KeyGestureTextBlock" Text="{TemplateBinding KeyGesture}" Margin="0,10,0,0" Padding="0" Height="13"
                                       Foreground="{DynamicResource Element.Foreground.Gray112}" FontSize="10" HorizontalAlignment="Center"/>
                        </Grid>
                    </Border>

                    <ControlTemplate.Triggers>
                        <Trigger Property="KeyGesture" Value="{x:Static s:String.Empty}">
                            <Setter TargetName="KeyGestureTextBlock" Property="Visibility" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="IsKeyboardFocused" Value="True">
                            <Setter TargetName="InnerGrid" Property="Background" Value="{DynamicResource Brush.Button.Background.Focused}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Hover}"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Pressed}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Opacity" Value="0.7"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <!--Button • No Border • No Text-->
    <Style TargetType="{x:Type n:ExtendedButton}" BasedOn="{StaticResource {x:Type Button}}" x:Key="Style.Button.NoText">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type n:ExtendedButton}">
                    <Border x:Name="MainBorder" MinHeight="{TemplateBinding MinHeight}" Background="{TemplateBinding Background}">
                        <Grid x:Name="InnerGrid">
                            <Border Background="{TemplateBinding Icon}" Margin="{TemplateBinding Padding}" Opacity="{DynamicResource Element.Opacity}"
                                    Height="{TemplateBinding ContentHeight}" Width="{TemplateBinding ContentWidth}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Grid>
                    </Border>
                    
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsKeyboardFocused" Value="True">
                            <Setter TargetName="InnerGrid" Property="Background" Value="{DynamicResource Brush.Button.Background.Focused}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Hover}"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Pressed}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Opacity" Value="0.7"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <!--Button • No Border • No Text • White-->
    <Style TargetType="{x:Type n:ExtendedButton}" BasedOn="{StaticResource {x:Type Button}}" x:Key="Style.Button.NoText.White">
        <Setter Property="Background" Value="#20FFFFFF"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type n:ExtendedButton}">
                    <Border x:Name="MainBorder" MinHeight="{TemplateBinding MinHeight}" Background="{TemplateBinding Background}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                        <Grid x:Name="InnerGrid" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                            <Border Background="{TemplateBinding Icon}" Margin="{TemplateBinding Padding}" Opacity="{DynamicResource Element.Opacity}"
                                    Height="{TemplateBinding ContentHeight}" Width="{TemplateBinding ContentWidth}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Grid>
                    </Border>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsKeyboardFocused" Value="True">
                            <Setter TargetName="InnerGrid" Property="Background" Value="{DynamicResource Brush.Button.Background.Focused}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Hover}"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Pressed}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Opacity" Value="0.7"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <!--Button • Border • No Text-->
    <Style TargetType="{x:Type n:ExtendedButton}" BasedOn="{StaticResource {x:Type Button}}" x:Key="Style.Button.NoText.Border">
        <Setter Property="Background" Value="{DynamicResource Brush.Button.Background}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Border}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type n:ExtendedButton}">
                    <Border x:Name="MainBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" MinHeight="{TemplateBinding MinHeight}" Background="{TemplateBinding Background}">
                        <Border x:Name="InnerBorder" Background="Transparent">
                            <Border Background="{TemplateBinding Icon}" Margin="2,0" Opacity="{DynamicResource Element.Opacity}"
                                    Height="{TemplateBinding ContentHeight}" Width="{TemplateBinding ContentWidth}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Border>
                    </Border>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsKeyboardFocused" Value="True">
                            <Setter TargetName="MainBorder" Property="Margin" Value="-1"/>
                            <Setter TargetName="InnerBorder" Property="Background" Value="{DynamicResource Brush.Button.Background.Focused}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Hover}"/>
                <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Border.Hover}"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Pressed}"/>
                <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Border.Pressed}"/>
            </Trigger>
            <Trigger Property="IsKeyboardFocused" Value="True">
                <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
                <Setter Property="BorderThickness" Value="1.5"/>
                <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Border.Focused}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Opacity" Value="0.7"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <!--Button • No Border • No Text • Fade-->
    <Style TargetType="{x:Type n:ExtendedButton}" BasedOn="{StaticResource {x:Type Button}}" x:Key="Style.Button.NoText.Fade">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Opacity" Value="0.7"/>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type n:ExtendedButton}">
                    <Border x:Name="MainBorder" MinHeight="{TemplateBinding MinHeight}" Background="{TemplateBinding Background}">
                        <Grid x:Name="InnerGrid">
                            <Border Background="{TemplateBinding Icon}" Margin="{TemplateBinding Padding}" Opacity="{DynamicResource Element.Opacity}"
                                    Height="{TemplateBinding ContentHeight}" Width="{TemplateBinding ContentWidth}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Grid>
                    </Border>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsKeyboardFocused" Value="True">
                            <Setter Property="Opacity" Value="0.9"/>
                            <Setter TargetName="InnerGrid" Property="Background" Value="{DynamicResource Brush.Button.Background.Focused}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Style.Triggers>
            <DataTrigger Binding="{Binding Path=IsMouseOver, RelativeSource={RelativeSource Self}}" Value="True">
                <DataTrigger.EnterActions>
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="Opacity" To="1"/>
                        </Storyboard>
                    </BeginStoryboard>
                </DataTrigger.EnterActions>
                <DataTrigger.ExitActions>
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="Opacity"/>
                        </Storyboard>
                    </BeginStoryboard>
                </DataTrigger.ExitActions>

                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Hover}"/>
            </DataTrigger>

            <Trigger Property="IsPressed" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Pressed}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Opacity" Value="0.7"/>
            </Trigger>
        </Style.Triggers>
    </Style>


    <!--ToggleButton • Border • Horizontal • Text-->
    <Style TargetType="{x:Type n:ExtendedToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
        <Setter Property="Background" Value="{DynamicResource Element.Background}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource Element.Border}"/>
        <Setter Property="Foreground" Value="{DynamicResource Element.Foreground}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type n:ExtendedToggleButton}">
                    <Border x:Name="MainBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" MinHeight="{TemplateBinding MinHeight}" Background="{TemplateBinding Background}">
                        <Border x:Name="InnerBorder">
                            <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
                                <Border Background="{TemplateBinding Icon}" Margin="5,3,0,3" Opacity="{DynamicResource Element.Opacity}"
                                        Height="{TemplateBinding ContentHeight}" Width="{TemplateBinding ContentWidth}" VerticalAlignment="Center" HorizontalAlignment="Center"/>

                                <TextBlock x:Name="TextBlockInternal" MaxWidth="{Binding Path=ActualWidth, RelativeSource={RelativeSource TemplatedParent}}" 
                                           HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" 
                                           VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Text="{TemplateBinding Text}" 
                                           TextWrapping="{TemplateBinding TextWrapping}" Effect="{TemplateBinding Effect}" Foreground="{TemplateBinding Foreground}"/>
                            </StackPanel>
                        </Border>
                    </Border>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsKeyboardFocused" Value="True">
                            <Setter TargetName="MainBorder" Property="Margin" Value="-1"/>
                            <Setter TargetName="InnerBorder" Property="Background" Value="{DynamicResource Brush.Button.Background.Focused}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Style.Triggers>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsChecked" Value="True"/>
                    <Condition Property="IsMouseOver" Value="True"/>
                </MultiTrigger.Conditions>

                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Hover}"/>
                <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Border.Hover}"/>
            </MultiTrigger>

            <Trigger Property="IsChecked" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Checked}"/>
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Hover}"/>
                <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Border.Hover}"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Pressed}"/>
                <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Border.Pressed}"/>
            </Trigger>
            <Trigger Property="IsKeyboardFocused" Value="True">
                <Setter Property="BorderThickness" Value="1.5"/>
                <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Border.Focused}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Opacity" Value="0.7"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <!--ToggleButton • No Border • Horizontal • Text-->
    <Style TargetType="{x:Type n:ExtendedToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}" x:Key="Style.ToggleButton.NoBorder">
        <Setter Property="Foreground" Value="{DynamicResource Element.Foreground}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="TextWrapping" Value="WrapWithOverflow"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type n:ExtendedToggleButton}">
                    <Border x:Name="MainBorder" MinHeight="{TemplateBinding MinHeight}" Background="{TemplateBinding Background}">
                        <Border x:Name="InnerBorder">
                            <StackPanel Orientation="Horizontal">
                                <Border Background="{TemplateBinding Icon}" Margin="2" Opacity="{DynamicResource Element.Opacity}"
                                        Height="{TemplateBinding ContentHeight}" Width="{TemplateBinding ContentWidth}" VerticalAlignment="Center" HorizontalAlignment="Center"/>

                                <!--<Viewbox x:Name="ViewBoxInternal" VerticalAlignment="Center" HorizontalAlignment="Center" 
                                         Margin="2" Stretch="Uniform" StretchDirection="Both" Effect="{x:Null}" Height="{TemplateBinding ContentHeight}" Width="{TemplateBinding ContentWidth}" >
                                    <ContentPresenter ContentSource="{TemplateBinding Content}" Width="Auto" Height="Auto" HorizontalAlignment="Center" VerticalAlignment="Center" Opacity="{DynamicResource Element.Opacity}"/>
                                </Viewbox>-->

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

                                    <TextBlock Grid.Row="0" x:Name="TextBlockInternal" MaxWidth="{Binding Path=ActualWidth, RelativeSource={RelativeSource TemplatedParent}}" 
                                               HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="2,0" Padding="{TemplateBinding Padding}"
                                               VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Text="{TemplateBinding Text}" Foreground="{TemplateBinding Foreground}"
                                               TextWrapping="{TemplateBinding TextWrapping}" Effect="{TemplateBinding Effect}"/>

                                    <TextBlock Grid.Row="1" x:Name="KeyGestureTextBlock" Text="{TemplateBinding KeyGesture}" Margin="0,-10,2,0" Padding="0" Height="13"
                                               Foreground="{DynamicResource Element.Foreground.Medium}" FontSize="10" HorizontalAlignment="Right"/>
                                </Grid>
                            </StackPanel>
                        </Border>
                    </Border>

                    <ControlTemplate.Triggers>
                        <Trigger Property="KeyGesture" Value="{x:Static s:String.Empty}">
                            <Setter TargetName="KeyGestureTextBlock" Property="Visibility" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="IsKeyboardFocused" Value="True">
                            <Setter TargetName="InnerBorder" Property="Background" Value="{DynamicResource Brush.Button.Background.Focused}"/>
                        </Trigger>
                        <Trigger Property="IsImportant" Value="True">
                            <Setter TargetName="InnerBorder" Property="BorderBrush" Value="{DynamicResource Brush.StatusBand.Warning}"/>
                            <Setter TargetName="InnerBorder" Property="BorderThickness" Value="0,0,0,3"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Style.Triggers>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsChecked" Value="True"/>
                    <Condition Property="IsMouseOver" Value="True"/>
                </MultiTrigger.Conditions>

                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Hover}"/>
                <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Border.Hover}"/>
            </MultiTrigger>

            <Trigger Property="IsChecked" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Checked}"/>
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Hover}"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Pressed}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Opacity" Value="0.7"/>
            </Trigger>

            <!--When !DarkMode, !IsMouseOver, !IsKeyboardFocused-->
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsOverNonClientArea" Value="True"/>
                    <Condition Property="DarkMode" Value="False"/>
                    <Condition Property="IsMouseOver" Value="False"/>
                    <Condition Property="IsKeyboardFocused" Value="False"/>
                </MultiTrigger.Conditions>

                <Setter Property="Foreground" Value="#FF000000"/>
            </MultiTrigger>

            <!--When DarkMode, !IsMouseOver, !IsKeyboardFocused-->
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsOverNonClientArea" Value="True"/>
                    <Condition Property="DarkMode" Value="True"/>
                    <Condition Property="IsMouseOver" Value="False"/>
                    <Condition Property="IsKeyboardFocused" Value="False"/>
                </MultiTrigger.Conditions>

                <Setter Property="Foreground" Value="WhiteSmoke"/>
            </MultiTrigger>
        </Style.Triggers>
    </Style>

    <!--ToggleButton • No Border • Horizontal • No Text-->
    <Style TargetType="{x:Type n:ExtendedToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}" x:Key="Style.ToggleButton.NoText">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type n:ExtendedToggleButton}">
                    <Border x:Name="MainBorder" MinHeight="{TemplateBinding MinHeight}" Background="{TemplateBinding Background}">
                        <Grid x:Name="InnerGrid">
                            <Border Background="{TemplateBinding Icon}" Margin="{TemplateBinding Padding}" Opacity="{DynamicResource Element.Opacity}"
                                    Height="{TemplateBinding ContentHeight}" Width="{TemplateBinding ContentWidth}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Grid>
                    </Border>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsKeyboardFocused" Value="True">
                            <Setter TargetName="InnerGrid" Property="Background" Value="{DynamicResource Brush.Button.Background.Focused}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Style.Triggers>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsChecked" Value="True"/>
                    <Condition Property="IsMouseOver" Value="True"/>
                </MultiTrigger.Conditions>

                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Hover}"/>
                <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Border.Hover}"/>
            </MultiTrigger>

            <Trigger Property="IsChecked" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Checked}"/>
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Hover}"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Pressed}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Opacity" Value="0.7"/>
            </Trigger>
        </Style.Triggers>
    </Style>


    <!--RepeatButton • No Border • Vertical • Text-->
    <Style TargetType="{x:Type n:ExtendedRepeatButton}" BasedOn="{StaticResource {x:Type RepeatButton}}" x:Key="Style.RepeatButton.Vertical">
        <Setter Property="Foreground" Value="{DynamicResource Element.Foreground}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="MinWidth" Value="50"/>
        <Setter Property="TextWrapping" Value="Wrap"/>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type n:ExtendedRepeatButton}">
                    <Border x:Name="MainBorder" MinHeight="{TemplateBinding MinHeight}" Background="{TemplateBinding Background}">
                        <Grid x:Name="InnerGrid">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="{TemplateBinding ContentHeight}"/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>

                            <Border Grid.Row="0" Background="{TemplateBinding Icon}" Margin="{TemplateBinding Padding}" Opacity="{DynamicResource Element.Opacity}"
                                    Height="{TemplateBinding ContentHeight}" Width="{TemplateBinding ContentWidth}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                            
                            <TextBlock x:Name="TextBlockInternal" Grid.Row="1" Margin="2,0" HorizontalAlignment="Stretch" VerticalAlignment="Top" 
                                       Text="{TemplateBinding Text, Converter={StaticResource MultiLineTitleConverter}}" TextWrapping="{TemplateBinding TextWrapping}" 
                                       Effect="{TemplateBinding Effect}" TextAlignment="Center"/>
                        </Grid>
                    </Border>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsKeyboardFocused" Value="True">
                            <Setter TargetName="InnerGrid" Property="Background" Value="{DynamicResource Brush.Button.Background.Focused}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Hover}"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Pressed}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Opacity" Value="0.7"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <!--RepeatButton • No Border • No Text-->
    <Style TargetType="{x:Type n:ExtendedRepeatButton}" BasedOn="{StaticResource {x:Type RepeatButton}}" x:Key="Style.RepeatButton.NoText">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type n:ExtendedRepeatButton}">
                    <Border x:Name="MainBorder" MinHeight="{TemplateBinding MinHeight}" Background="{TemplateBinding Background}">
                        <Grid x:Name="InnerGrid">
                            <Border Background="{TemplateBinding Icon}" Margin="{TemplateBinding Padding}" Opacity="{DynamicResource Element.Opacity}"
                                    Height="{TemplateBinding ContentHeight}" Width="{TemplateBinding ContentWidth}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Grid>
                    </Border>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsKeyboardFocused" Value="True">
                            <Setter TargetName="InnerGrid" Property="Background" Value="{DynamicResource Brush.Button.Background.Focused}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Hover}"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Button.Background.Pressed}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Opacity" Value="0.7"/>
            </Trigger>
        </Style.Triggers>
    </Style>


    <!--ImageRadioButton • Text-->
    <Style BasedOn="{StaticResource {x:Type RadioButton}}" TargetType="{x:Type n:ExtendedRadioButton}">
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Foreground" Value="{DynamicResource Element.Foreground}"/>
        <Setter Property="Padding" Value="3,1"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="FocusVisualStyle" Value="{DynamicResource Style.FocusVisual.NoMargin}"/>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type n:ExtendedRadioButton}">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" BorderThickness="1" Padding="{TemplateBinding Padding}">
                        <Grid MinHeight="{TemplateBinding MinHeight}" SnapsToDevicePixels="True" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>

                            <Border Grid.Row="0" Grid.Column="0" Background="{TemplateBinding Icon}" Margin="2,0" Opacity="{DynamicResource Element.Opacity}"
                                    Height="{TemplateBinding ContentHeight}" Width="{TemplateBinding ContentWidth}" VerticalAlignment="Center" HorizontalAlignment="Center"/>

                            <TextBlock Grid.Column="1" MaxWidth="{Binding Path=ActualWidth,RelativeSource={RelativeSource TemplatedParent}}" 
                                       HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" 
                                       VerticalAlignment="Center" Text="{TemplateBinding Text, Converter={StaticResource MultiLineTitleConverter}}" 
                                       TextWrapping="{TemplateBinding TextWrapping}"/>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Style.Triggers>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsChecked" Value="True"/>
                    <Condition Property="IsMouseOver" Value="True"/>
                </MultiTrigger.Conditions>
                
                <MultiTrigger.Setters>
                    <Setter Property="BorderBrush" Value="{DynamicResource Element.Border.Pressed}"/>
                    <Setter Property="Background" Value="{DynamicResource Element.Background.Pressed}"/>
                </MultiTrigger.Setters>
            </MultiTrigger>

            <Trigger Property="IsChecked" Value="True">
                <Setter Property="Background" Value="{DynamicResource Element.Background.Checked}"/>
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="{DynamicResource Element.Background.Hover}"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="Background" Value="{DynamicResource Element.Background.Pressed}"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <!--ImageRadioButton • No Text-->
    <Style BasedOn="{StaticResource {x:Type RadioButton}}" TargetType="{x:Type n:ExtendedRadioButton}" x:Key="Style.ImageRadioButton.NoText">
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="FocusVisualStyle" Value="{DynamicResource Style.FocusVisual.NoMargin}"/>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type n:ExtendedRadioButton}">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1">
                        <Grid MinHeight="{TemplateBinding MinHeight}" SnapsToDevicePixels="True" Background="{TemplateBinding Background}">
                            <Border Background="{TemplateBinding Icon}" Margin="2,0" Opacity="{DynamicResource Element.Opacity}"
                                    Height="{TemplateBinding ContentHeight}" Width="{TemplateBinding ContentWidth}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Style.Triggers>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsChecked" Value="True"/>
                    <Condition Property="IsMouseOver" Value="True"/>
                </MultiTrigger.Conditions>
                <MultiTrigger.Setters>
                    <Setter Property="BorderBrush" Value="{DynamicResource Element.Border.Pressed}"/>
                    <Setter Property="Background" Value="{DynamicResource Element.Background.Pressed}"/>
                </MultiTrigger.Setters>
            </MultiTrigger>

            <Trigger Property="IsChecked" Value="True">
                <Setter Property="Background" Value="{DynamicResource Element.Background.Checked}"/>
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="{DynamicResource Element.Background.Hover}"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="Background" Value="{DynamicResource Element.Background.Pressed}"/>
            </Trigger>
        </Style.Triggers>
    </Style>


    <!--SplitButton • Border • Text-->
    <Style TargetType="{x:Type n:SplitButton}">
        <Setter Property="Background" Value="White"/>
        <Setter Property="BorderBrush" Value="#FFABABAB"/>
        <Setter Property="Foreground" Value="#FF444444"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="Padding" Value="4,0,4,0"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type n:SplitButton}">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"
                            HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="1"/>
                                <ColumnDefinition Width="11"/>
                            </Grid.ColumnDefinitions>

                            <n:ExtendedButton Grid.Column="0" x:Name="ActionButton" Icon="{TemplateBinding Icon}" Text="{TemplateBinding Text}" TextWrapping="{TemplateBinding TextWrapping}"
                                              ContentWidth="{TemplateBinding ContentWidth}" ContentHeight="{TemplateBinding ContentHeight}" Style="{StaticResource Style.Button.Horizontal}"
                                              VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              Command="{TemplateBinding Command}" CommandParameter="{TemplateBinding CommandParameter}"/>

                            <Separator Grid.Column="1" x:Name="Separator" BorderBrush="#FFA3BDE3" Width="1" Margin="0" Visibility="Hidden"/>

                            <n:ExtendedToggleButton Grid.Column="2" x:Name="ExpanderButton" Style="{DynamicResource Style.ToggleButton.NoText}" Icon="{DynamicResource Vector.Arrow.Blue.Bottom}" 
                                                    ContentWidth="5" ContentHeight="3"/>

                            <Popup Name="Popup" Placement="Bottom" IsOpen="{Binding ElementName=ExpanderButton, Path=IsChecked, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 
                                   AllowsTransparency="True" StaysOpen="False" PopupAnimation="Fade" HorizontalOffset="-2">
                                <Border Name="SubmenuBorder" SnapsToDevicePixels="True" Background="White" BorderBrush="#FFBEBEBE" BorderThickness="1" Effect="{DynamicResource Shadow.Border.Small}" Margin="2">
                                    <StackPanel x:Name="InnerStackPanel" IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle"/>
                                </Border>
                            </Popup>
                        </Grid>
                    </Border>

                    <ControlTemplate.Triggers>
                        <Trigger SourceName="ActionButton" Property="IsMouseOver" Value="True">
                            <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Border.Hover}"/>
                            <Setter Property="Visibility" TargetName="Separator" Value="Visible"/>
                        </Trigger>

                        <Trigger SourceName="ExpanderButton" Property="IsMouseOver" Value="True">
                            <!--<Setter TargetName="ExpanderButton" Property="Background" Value="{DynamicResource Brush.Button.Background.Hover}"/>-->
                            <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Border.Hover}"/>
                            <Setter Property="Visibility" TargetName="Separator" Value="Visible"/>
                        </Trigger>

                        <Trigger SourceName="ActionButton" Property="IsPressed" Value="True">
                            <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Border.Pressed}"/>
                        </Trigger>

                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Background" Value="#FFE6E6E6"/>
                            <Setter Property="BorderBrush" Value="#FFBCBCBC"/>
                            <Setter Property="Opacity" Value="0.7"/>
                        </Trigger>

                        <DataTrigger Binding="{Binding IsMouseOver, ElementName=ExpanderButton}" Value="True">
                            <Setter Property="StaysOpen" TargetName="Popup" Value="True"/>
                            <Setter Property="Focusable" TargetName="Popup" Value="False"/>
                        </DataTrigger>

                        <Trigger SourceName="ExpanderButton" Property="IsMouseOver" Value="False">
                            <Setter Property="StaysOpen" TargetName="Popup" Value="False"/>
                            <Setter Property="Focusable" TargetName="Popup" Value="False"/>
                        </Trigger>

                        <Trigger SourceName="Popup" Property="IsOpen" Value="True">
                            <Setter TargetName="ExpanderButton" Property="IsHitTestVisible" Value="False"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <!--SplitButton • No Border-->
    <Style TargetType="{x:Type n:SplitButton}" x:Key="Style.SplitButton.NoBorder">
        <Setter Property="Foreground" Value="{DynamicResource Element.Foreground}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Border}"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="Padding" Value="4,0"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="IsTabStop" Value="False"/>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type n:SplitButton}">
                    <Grid Background="{TemplateBinding Background}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"
                          HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}"
                          FocusManager.FocusedElement="{Binding RelativeSource={x:Static RelativeSource.Self}, Mode=OneTime}" KeyboardNavigation.TabNavigation="Continue">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="1"/>
                            <ColumnDefinition Width="20"/>
                        </Grid.ColumnDefinitions>

                        <n:ExtendedButton Grid.Column="0" x:Name="ActionButton" Icon="{TemplateBinding Icon}" Text="{TemplateBinding Text}" TextWrapping="{TemplateBinding TextWrapping}"
                                          ContentWidth="{TemplateBinding ContentWidth}" ContentHeight="{TemplateBinding ContentHeight}" Style="{StaticResource Style.Button.Horizontal}"
                                          VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          Command="{TemplateBinding Command}" CommandParameter="{TemplateBinding CommandParameter}"/>
                        
                        <Separator Grid.Column="1" x:Name="Separator" BorderBrush="{TemplateBinding BorderBrush}" Width="1" Margin="0" Visibility="Hidden"/>
                        
                        <n:ExtendedToggleButton Grid.Column="2" x:Name="ExpanderButton" Style="{DynamicResource Style.ToggleButton.NoText}" Icon="{DynamicResource Vector.Arrow.Blue.Bottom}" 
                                                ContentWidth="8" ContentHeight="8"/>

                        <Popup x:Name="Popup" Placement="Bottom" IsOpen="{Binding ElementName=ExpanderButton, Path=IsChecked, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, FallbackValue=False}" 
                               AllowsTransparency="True" StaysOpen="False" PopupAnimation="Fade" HorizontalOffset="-2">
                            <Border Name="SubmenuBorder" SnapsToDevicePixels="True" Background="{DynamicResource Element.Background}" BorderBrush="{DynamicResource Element.Border}" 
                                    BorderThickness="1" Effect="{DynamicResource Shadow.Border.Small}" Margin="2">
                                <StackPanel x:Name="InnerStackPanel" IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle"/>
                            </Border>
                        </Popup>
                    </Grid>

                    <ControlTemplate.Triggers>
                        <Trigger SourceName="ActionButton" Property="IsMouseOver" Value="True">
                            <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Border.Hover}"/>
                            <Setter Property="Visibility" TargetName="Separator" Value="Visible"/>
                        </Trigger>

                        <Trigger SourceName="ExpanderButton" Property="IsMouseOver" Value="True">
                            <!--<Setter TargetName="ExpanderButton" Property="Background" Value="{DynamicResource Brush.Button.Background.Hover}"/>-->
                            <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Border.Hover}"/>
                            <Setter Property="Visibility" TargetName="Separator" Value="Visible"/>
                        </Trigger>

                        <Trigger SourceName="ActionButton" Property="IsPressed" Value="True">
                            <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Border.Pressed}"/>
                        </Trigger>

                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Opacity" Value="0.7"/>
                        </Trigger>

                        <DataTrigger Binding="{Binding IsMouseOver, ElementName=ExpanderButton}" Value="True">
                            <Setter Property="StaysOpen" TargetName="Popup" Value="True"/>
                            <Setter Property="Focusable" TargetName="Popup" Value="False"/>
                        </DataTrigger>

                        <Trigger SourceName="ExpanderButton" Property="IsMouseOver" Value="False">
                            <Setter Property="StaysOpen" TargetName="Popup" Value="False"/>
                            <Setter Property="Focusable" TargetName="Popup" Value="False"/>
                        </Trigger>

                        <Trigger SourceName="Popup" Property="IsOpen" Value="True">
                            <Setter TargetName="ExpanderButton" Property="IsHitTestVisible" Value="False"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--SplitButton • No Border • No Text-->
    <Style TargetType="{x:Type n:SplitButton}" x:Key="Style.SplitButton.NoBorder.NoText">
        <Setter Property="Foreground" Value="{DynamicResource Element.Foreground}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Border}"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="Padding" Value="4,0"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="IsTabStop" Value="False"/>
        
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type n:SplitButton}">
                    <Grid Background="{TemplateBinding Background}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"
                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" MinWidth="25"/>
                            <ColumnDefinition Width="1"/>
                            <ColumnDefinition Width="14"/>
                        </Grid.ColumnDefinitions>

                        <n:ExtendedButton Grid.Column="0" x:Name="ActionButton" Icon="{TemplateBinding Icon}" TextWrapping="{TemplateBinding TextWrapping}"
                                          ContentWidth="{TemplateBinding ContentWidth}" ContentHeight="{TemplateBinding ContentHeight}" Style="{StaticResource Style.Button.NoText}"
                                          VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          Command="{TemplateBinding Command}" CommandParameter="{TemplateBinding CommandParameter}"/>
                        
                        <Separator Grid.Column="1" x:Name="Separator" BorderBrush="{TemplateBinding BorderBrush}" Width="1" Margin="0" Visibility="Hidden"/>

                        <n:ExtendedToggleButton Grid.Column="2" x:Name="ExpanderButton" Style="{DynamicResource Style.ToggleButton.NoText}" Icon="{DynamicResource Vector.Arrow.Blue.Bottom}" 
                                                ContentWidth="6" ContentHeight="5"/>

                        <Popup x:Name="Popup" Placement="Bottom" IsOpen="{Binding ElementName=ExpanderButton, Path=IsChecked, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 
                               AllowsTransparency="True" StaysOpen="False" PopupAnimation="Fade" HorizontalOffset="-2">
                            <Border Name="SubmenuBorder" SnapsToDevicePixels="True" Background="{DynamicResource Element.Background}" BorderBrush="{DynamicResource Element.Border}" 
                                    BorderThickness="1" Effect="{DynamicResource Shadow.Border.Small}" Margin="2">
                                <StackPanel x:Name="InnerStackPanel" IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle"/>
                            </Border>
                        </Popup>
                    </Grid>

                    <ControlTemplate.Triggers>
                        <Trigger SourceName="ActionButton" Property="IsMouseOver" Value="True">
                            <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Border.Hover}"/>
                            <Setter Property="Visibility" TargetName="Separator" Value="Visible"/>
                        </Trigger>

                        <Trigger SourceName="ExpanderButton" Property="IsMouseOver" Value="True">
                            <!--<Setter TargetName="ExpanderButton" Property="Background" Value="{DynamicResource Brush.Button.Background.Hover}"/>-->
                            <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Border.Hover}"/>
                            <Setter Property="Visibility" TargetName="Separator" Value="Visible"/>
                        </Trigger>

                        <Trigger SourceName="ActionButton" Property="IsPressed" Value="True">
                            <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Border.Pressed}"/>
                        </Trigger>

                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Opacity" Value="0.7"/>
                        </Trigger>

                        <DataTrigger Binding="{Binding IsMouseOver, ElementName=ExpanderButton}" Value="True">
                            <Setter Property="StaysOpen" TargetName="Popup" Value="True"/>
                            <Setter Property="Focusable" TargetName="Popup" Value="False"/>
                        </DataTrigger>

                        <Trigger SourceName="ExpanderButton" Property="IsMouseOver" Value="False">
                            <Setter Property="StaysOpen" TargetName="Popup" Value="False"/>
                            <Setter Property="Focusable" TargetName="Popup" Value="False"/>
                        </Trigger>

                        <Trigger SourceName="Popup" Property="IsOpen" Value="True">
                            <Setter TargetName="ExpanderButton" Property="IsHitTestVisible" Value="False"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <!--SplitButton • Border • No Text-->
    <Style TargetType="{x:Type n:SplitButton}" x:Key="Style.SplitButton.NoText">
        <Setter Property="Foreground" Value="{DynamicResource Element.Foreground}"/>
        <Setter Property="Background" Value="{DynamicResource Brush.Button.Background}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Border}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Padding" Value="4,0"/>
        <Setter Property="IsTabStop" Value="False"/>
        
        <!--Default Values-->
        <Setter Property="FocusVisualStyle">
            <Setter.Value>
                <Style>
                    <Setter Property="Control.Template">
                        <Setter.Value>
                            <ControlTemplate>
                                <Rectangle Margin="1" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" 
                                           StrokeThickness="1" StrokeDashArray="1 2"/>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Setter.Value>
        </Setter>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type n:SplitButton}">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                            Height="{TemplateBinding Height}" Width="{TemplateBinding Width}">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" MinWidth="20"/>
                                <ColumnDefinition Width="1"/>
                                <ColumnDefinition Width="11"/>
                            </Grid.ColumnDefinitions>

                            <n:ExtendedButton Grid.Column="0" x:Name="ActionButton" Icon="{TemplateBinding Icon}" Text="{TemplateBinding Text}" TextWrapping="{TemplateBinding TextWrapping}"
                                              ContentWidth="{TemplateBinding ContentWidth}" ContentHeight="{TemplateBinding ContentHeight}" Style="{StaticResource Style.Button.NoText}"
                                              VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              Command="{TemplateBinding Command}" CommandParameter="{TemplateBinding CommandParameter}"/>

                            <Separator Grid.Column="1" x:Name="Separator" BorderBrush="#FFA3BDE3" Width="1" Margin="0" Visibility="Hidden"/>

                            <n:ExtendedToggleButton Grid.Column="2" x:Name="ExpanderButton" Style="{DynamicResource Style.ToggleButton.NoText}" Icon="{DynamicResource Vector.Arrow.Blue.Bottom}" 
                                                    ContentWidth="5" ContentHeight="3"/>

                            <Popup Name="Popup" Placement="Bottom" IsOpen="{Binding ElementName=ExpanderButton, Path=IsChecked, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 
                                   AllowsTransparency="True" StaysOpen="False" PopupAnimation="Fade" HorizontalOffset="-2">
                                <Border Name="SubmenuBorder" SnapsToDevicePixels="True" Background="White" BorderBrush="#FFBEBEBE" BorderThickness="1" Effect="{DynamicResource Shadow.Border.Small}" Margin="2">
                                    <StackPanel x:Name="InnerStackPanel" IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle"/>
                                </Border>
                            </Popup>
                        </Grid>
                    </Border>

                    <ControlTemplate.Triggers>
                        <Trigger SourceName="ActionButton" Property="IsMouseOver" Value="True">
                            <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Border.Hover}"/>
                            <Setter Property="Visibility" TargetName="Separator" Value="Visible"/>
                        </Trigger>

                        <Trigger SourceName="ExpanderButton" Property="IsMouseOver" Value="True">
                            <!--<Setter TargetName="ExpanderButton" Property="Background" Value="{DynamicResource Brush.Button.Background.Hover}"/>-->
                            <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Border.Hover}"/>
                            <Setter Property="Visibility" TargetName="Separator" Value="Visible"/>
                        </Trigger>

                        <Trigger SourceName="ActionButton" Property="IsPressed" Value="True">
                            <Setter Property="BorderBrush" Value="{DynamicResource Brush.Button.Border.Pressed}"/>
                        </Trigger>

                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Background" Value="#FFE6E6E6"/>
                            <Setter Property="BorderBrush" Value="#FFBCBCBC"/>
                            <Setter Property="Opacity" Value="0.7"/>
                        </Trigger>

                        <DataTrigger Binding="{Binding IsMouseOver, ElementName=ExpanderButton}" Value="True">
                            <Setter Property="StaysOpen" TargetName="Popup" Value="True"/>
                            <Setter Property="Focusable" TargetName="Popup" Value="False"/>
                        </DataTrigger>

                        <Trigger SourceName="ExpanderButton" Property="IsMouseOver" Value="False">
                            <Setter Property="StaysOpen" TargetName="Popup" Value="False"/>
                            <Setter Property="Focusable" TargetName="Popup" Value="False"/>
                        </Trigger>

                        <Trigger SourceName="Popup" Property="IsOpen" Value="True">
                            <Setter TargetName="ExpanderButton" Property="IsHitTestVisible" Value="False"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>