Skip to content

Commit 2defb77

Browse files
committed
Add ValidationErrorTemplate into ComboBox
Fix issue #284
1 parent 6cebaab commit 2defb77

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

MainDemo.Wpf/Domain/NotifyPropertyChangedExtension.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace MaterialDesignColors.WpfExample.Domain
88
public static class NotifyPropertyChangedExtension
99
{
1010
public static void MutateVerbose<TField>(this INotifyPropertyChanged instance, ref TField field, TField newValue, Action<PropertyChangedEventArgs> raise, [CallerMemberName] string propertyName = null)
11-
{
11+
{
1212
if (EqualityComparer<TField>.Default.Equals(field, newValue)) return;
1313
field = newValue;
1414
raise?.Invoke(new PropertyChangedEventArgs(propertyName));

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.ComboBox.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
<ResourceDictionary.MergedDictionaries>
88
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Shadows.xaml" />
9+
<ResourceDictionary Source="MaterialDesignTheme.ValidationErrorTemplate.xaml" />
910
</ResourceDictionary.MergedDictionaries>
1011

1112
<converters:TextFieldHintVisibilityConverter x:Key="TextFieldHintVisibilityConverter" IsNotEmptyValue="Collapsed" />
@@ -694,6 +695,7 @@
694695
<Setter Property="ScrollViewer.CanContentScroll" Value="true" />
695696
<Setter Property="ScrollViewer.PanningMode" Value="Both" />
696697
<Setter Property="Stylus.IsFlicksEnabled" Value="False" />
698+
<Setter Property="Validation.ErrorTemplate" Value="{StaticResource MaterialDesignValidationErrorTemplate}"/>
697699
<Setter Property="Template" Value="{StaticResource MaterialDesignComboBoxTemplate}" />
698700
<Style.Triggers>
699701
<Trigger Property="IsMouseOver" Value="true">

0 commit comments

Comments
 (0)