<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:Platform.Controls.NumericContainer" 
                    xmlns:helper="clr-namespace:Platform.Controls.ControlsHelper"
                    xmlns:dhcc="http://www.dhcc.com.cn">
    <SolidColorBrush x:Key="WindowBackgroundBrush" Color="#FFF" />
    <SolidColorBrush x:Key="SolidBorderBrush" Color="#888" />
    <SolidColorBrush x:Key="DisabledBackgroundBrush" Color="#EEE" />
    <SolidColorBrush x:Key="DisabledForegroundBrush" Color="#888" />

    <Style TargetType="{x:Type local:ProportionalEditor}">        
        <Setter Property="dhcc:FocusManager.IsInternalKeyboardControlling" Value="True" />
        <Setter Property="dhcc:FocusManager.FocusHandled" Value="{x:Static helper:CurrencyRateEditorHelper.CurrencyRateEditorFocusHandled}" />
        <Setter Property="dhcc:FocusManagerExt.IsFocusAdorner" Value="True" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="Width" Value="120" />
        <Setter Property="Height" Value="23" />
        <Setter Property="CurrencySymbolType" Value="UserSetting" />
        <Setter Property="CurrencySymbol" Value="%"></Setter>
        <Setter Property="AllowDrop" Value="true" />
        <Setter Property="HorizontalContentAlignment" Value="Right"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="dhcc:FocusManagerExt.AssertNotEmpty" Value="False" />
        <Setter Property="dhcc:FocusManagerExt.ValidationField" Value="Val" />
        <Setter Property="dhcc:FocusManagerExt.FieldEmptyPolicies">
            <Setter.Value>
                <dhcc:FieldPolicyCollection>
                    <dhcc:ShowTipPolicy />                   
                </dhcc:FieldPolicyCollection>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:ProportionalEditor}">
                    <Grid>
                    <Border Name="Border"
                            Background="{StaticResource WindowBackgroundBrush}"
                            BorderBrush="{StaticResource SolidBorderBrush}"
                            BorderThickness="1"
                            CornerRadius="2"
                            Padding="2">
                    </Border>
                    <Grid>
                                <!--<Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>-->
                            <StackPanel Orientation="Horizontal" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                                <Border>
                                    <ScrollViewer
                                              x:Name="PART_ContentHost"
                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                              Cursor="IBeam"
                                              Margin="0" />
                                </Border>
                                <TextBlock
                                           Margin="0,0,4,0"
                                           HorizontalAlignment="{Binding ElementName=PART_ContentHost,Path=HorizontalAlignment}"
                                           VerticalAlignment="{Binding ElementName=PART_ContentHost,Path=VerticalAlignment}"
                                           Visibility="{TemplateBinding CurrencySymbolVisible}"
                                           Text="{Binding RelativeSource={RelativeSource TemplatedParent},Path=CurrencySymbol}" FontWeight="Bold"/>
                            </StackPanel>
                        </Grid>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBackgroundBrush}" />
                            <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}" />
                        </Trigger>
                        <Trigger Property="dhcc:FocusManagerExt.AssertNotEmpty" Value="True">
                            <Setter TargetName="Border" Property="Background" Value="{DynamicResource TextBox_AssertNotEmpty_Background}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
