<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:bpa="clr-namespace:BPA.UIControl">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/BPA.UIControl;component/Themes/TextBox.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <Style x:Key="RubyerRenamer" TargetType="{x:Type bpa:Renamer}">
        <Setter Property="Background" Value="{DynamicResource ControlBackground}" />
        <Setter Property="BorderBrush" Value="{DynamicResource Border}" />
        <Setter Property="Foreground" Value="{DynamicResource DefaultForeground}" />
        <Setter Property="BorderThickness" Value="{DynamicResource DefaultBorderThickness}" />
        <Setter Property="Height" Value="28" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
        <Setter Property="Content" Value="{Binding Text, Mode=OneWay, RelativeSource={RelativeSource Self}}" />
        <Setter Property="bpa:ControlHelper.CornerRadius" Value="{DynamicResource AllControlCornerRadius}" />
        <Setter Property="bpa:ControlHelper.FocusBorderBrush" Value="{DynamicResource Primary}" />
        <Setter Property="bpa:ControlHelper.MouseOverBrush" Value="{DynamicResource Primary}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type bpa:Renamer}">
                    <Grid>
                        <TextBox x:Name="PART_TextBox"
                                 Style="{StaticResource RubyerTextBox}"
                                 Height="Auto"
                                 HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                 VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                 bpa:ControlHelper.CornerRadius="{Binding Path=(bpa:ControlHelper.CornerRadius), RelativeSource={RelativeSource Mode=TemplatedParent}}"
                                 bpa:ControlHelper.FocusBorderBrush="{Binding Path=(bpa:ControlHelper.FocusBorderBrush), RelativeSource={RelativeSource Mode=TemplatedParent}}"
                                 bpa:ControlHelper.MouseOverBrush="{Binding Path=(bpa:ControlHelper.MouseOverBrush), RelativeSource={RelativeSource Mode=TemplatedParent}}"
                                 bpa:InputBoxHelper.IsClearable="{Binding Path=(bpa:InputBoxHelper.IsClearable), RelativeSource={RelativeSource Mode=TemplatedParent}}"
                                 bpa:InputBoxHelper.PostContent="{Binding Path=(bpa:InputBoxHelper.PostContent), RelativeSource={RelativeSource Mode=TemplatedParent}}"
                                 bpa:InputBoxHelper.PreContent="{Binding Path=(bpa:InputBoxHelper.PreContent), RelativeSource={RelativeSource Mode=TemplatedParent}}"
                                 bpa:InputBoxHelper.Watermark="{Binding Path=(bpa:InputBoxHelper.Watermark), RelativeSource={RelativeSource Mode=TemplatedParent}}"
                                 BorderBrush="{TemplateBinding BorderBrush}"
                                 BorderThickness="{TemplateBinding BorderThickness}"
                                 Focusable="{TemplateBinding Focusable}"
                                 Foreground="{TemplateBinding Foreground}"
                                 Text="{Binding Text, RelativeSource={RelativeSource Mode=TemplatedParent}}"
                                 Visibility="Collapsed" />

                        <ContentPresenter x:Name="contentPresenter"
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                          Focusable="False"
                                          RecognizesAccessKey="True"
                                          SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                          Visibility="{TemplateBinding IsRenaming, Converter={StaticResource BooleanToHiddenConverter}}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>