Skip to content

Commit d216f07

Browse files
Update code (minor changes)
1 parent b21c9b6 commit d216f07

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

CS/MainWindow.xaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
<DataTrigger Binding="{Binding Path=Content.ErrorContent, RelativeSource={RelativeSource Self}, Converter={StaticResource ErrorContentToErrorTypeConverter}}" Value="Critical">
1111
<Setter Property="ContentTemplate" Value="{DynamicResource {dxet:ErrorTypesThemeKeyExtension ResourceKey=Critical}}" />
1212
</DataTrigger>
13+
<DataTrigger Binding="{Binding Path=Content.ErrorContent, RelativeSource={RelativeSource Self}, Converter={StaticResource ErrorContentToErrorTypeConverter}}" Value="Warning">
14+
<Setter Property="ContentTemplate" Value="{DynamicResource {dxet:ErrorTypesThemeKeyExtension ResourceKey=Warning}}" />
15+
</DataTrigger>
1316
<DataTrigger Binding="{Binding Path=Content.ErrorContent, RelativeSource={RelativeSource Self}, Converter={StaticResource ErrorContentToErrorTypeConverter}}" Value="Information">
1417
<Setter Property="ContentTemplate" Value="{DynamicResource {dxet:ErrorTypesThemeKeyExtension ResourceKey=Information}}" />
1518
</DataTrigger>

CS/MainWindow.xaml.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,17 @@ void RaisePropertyChanged(string property) {
5151
string IDataErrorInfo.Error {
5252
get { return GetError(); }
5353
}
54+
5455
string GetError() {
5556
if (string.IsNullOrEmpty(TestString))
56-
return "ErrorType=Critical;ErrorContent=empty";
57+
return "ErrorType=Critical;ErrorContent=The value is not provided. Please enter a value";
5758
if (TestString.Length < 3)
58-
return "ErrorType=Critical;ErrorContent=error";
59+
return "ErrorType=Warning;ErrorContent=The value is less than 3 characters. Please enter at least 5 characters";
5960
if (TestString.Length < 5)
60-
return "ErrorType=Information;ErrorContent=warning";
61+
return "ErrorType=Information;ErrorContent=The value is less than 5 characters. Please enter at least 5 characters";
6162
return string.Empty;
6263
}
64+
6365
string IDataErrorInfo.this[string columnName] {
6466
get {
6567
if (columnName == "TestString")

0 commit comments

Comments
 (0)