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

Add [AlsoValidateProperty] attribute #267

Merged
merged 5 commits into from
May 31, 2022

Conversation

Sergio0694
Copy link
Member

@Sergio0694 Sergio0694 commented May 24, 2022

Closes #229

This PR adds the [AlsoValidateProperty] attribute and changes the property validator to not do validation by default.

API breakdown

namespace CommunityToolkit.Mvvm.ComponentModel;

[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
public sealed class AlsoValidatePropertyAttribute : Attribute
{
}

This PR also special cases other attributes in System.ComponentModel.DataAnnotations to enable forwarding.

PR Checklist

  • Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
  • Based off latest main branch of toolkit
  • PR doesn't include merge commits (always rebase on top of our main, if needed)
  • Tested code with current supported SDKs
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Header has been added to all new source files (run build/UpdateHeaders.bat)
  • Contains NO breaking changes
  • Every new API (including internal ones) has full XML docs
  • Code follows all style conventions

@Sergio0694 Sergio0694 added feature 💡 A new feature being implemented improvements ✨ Improvements to an existing functionality next preview ✈️ This changes will be available in the upcoming preview priority 🚩 An issue or change that has priority mvvm-toolkit 🧰 Issues/PRs for the MVVM Toolkit labels May 24, 2022
@Sergio0694
Copy link
Member Author

@Arlodotexe Feel free to review this since it adds new functionality on its own.
I'll do a separate PR to then refactor all attributes with the new behavior and names we discussed yesterday 🙂

@Sergio0694 Sergio0694 force-pushed the dev/validation-attribute-improvements branch from ee504ea to 0b15992 Compare May 31, 2022 10:32
@Sergio0694 Sergio0694 merged commit cbafd72 into main May 31, 2022
@delete-merged-branch delete-merged-branch bot deleted the dev/validation-attribute-improvements branch May 31, 2022 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 💡 A new feature being implemented improvements ✨ Improvements to an existing functionality mvvm-toolkit 🧰 Issues/PRs for the MVVM Toolkit next preview ✈️ This changes will be available in the upcoming preview priority 🚩 An issue or change that has priority
Projects
None yet
3 participants