Closed disklosr closed 8 years ago
There is an overload of the Validate
method that takes object
as the argument. You can use that. This code should compile:
validator.Validate(propertyName);
Great, exactly what I need. I also noticed the NotifyDataErrorInfoAdapter type isn't included in the nuget package. When are you planning to update it?
It is included in the portable version of the library, but for some reason NuGet downloads the .NET 4.0 version that doesn't include it (because .NET 4.0 doesn't have the INotifyDataErrorInfo interface). I will look into that.
In the meanwhile you could download the binaries of the library from CodePlex and reference the portable library manually without using NuGet. I will try to update NuGet packages ASAP.
Sorry for the inconvenience and thanks for your feedback!
I'll wait for you to update the nuget package as I don't like referencing binaries directly.
Let me know when you update it. Thanks a lot for your quick support.
Fixed the NuGet package for .NET 4.5. You can try it by installing a pre-release version from NuGet: https://www.nuget.org/packages/MvvmValidation/2.1.0-beta
I'm interested in using this library as an implementation for INotifyDataErrorInfo interface. And I want to run validation each time I set a propoerty. Problem is that the Validate() method in this library expects an expression as an input, while I need an overload of it that accepts a string instead. This prevents me from using it inside my generic setter:
Do you have any workaround for this or another approach of executing validation during set? Thanks.