mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-05-01 21:41:27 +08:00
feat: add hacks for internal textbox error display.
This commit is contained in:
@@ -38,4 +38,18 @@
|
|||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</Setter>
|
</Setter>
|
||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
|
<ControlTheme x:Key="SilentDataValidationErrors" TargetType="DataValidationErrors">
|
||||||
|
<Setter Property="Template">
|
||||||
|
<ControlTemplate TargetType="DataValidationErrors">
|
||||||
|
<ContentPresenter
|
||||||
|
Name="PART_ContentPresenter"
|
||||||
|
Padding="{TemplateBinding Padding}"
|
||||||
|
Background="{TemplateBinding Background}"
|
||||||
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
|
Content="{TemplateBinding Content}"
|
||||||
|
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||||
|
CornerRadius="{TemplateBinding CornerRadius}" />
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter>
|
||||||
|
</ControlTheme>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
|
|||||||
@@ -28,11 +28,13 @@
|
|||||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||||
AcceptsReturn="False"
|
AcceptsReturn="False"
|
||||||
CornerRadius="{TemplateBinding CornerRadius}"
|
CornerRadius="{TemplateBinding CornerRadius}"
|
||||||
|
DataValidationErrors.Errors="{ReflectionBinding $parent[NumericUpDown].(DataValidationErrors.Errors)}"
|
||||||
FontSize="{TemplateBinding FontSize}"
|
FontSize="{TemplateBinding FontSize}"
|
||||||
Foreground="{TemplateBinding Foreground}"
|
Foreground="{TemplateBinding Foreground}"
|
||||||
IsReadOnly="{TemplateBinding IsReadOnly}"
|
IsReadOnly="{TemplateBinding IsReadOnly}"
|
||||||
Text="{TemplateBinding Text}"
|
Text="{TemplateBinding Text}"
|
||||||
TextWrapping="NoWrap"
|
TextWrapping="NoWrap"
|
||||||
|
Theme="{DynamicResource NonErrorTextBox}"
|
||||||
Watermark="{TemplateBinding Watermark}" />
|
Watermark="{TemplateBinding Watermark}" />
|
||||||
</ButtonSpinner>
|
</ButtonSpinner>
|
||||||
</DataValidationErrors>
|
</DataValidationErrors>
|
||||||
|
|||||||
@@ -274,4 +274,13 @@
|
|||||||
</Style>
|
</Style>
|
||||||
</Style>
|
</Style>
|
||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
|
|
||||||
|
<ControlTheme
|
||||||
|
x:Key="NonErrorTextBox"
|
||||||
|
BasedOn="{StaticResource {x:Type TextBox}}"
|
||||||
|
TargetType="TextBox">
|
||||||
|
<Style Selector="^ /template/ DataValidationErrors">
|
||||||
|
<Setter Property="Theme" Value="{DynamicResource SilentDataValidationErrors}" />
|
||||||
|
</Style>
|
||||||
|
</ControlTheme>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
|
|||||||
Reference in New Issue
Block a user