New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] readme says to use ValidationRule on ReactiveValidationObject but it doesn't exist #433
Comments
ReactiveUI.Validation/src/ReactiveUI.Validation/Extensions/ValidatableViewModelExtensions.cs Line 35 in 9146f19
|
It exists as a extension method so make sure you include the correct namespaces |
Oh, thanks. I think it would be helpful if the example in the readme example included the using statement. This would go a long way to helping with the on boarding experience for new users. I would also suggest rethinking using extension methods like this as it will trip up a lot of new users. |
Good idea in regards to the readme. Extension methods are used pretty extensively throughout the entire ReactiveUI suite. Visual Studio 2022 has become a lot better at picking up when you should use an extension method these days. Reason for the extension method it allows you to provide your own object types to validate against since not everyone will want to use the |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Describe the bug
The readme says has tells you that for INotifyDataErrorInfo you can inherit ReactiveValidationObject and call this.ValidationRule to add validation rules.
However ReactiveValidationObject doesn't have a ValidationRule method and so the example does not compile:
It can be seen from https://github.com/reactiveui/ReactiveUI.Validation/blob/main/src/ReactiveUI.Validation/Helpers/ReactiveValidationObject.cs which doesn't have a method called ValidationRule
Steps To Reproduce
Us the sample from the readme
-> notice it doesn't compile because it uses a method that doesn't exist.
Expected behavior
I should be able to follow the readme and have a working validation example
Environment
The text was updated successfully, but these errors were encountered: