TextStyle2.xaml 6.45 KB
Newer Older
1 2 3 4 5 6
<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" 
7
                    xmlns:sys="clr-namespace:System;assembly=mscorlib"
8
                    mc:Ignorable="d"
9
                    
10 11 12 13
                    >
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/BaseStyle.xaml"/>
    </ResourceDictionary.MergedDictionaries>
14
    <!--<sys:Double x:Key="FontSize.FieldHeader">18</sys:Double>
15 16 17
    <sys:Double x:Key="FontSize.FieldHeader.Small">12</sys:Double>
    <sys:Double x:Key="FontSize.FieldContent">30</sys:Double>
    <sys:Double x:Key="FontSize.FieldContent.Small">18</sys:Double>
18 19 20 21 22 23 24
    <sys:Double x:Key="FontSize.FieldContent.Middle">24</sys:Double>-->

    <sys:Double x:Key="FontSize.FieldHeader">18</sys:Double>
    <sys:Double x:Key="FontSize.FieldHeader.Small">12</sys:Double>
    <sys:Double x:Key="FontSize.FieldContent">24</sys:Double>
    <sys:Double x:Key="FontSize.FieldContent.Small">14</sys:Double>
    <sys:Double x:Key="FontSize.FieldContent.Middle">18</sys:Double>
25
    <Thickness x:Key="Margin.Text">3</Thickness>
26

27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
    <!-- 输入框 带虚拟键盘 -->
    <Style TargetType="TextBox" x:Key="Styles.Text.Input">
        <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">
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                        </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="Styles.Text.FieldHeader">
52
        <Setter Property="Margin"  Value="{StaticResource Margin.Text}" />
53 54
        <Setter Property="Foreground"  Value="#FF3B3B3B" />
        <Setter Property="FontWeight"  Value="Bold" />
55
        <Setter Property="FontSize"  Value="{StaticResource FontSize.FieldHeader}" />
56
        <Setter Property="FontFamily"  Value="{StaticResource FontFamily.Field}" />
57 58
        <Setter Property="TextAlignment"  Value="Left" />
    </Style>
59

60 61
    <!-- 只读项 的标题 2行 -->
    <Style TargetType="TextBlock" x:Key="Styles.Text.FieldHeader.Row2" BasedOn="{StaticResource Styles.Text.FieldHeader}">
62
        <Setter Property="FontSize"  Value="{StaticResource FontSize.FieldHeader.Small}" />
63
    </Style>
64

65 66 67 68
    <!-- 可写项 的标题 -->
    <Style TargetType="TextBlock" x:Key="Styles.Text.FieldHeader.Editable" BasedOn="{StaticResource Styles.Text.FieldHeader}">
        <Setter Property="Foreground"  Value="#FF0083D7" />
    </Style>
69 70 71 72
    <Style TargetType="TextBlock" x:Key="Styles.Text.FieldHeader.Comment" BasedOn="{StaticResource Styles.Text.FieldHeader}">
        <Setter Property="Foreground"  Value="#FF888888" />
        <Setter Property="FontSize"  Value="13" />
    </Style>
73

74 75
    <!-- 可写项 的标题 2行 -->
    <Style TargetType="TextBlock" x:Key="Styles.Text.FieldHeader.Editable.Row2" BasedOn="{StaticResource Styles.Text.FieldHeader.Editable}">
76
        <Setter Property="FontSize"  Value="{StaticResource FontSize.FieldHeader.Small}" />
77 78 79 80
    </Style>

    <!-- 只读项 内容 -->
    <Style TargetType="TextBlock" x:Key="Styles.Text.FieldContent">
81
        <Setter Property="Margin"  Value="{StaticResource Margin.Text}" />
82
        <Setter Property="Foreground"  Value="#FF3B3B3B" />
83
        <!--<Setter Property="FontWeight"  Value="Bold" />-->
84
        <Setter Property="FontSize"  Value="{StaticResource FontSize.FieldContent}" />
85
        <Setter Property="FontFamily"  Value="{StaticResource FontFamily.Field}" />
86 87 88 89 90
        <Setter Property="TextAlignment"  Value="Left" />
    </Style>

    <!-- 输入框 内容 -->
    <Style TargetType="TextBox" x:Key="Styles.Text.FieldContent.Input" BasedOn="{StaticResource Styles.Text.Input}">
91
        <Setter Property="Margin"  Value="{StaticResource Margin.Text}" />
92
        <Setter Property="Foreground"  Value="#FF3B3B3B" />
93
        <!--<Setter Property="FontWeight"  Value="Bold" />-->
94
        <Setter Property="FontSize"  Value="{StaticResource FontSize.FieldContent}" />
95
        <Setter Property="FontFamily"  Value="{StaticResource FontFamily.Field}" />
96 97 98 99 100 101 102 103 104 105
        <Setter Property="TextAlignment"  Value="Left" />
        <Setter Property="MinWidth"  Value="30" />
    </Style>




    <!-- 内容的分割线 -->
    <Style TargetType="TextBlock" x:Key="Styles.Text.FieldContent.Separator">
        <Setter Property="Foreground"  Value="#FF888888" />
106
        <Setter Property="FontSize"  Value="{StaticResource FontSize.FieldContent}" />
107 108 109
        <Setter Property="FontFamily"  Value="Arial" />
        <Setter Property="TextAlignment"  Value="Left" />
        <Setter Property="VerticalAlignment"  Value="Bottom" />
110
        <Setter Property="Text"  Value="|" />
111 112 113 114 115
    </Style>

    <!-- 内容的单位 -->
    <Style TargetType="TextBlock" x:Key="Styles.Text.FieldContent.Unit">
        <Setter Property="Foreground"  Value="#FF888888" />
116
        <Setter Property="FontSize"  Value="{StaticResource FontSize.FieldContent.Small}" />
117
        <Setter Property="FontFamily"  Value="{StaticResource FontFamily.Field}" />
118 119 120 121 122 123 124
        <Setter Property="TextAlignment"  Value="Left" />
        <Setter Property="VerticalAlignment"  Value="Bottom" />
    </Style>



</ResourceDictionary>