pglazkov / MvvmValidation

Lightweight library that helps reduce boilerplate when implementing validation in XAML MVVM applications
MIT License
167 stars 31 forks source link

FluentValidation Rules #32

Open Tecorey opened 1 year ago

Tecorey commented 1 year ago

Thank you for your open-source library, which has helped me solve many issues in my project. I use FluentValidation extensively in my work, especially its rules that may be used in multiple places. Can we utilize FluentValidation's rules with this library?

pglazkov commented 1 year ago

Thank you for your feedback, glad you found this library to be useful. Regarding your question, I don't think this is possible at the moment, at least this is not a scenario I tested or encountered before. It seems like these two libraries serve almost the same purpose and not meant to be used together. Or maybe I'm not understanding your use case. Maybe you could elaborate a bit, how would you like to use the two libraries together?

Tecorey commented 1 year ago

Like this https://github.com/GrantByrne/DeadSimpleWpfFluentValidation.git Or https://github.com/dotnet9/FluentValidationForWPF.git They implement similar functions to yours, but they are not easy to use.

pglazkov commented 1 year ago

It looks like what you are looking for an implementation of INotifyDataErrorInfo, similar to NotifyDataErrorInfoAdapter.cs, but for FluentValidation. You can try to implement it yourself based on the code from the repos that you mentioned or raise an issue in FluentValidation repo, maybe they can add it.