Browse Source
Set property value before using any Interfaces
pull/4053/head
usUyGBx
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
3 deletions
-
samples/ControlCatalog/Models/Person.cs
|
|
|
@ -21,12 +21,12 @@ namespace ControlCatalog.Models |
|
|
|
get => _firstName; |
|
|
|
set |
|
|
|
{ |
|
|
|
_firstName = value; |
|
|
|
if (string.IsNullOrWhiteSpace(value)) |
|
|
|
SetError(nameof(FirstName), "First Name Required"); |
|
|
|
else |
|
|
|
SetError(nameof(FirstName), null); |
|
|
|
|
|
|
|
_firstName = value; |
|
|
|
OnPropertyChanged(nameof(FirstName)); |
|
|
|
} |
|
|
|
|
|
|
|
@ -37,12 +37,12 @@ namespace ControlCatalog.Models |
|
|
|
get => _lastName; |
|
|
|
set |
|
|
|
{ |
|
|
|
_lastName = value; |
|
|
|
if (string.IsNullOrWhiteSpace(value)) |
|
|
|
SetError(nameof(LastName), "Last Name Required"); |
|
|
|
else |
|
|
|
SetError(nameof(LastName), null); |
|
|
|
|
|
|
|
_lastName = value; |
|
|
|
OnPropertyChanged(nameof(LastName)); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -95,4 +95,4 @@ namespace ControlCatalog.Models |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|