Skip to content
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

feature: Custom Formatters in ReactiveValidationObject #154

Merged
merged 3 commits into from
Oct 24, 2020

Conversation

worldbeater
Copy link
Collaborator

What kind of change does this PR introduce?

Currently, our INotifyDataErrorInfo implementation doesn't support custom formatters. The support for custom validation text formatters might be useful in cases when one needs to implement localization in their application via passing resource keys to ValidationRule calls instead of validation messages.

What is the current behavior?

Currently, there is no way to customize messages emitted by INotifyDataErrorInfo.

What is the new behavior?

Now, in order to customize the messages emitted by INotifyDataErrorInfo, one needs to either pass an instance of a custom IValidationTextFormatter<string> to ReactiveValidationObject constructor, or to register a default IValidationTextFormatter<string> globally via Locator.Current.RegisterConstant, as documented in #153

What might this PR break?

Nothing, this change shouldn't be breaking.

@codecov
Copy link

codecov bot commented Oct 24, 2020

Codecov Report

Merging #154 into main will increase coverage by 0.20%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #154      +/-   ##
==========================================
+ Coverage   62.14%   62.34%   +0.20%     
==========================================
  Files          16       16              
  Lines         906      911       +5     
==========================================
+ Hits          563      568       +5     
  Misses        343      343              
Impacted Files Coverage Δ
Helpers/ReactiveValidationObject.cs 97.67% <0.00%> (+0.30%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d0c5c8f...ebcb68b. Read the comment docs.

@worldbeater worldbeater marked this pull request as ready for review October 24, 2020 10:53
@worldbeater worldbeater merged commit 4b6ad22 into main Oct 24, 2020
@worldbeater worldbeater deleted the rxval-valtext-formatter branch October 24, 2020 11:38
@reactiveui reactiveui locked as resolved and limited conversation to collaborators Nov 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant