TextStyle.xaml 4.69 KB
Newer Older
潘栩锋's avatar
潘栩锋 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
                    xmlns:osk="clr-namespace:FLY.ControlLibrary.UI.OSK;assembly=FLY.ControlLibrary"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
                    mc:Ignorable="d"
                    >
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/BaseStyle.xaml"/>
    </ResourceDictionary.MergedDictionaries>


    <!-- 输入框 带虚拟键盘 -->
    <Style TargetType="TextBox" x:Key="TextBoxStyle1">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBox}">
                    <Border Name="PART_Border" BorderBrush="{TemplateBinding Foreground}" Background="{TemplateBinding Background}">
                        <ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                        <i:Interaction.Behaviors>
                            <osk:KeyboardBehavior/>
                        </i:Interaction.Behaviors>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="false">
27
                            <Setter Property="Foreground" Value="{StaticResource {x:Static SystemColors.GrayTextBrushKey}}"/>
潘栩锋's avatar
潘栩锋 committed
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
                        </Trigger>
                        <Trigger Property="IsFocused" Value="true">
                            <Setter TargetName="PART_Border" Property="BorderThickness" Value="1"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- 可写项 的标题 -->
    <Style TargetType="TextBlock" x:Key="TextBlockStyle_FieldHeaderEditable">
        <Setter Property="Margin"  Value="3" />
        <Setter Property="Foreground"  Value="#FF0083D7" />
        <Setter Property="FontWeight"  Value="Bold" />
        <Setter Property="FontSize"  Value="22" />
        <Setter Property="FontFamily"  Value="YouYuan" />
        <Setter Property="TextAlignment"  Value="Left" />
    </Style>

    <!-- 只读项 的标题 -->
    <Style TargetType="TextBlock" x:Key="TextBlockStyle_FieldHeader">
        <Setter Property="Margin"  Value="3" />
        <Setter Property="Foreground"  Value="#FF3B3B3B" />
        <Setter Property="FontWeight"  Value="Bold" />
        <Setter Property="FontSize"  Value="22" />
        <Setter Property="FontFamily"  Value="YouYuan" />
        <Setter Property="TextAlignment"  Value="Left" />
    </Style>

    <!-- 只读项 内容 -->
    <Style TargetType="TextBlock" x:Key="TextBlockStyle_FieldContent">
        <Setter Property="Margin"  Value="3" />
        <Setter Property="Foreground"  Value="#FF3B3B3B" />
        <Setter Property="FontWeight"  Value="Bold" />
        <Setter Property="FontSize"  Value="36" />
64
        <Setter Property="FontFamily"  Value="Arial" />
潘栩锋's avatar
潘栩锋 committed
65 66 67 68 69 70 71 72 73
        <Setter Property="TextAlignment"  Value="Left" />
    </Style>

    <!-- 输入框 内容 -->
    <Style TargetType="TextBox" x:Key="TextBoxStyle_FieldContent" BasedOn="{StaticResource ResourceKey=TextBoxStyle1}">
        <Setter Property="Margin"  Value="3" />
        <Setter Property="Foreground"  Value="#FF3B3B3B" />
        <Setter Property="FontWeight"  Value="Bold" />
        <Setter Property="FontSize"  Value="36" />
74
        <Setter Property="FontFamily"  Value="Arial" />
潘栩锋's avatar
潘栩锋 committed
75 76 77 78 79 80 81 82
        <Setter Property="TextAlignment"  Value="Left" />
        <Setter Property="MinWidth"  Value="30" />
    </Style>

    <!-- 内容的分割线 -->
    <Style TargetType="TextBlock" x:Key="TextBlockStyle_FieldContent_mm_interval">
        <Setter Property="Foreground"  Value="#FF888888" />
        <Setter Property="FontSize"  Value="36" />
83
        <Setter Property="FontFamily"  Value="Arial" />
潘栩锋's avatar
潘栩锋 committed
84 85 86 87 88 89 90 91
        <Setter Property="TextAlignment"  Value="Left" />
        <Setter Property="VerticalAlignment"  Value="Bottom" />
    </Style>

    <!-- 内容的单位 -->
    <Style TargetType="TextBlock" x:Key="TextBlockStyle_FieldContent_mm">
        <Setter Property="Foreground"  Value="#FF888888" />
        <Setter Property="FontSize"  Value="22" />
92
        <Setter Property="FontFamily"  Value="Arial" />
潘栩锋's avatar
潘栩锋 committed
93 94 95 96 97 98 99
        <Setter Property="TextAlignment"  Value="Left" />
        <Setter Property="VerticalAlignment"  Value="Bottom" />
    </Style>



</ResourceDictionary>