TextBoxStyle.xaml

30 lines | 1.509 kB Blame History Raw Download
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Style TargetType="{x:Type TextBox}">
        <Setter Property="Padding" Value="1"/>
        <Setter Property="AllowDrop" Value="true"/>
        <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
        <Setter Property="TextAlignment" Value="Center"/>
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="FontSize" Value="16" />
        <Setter Property="FontFamily" Value="Helvetica" />
        <Setter Property="Margin" Value="2" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBox}">
                    <Grid>
                        <Border BorderThickness="1">
                            <Border.Background>
                                <SolidColorBrush Color="#F9F9F9" x:Name="BgBrush" />
                            </Border.Background>
                            <Border.BorderBrush>
                                <SolidColorBrush Color="LightGray" x:Name="BordBrush" />
                            </Border.BorderBrush>
                            <ScrollViewer Margin="3" x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>