1 changed files with 99 additions and 99 deletions
@ -1,103 +1,103 @@ |
|||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
xmlns:sys="using:System" |
xmlns:sys="using:System" |
||||
x:CompileBindings="True" |
x:CompileBindings="True" |
||||
x:DataType="DataValidationErrors"> |
x:DataType="DataValidationErrors"> |
||||
<Design.PreviewWith> |
<Design.PreviewWith> |
||||
<Border Padding="20"> |
<Border Padding="20"> |
||||
<StackPanel Spacing="20"> |
<StackPanel Spacing="20"> |
||||
<TextBox Text="Sample"> |
<TextBox Text="Sample"> |
||||
<DataValidationErrors.Error> |
<DataValidationErrors.Error> |
||||
<sys:Exception /> |
<sys:Exception /> |
||||
</DataValidationErrors.Error> |
</DataValidationErrors.Error> |
||||
</TextBox> |
</TextBox> |
||||
<TextBox Text="Sample"> |
<TextBox Text="Sample"> |
||||
<TextBox.Styles> |
<TextBox.Styles> |
||||
<Style Selector="DataValidationErrors"> |
<Style Selector="DataValidationErrors"> |
||||
<Setter Property="Template" Value="{DynamicResource TooltipDataValidationContentTemplate}" /> |
<Setter Property="Template" Value="{DynamicResource TooltipDataValidationContentTemplate}" /> |
||||
<Setter Property="ErrorTemplate" Value="{DynamicResource TooltipDataValidationErrorTemplate}" /> |
<Setter Property="ErrorTemplate" Value="{DynamicResource TooltipDataValidationErrorTemplate}" /> |
||||
</Style> |
</Style> |
||||
</TextBox.Styles> |
</TextBox.Styles> |
||||
<DataValidationErrors.Error> |
<DataValidationErrors.Error> |
||||
<sys:Exception /> |
<sys:Exception /> |
||||
</DataValidationErrors.Error> |
</DataValidationErrors.Error> |
||||
</TextBox> |
</TextBox> |
||||
</StackPanel> |
</StackPanel> |
||||
</Border> |
</Border> |
||||
</Design.PreviewWith> |
</Design.PreviewWith> |
||||
|
|
||||
<ControlTheme x:Key="{x:Type DataValidationErrors}" TargetType="DataValidationErrors"> |
<ControlTheme x:Key="{x:Type DataValidationErrors}" TargetType="DataValidationErrors"> |
||||
<ControlTheme.Resources> |
<ControlTheme.Resources> |
||||
<DataTemplate x:Key="InlineDataValidationErrorTemplate"> |
<DataTemplate x:Key="InlineDataValidationErrorTemplate"> |
||||
<ItemsControl Items="{Binding}" x:DataType="DataValidationErrors" Foreground="{DynamicResource SystemControlErrorTextForegroundBrush}"> |
<ItemsControl Items="{Binding}" x:DataType="DataValidationErrors" Foreground="{DynamicResource SystemControlErrorTextForegroundBrush}"> |
||||
<ItemsControl.Styles> |
<ItemsControl.Styles> |
||||
<Style Selector="TextBlock"> |
<Style Selector="TextBlock"> |
||||
<Setter Property="TextWrapping" Value="Wrap" /> |
<Setter Property="TextWrapping" Value="Wrap" /> |
||||
</Style> |
</Style> |
||||
</ItemsControl.Styles> |
</ItemsControl.Styles> |
||||
</ItemsControl> |
</ItemsControl> |
||||
</DataTemplate> |
</DataTemplate> |
||||
<ControlTemplate x:Key="InlineDataValidationContentTemplate" TargetType="DataValidationErrors"> |
<ControlTemplate x:Key="InlineDataValidationContentTemplate" TargetType="DataValidationErrors"> |
||||
<DockPanel LastChildFill="True"> |
<DockPanel LastChildFill="True"> |
||||
<ContentControl x:Name="InlineDataValidationContentControl" |
<ContentControl x:Name="InlineDataValidationContentControl" |
||||
Margin="0,4,0,0" |
Margin="0,4,0,0" |
||||
Content="{Binding (DataValidationErrors.Errors)}" |
Content="{Binding (DataValidationErrors.Errors)}" |
||||
ContentTemplate="{TemplateBinding ErrorTemplate}" |
ContentTemplate="{TemplateBinding ErrorTemplate}" |
||||
DataContext="{TemplateBinding Owner}" |
DataContext="{TemplateBinding Owner}" |
||||
DockPanel.Dock="Bottom" |
DockPanel.Dock="Bottom" |
||||
IsVisible="{Binding (DataValidationErrors.HasErrors)}" /> |
IsVisible="{Binding (DataValidationErrors.HasErrors)}" /> |
||||
<ContentPresenter Name="PART_ContentPresenter" |
<ContentPresenter Name="PART_ContentPresenter" |
||||
Padding="{TemplateBinding Padding}" |
Padding="{TemplateBinding Padding}" |
||||
Background="{TemplateBinding Background}" |
Background="{TemplateBinding Background}" |
||||
BorderThickness="{TemplateBinding BorderThickness}" |
BorderThickness="{TemplateBinding BorderThickness}" |
||||
CornerRadius="{TemplateBinding CornerRadius}" |
CornerRadius="{TemplateBinding CornerRadius}" |
||||
Content="{TemplateBinding Content}" |
Content="{TemplateBinding Content}" |
||||
ContentTemplate="{TemplateBinding ContentTemplate}" /> |
ContentTemplate="{TemplateBinding ContentTemplate}" /> |
||||
</DockPanel> |
</DockPanel> |
||||
</ControlTemplate> |
</ControlTemplate> |
||||
|
|
||||
<DataTemplate x:DataType="DataValidationErrors" x:Key="TooltipDataValidationErrorTemplate"> |
<DataTemplate x:DataType="DataValidationErrors" x:Key="TooltipDataValidationErrorTemplate"> |
||||
<Panel Name="PART_InlineErrorTemplatePanel" Background="Transparent"> |
<Panel Name="PART_InlineErrorTemplatePanel" Background="Transparent"> |
||||
<Panel.Styles> |
<Panel.Styles> |
||||
<Style Selector="Panel#PART_InlineErrorTemplatePanel"> |
<Style Selector="Panel#PART_InlineErrorTemplatePanel"> |
||||
<Setter Property="Margin" Value="8,0" /> |
<Setter Property="Margin" Value="8,0" /> |
||||
</Style> |
</Style> |
||||
<Style Selector="Panel#PART_InlineErrorTemplatePanel ToolTip"> |
<Style Selector="Panel#PART_InlineErrorTemplatePanel ToolTip"> |
||||
<Setter Property="BorderBrush" Value="{DynamicResource SystemControlErrorTextForegroundBrush}" /> |
<Setter Property="BorderBrush" Value="{DynamicResource SystemControlErrorTextForegroundBrush}" /> |
||||
</Style> |
</Style> |
||||
<Style Selector="Panel#PART_InlineErrorTemplatePanel ToolTip TextBlock"> |
<Style Selector="Panel#PART_InlineErrorTemplatePanel ToolTip TextBlock"> |
||||
<Setter Property="TextWrapping" Value="Wrap" /> |
<Setter Property="TextWrapping" Value="Wrap" /> |
||||
</Style> |
</Style> |
||||
</Panel.Styles> |
</Panel.Styles> |
||||
<ToolTip.Tip> |
<ToolTip.Tip> |
||||
<ItemsControl Items="{Binding}" /> |
<ItemsControl Items="{Binding}" /> |
||||
</ToolTip.Tip> |
</ToolTip.Tip> |
||||
<Path Width="14" |
<Path Width="14" |
||||
Height="14" |
Height="14" |
||||
Data="M14,7 A7,7 0 0,0 0,7 M0,7 A7,7 0 1,0 14,7 M7,3l0,5 M7,9l0,2" |
Data="M14,7 A7,7 0 0,0 0,7 M0,7 A7,7 0 1,0 14,7 M7,3l0,5 M7,9l0,2" |
||||
Stroke="{DynamicResource SystemControlErrorTextForegroundBrush}" |
Stroke="{DynamicResource SystemControlErrorTextForegroundBrush}" |
||||
StrokeThickness="2" /> |
StrokeThickness="2" /> |
||||
</Panel> |
</Panel> |
||||
</DataTemplate> |
</DataTemplate> |
||||
<ControlTemplate x:Key="TooltipDataValidationContentTemplate" TargetType="DataValidationErrors"> |
<ControlTemplate x:Key="TooltipDataValidationContentTemplate" TargetType="DataValidationErrors"> |
||||
<DockPanel LastChildFill="True"> |
<DockPanel LastChildFill="True"> |
||||
<ContentControl Content="{Binding (DataValidationErrors.Errors)}" |
<ContentControl Content="{Binding (DataValidationErrors.Errors)}" |
||||
ContentTemplate="{TemplateBinding ErrorTemplate}" |
ContentTemplate="{TemplateBinding ErrorTemplate}" |
||||
DataContext="{TemplateBinding Owner}" |
DataContext="{TemplateBinding Owner}" |
||||
DockPanel.Dock="Right" |
DockPanel.Dock="Right" |
||||
IsVisible="{Binding (DataValidationErrors.HasErrors)}" /> |
IsVisible="{Binding (DataValidationErrors.HasErrors)}" /> |
||||
<ContentPresenter Name="PART_ContentPresenter" |
<ContentPresenter Name="PART_ContentPresenter" |
||||
Padding="{TemplateBinding Padding}" |
Padding="{TemplateBinding Padding}" |
||||
Background="{TemplateBinding Background}" |
Background="{TemplateBinding Background}" |
||||
BorderBrush="{TemplateBinding BorderBrush}" |
BorderBrush="{TemplateBinding BorderBrush}" |
||||
BorderThickness="{TemplateBinding BorderThickness}" |
BorderThickness="{TemplateBinding BorderThickness}" |
||||
CornerRadius="{TemplateBinding CornerRadius}" |
CornerRadius="{TemplateBinding CornerRadius}" |
||||
Content="{TemplateBinding Content}" |
Content="{TemplateBinding Content}" |
||||
ContentTemplate="{TemplateBinding ContentTemplate}" /> |
ContentTemplate="{TemplateBinding ContentTemplate}" /> |
||||
</DockPanel> |
</DockPanel> |
||||
</ControlTemplate> |
</ControlTemplate> |
||||
</ControlTheme.Resources> |
</ControlTheme.Resources> |
||||
<Setter Property="Template" Value="{StaticResource InlineDataValidationContentTemplate}" /> |
<Setter Property="Template" Value="{StaticResource InlineDataValidationContentTemplate}" /> |
||||
<Setter Property="ErrorTemplate" Value="{StaticResource InlineDataValidationErrorTemplate}" /> |
<Setter Property="ErrorTemplate" Value="{StaticResource InlineDataValidationErrorTemplate}" /> |
||||
</ControlTheme> |
</ControlTheme> |
||||
</ResourceDictionary> |
</ResourceDictionary> |
||||
|
|||||
Loading…
Reference in new issue