Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mr5z committed Oct 31, 2020
2 parents dbb4f3d + b334dca commit f0d95d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions PropertyValidator/Services/ValidationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ private List<IValidationRule> GetRules()

private void NotifiableModel_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
var targetProperties = GetRules().Select(it => it.PropertyName);
if (!targetProperties.Contains(e.PropertyName))
var containsTarget = GetRules().Any(it => it.PropertyName == e.PropertyName);
if (!containsTarget)
return;

Validate(e.PropertyName);
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public class AddressRule : MultiValidationRule<Address>


2. Use the validation rules in our classes that implements (implicitly from the base class) `INotifyPropertyChanged`.
The example below is used in Xamarin Forms along with the Prism to register the service in the Dependency Injection, but it can be used also in other platforms supported by the .NET family.
The example below is used in Xamarin Forms along with [Prism](https://github.com/PrismLibrary/Prism) to register the service in the [DI](https://stackoverflow.com/q/130794/2304737) container, but it can also be used in other platforms supported by the .NET family.

``` c#
public class ItemsPageViewModel : BaseViewModel, IInitialize
Expand Down

0 comments on commit f0d95d4

Please sign in to comment.