This repository has been archived on 2024-01-02. You can view files and clone it, but cannot push or open issues or pull requests.
Sic06/FrameworkLocal/UICore/Style/CadetBlue/TextBoxStyle.xaml

115 lines
5.2 KiB
XML

<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:aero="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero">
<!-- 通用文本样式 -->
<Style TargetType="TextBox">
<Setter Property="Margin" Value="0,10" />
<Setter Property="Height" Value="35" />
<!--<Setter Property="Width" Value="190"></Setter>-->
<Setter Property="FontSize" Value="18" />
<Setter Property="Background" Value="#FFDCF7F6" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="Green" />
<Setter Property="BorderBrush" Value="Green" />
<Setter Property="BorderThickness" Value="2" />
</Trigger>
<Trigger Property="Validation.HasError" Value="true">
<Setter Property="ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=(Validation.Errors)[0].ErrorContent}" />
</Trigger>
</Style.Triggers>
</Style>
<Style
x:Key="SmallTextBox"
BasedOn="{StaticResource {x:Type TextBox}}"
TargetType="TextBox">
<Setter Property="Height" Value="25" />
<Setter Property="FontSize" Value="12" />
</Style>
<!-- 登录界面文本框样式 -->
<Style x:Key="LoginTextBox" TargetType="TextBox">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TextBoxBase">
<aero:ListBoxChrome
Name="Bd"
Background="{TemplateBinding Control.Background}"
BorderBrush="{TemplateBinding Control.BorderBrush}"
BorderThickness="{TemplateBinding Control.BorderThickness}"
RenderFocused="{TemplateBinding UIElement.IsKeyboardFocusWithin}"
RenderMouseOver="{TemplateBinding UIElement.IsMouseOver}"
SnapsToDevicePixels="True">
<ScrollViewer Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
</aero:ListBoxChrome>
<ControlTemplate.Triggers>
<Trigger Property="UIElement.IsEnabled" Value="False">
<Setter TargetName="Bd" Property="aero:ListBoxChrome.Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" />
<Setter Property="Control.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Height" Value="40" />
<Setter Property="Width" Value="190" />
<Setter Property="FontSize" Value="20" />
<Setter Property="Padding" Value="1,5,0,0" />
<!--<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="pack://application:,,,/MECF.Framework.UI.Core;component/Resources/Login/输入框.png">
</ImageBrush>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsFocused" Value="True">
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="pack://application:,,,/MECF.Framework.UI.Core;component/Resources/Login/输入框_选择.png">
</ImageBrush>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>-->
</Style>
<!-- Notch文本框样式 -->
<Style x:Key="NotchTextBox" TargetType="{x:Type TextBox}">
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="Width" Value="50" />
<Setter Property="Height" Value="50" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<Grid x:Name="grid">
<Rectangle
x:Name="rectangle1"
Fill="{TemplateBinding Background}"
RadiusX="25"
RadiusY="25"
Stroke="Black"
StrokeThickness="1" />
<ScrollViewer
x:Name="PART_ContentHost"
Padding="{TemplateBinding Padding}"
Focusable="false"
HorizontalScrollBarVisibility="Hidden"
VerticalScrollBarVisibility="Hidden" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- 反应腔盖 -->
<Style x:Key="ReactorMiniTextBox" TargetType="TextBox">
<Setter Property="Width" Value="30" />
<Setter Property="Cursor" Value="Hand" />
</Style>
</ResourceDictionary>