|
|
|
@ -5,31 +5,47 @@ |
|
|
|
xmlns:coreConverters="clr-namespace:Microsoft.Windows.Controls.Core.Converters"> |
|
|
|
|
|
|
|
<coreConverters:InverseBoolConverter x:Key="InverseBoolConverter" /> |
|
|
|
|
|
|
|
|
|
|
|
<DataTemplate x:Key="DefaultWatermarkTemplate"> |
|
|
|
<ContentControl Content="{Binding}" Foreground="Gray" Focusable="False" /> |
|
|
|
</DataTemplate> |
|
|
|
|
|
|
|
<LinearGradientBrush x:Key="TextBoxBorder" EndPoint="0,20" MappingMode="Absolute" StartPoint="0,0"> |
|
|
|
<GradientStop Color="#ABADB3" Offset="0.05"/> |
|
|
|
<GradientStop Color="#E2E3EA" Offset="0.07"/> |
|
|
|
<GradientStop Color="#E3E9EF" Offset="1"/> |
|
|
|
</LinearGradientBrush> |
|
|
|
|
|
|
|
<!-- =============================================================================== --> |
|
|
|
<!-- MaskedTextBox --> |
|
|
|
<!-- =============================================================================== --> |
|
|
|
|
|
|
|
<Style TargetType="{x:Type local:MaskedTextBox}"> |
|
|
|
<Setter Property="Background" Value="White"/> |
|
|
|
<Setter Property="BorderBrush" Value="{StaticResource TextBoxBorder}" /> |
|
|
|
<Setter Property="BorderThickness" Value="1" /> |
|
|
|
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/> |
|
|
|
<Setter Property="Focusable" Value="False" /> |
|
|
|
<Setter Property="Template"> |
|
|
|
<Setter.Value> |
|
|
|
<ControlTemplate TargetType="{x:Type local:MaskedTextBox}"> |
|
|
|
<TextBox x:Name="TextBox" |
|
|
|
Background="{TemplateBinding Background}" |
|
|
|
BorderBrush="{TemplateBinding BorderBrush}" |
|
|
|
BorderThickness="{TemplateBinding BorderThickness}" |
|
|
|
FontFamily="{TemplateBinding FontFamily}" |
|
|
|
FontSize="{TemplateBinding FontSize}" |
|
|
|
FontStretch="{TemplateBinding FontStretch}" |
|
|
|
FontStyle="{TemplateBinding FontStyle}" |
|
|
|
FontWeight="{TemplateBinding FontWeight}" |
|
|
|
Foreground="{TemplateBinding Foreground}" |
|
|
|
IsReadOnly="{Binding IsEditable, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource InverseBoolConverter}}" |
|
|
|
MinWidth="20" AcceptsReturn="False" TextWrapping="NoWrap" |
|
|
|
TabIndex="{TemplateBinding TabIndex}" |
|
|
|
Text="{Binding Text, RelativeSource={RelativeSource TemplatedParent}}" /> |
|
|
|
<local:WatermarkTextBox x:Name="TextBox" |
|
|
|
Background="{TemplateBinding Background}" |
|
|
|
BorderBrush="{TemplateBinding BorderBrush}" |
|
|
|
BorderThickness="{TemplateBinding BorderThickness}" |
|
|
|
FontFamily="{TemplateBinding FontFamily}" |
|
|
|
FontSize="{TemplateBinding FontSize}" |
|
|
|
FontStretch="{TemplateBinding FontStretch}" |
|
|
|
FontStyle="{TemplateBinding FontStyle}" |
|
|
|
FontWeight="{TemplateBinding FontWeight}" |
|
|
|
Foreground="{TemplateBinding Foreground}" |
|
|
|
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|
|
|
IsReadOnly="{Binding IsEditable, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource InverseBoolConverter}}" |
|
|
|
MinWidth="20" AcceptsReturn="False" TextWrapping="NoWrap" |
|
|
|
TabIndex="{TemplateBinding TabIndex}" |
|
|
|
Text="{Binding Text, RelativeSource={RelativeSource TemplatedParent}}" |
|
|
|
Watermark="{TemplateBinding Watermark}" |
|
|
|
WatermarkTemplate="{TemplateBinding WatermarkTemplate}"/> |
|
|
|
</ControlTemplate> |
|
|
|
</Setter.Value> |
|
|
|
</Setter> |
|
|
|
|