From 212854edda1715c71956362b8f63ebc8b08688b5 Mon Sep 17 00:00:00 2001 From: Adrien Allard Date: Tue, 2 Jul 2019 19:05:45 +0200 Subject: [PATCH] Highlight in red in the treeview elements that contains errors. --- Application/FileConverter/ViewModels/PresetNode.cs | 4 ++++ .../FileConverter/Views/Resources/CustomStyles.xaml | 2 ++ Application/FileConverter/Views/SettingsWindow.xaml | 8 +++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Application/FileConverter/ViewModels/PresetNode.cs b/Application/FileConverter/ViewModels/PresetNode.cs index 20bfac4..a3d25e5 100644 --- a/Application/FileConverter/ViewModels/PresetNode.cs +++ b/Application/FileConverter/ViewModels/PresetNode.cs @@ -41,6 +41,8 @@ namespace FileConverter.ViewModels public string this[string columnName] => this.Validate(columnName); + public bool HasError => !string.IsNullOrEmpty(this.Error); + public string Error { get @@ -135,6 +137,7 @@ namespace FileConverter.ViewModels { this.Preset.ShortName = value; this.RaisePropertyChanged(); + this.RaisePropertyChanged(nameof(this.HasError)); } } @@ -257,6 +260,7 @@ namespace FileConverter.ViewModels { this.name = value; this.RaisePropertyChanged(); + this.RaisePropertyChanged(nameof(this.HasError)); } } diff --git a/Application/FileConverter/Views/Resources/CustomStyles.xaml b/Application/FileConverter/Views/Resources/CustomStyles.xaml index e96f6fc..9790ca1 100644 --- a/Application/FileConverter/Views/Resources/CustomStyles.xaml +++ b/Application/FileConverter/Views/Resources/CustomStyles.xaml @@ -81,6 +81,8 @@ + +