Skip to content

Conversation

@Sergio0694
Copy link
Member

Closes #555

This PR updates the [ObservableProperty] generator to support partial properties as well.
It includes the following changes:

  • Update the target of all attribute types to support properties too
  • Update generator to handle partial properties
  • Update all diagnostic messages to also mention partial properties
  • Add a new analyzer to error if C# is not set to preview
  • Add a new analyzer to error if using a version of Roslyn that's too old
  • Add a new analyzer to error if a partial property declaration is invalid
  • Add a new analyzer to suggest converting to a partial property when possible
  • Add a new code fixer to automatically update all fields to partial properties
  • Add unit tests for all new features

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

This was referenced Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

analyzer 👓 A new analyzer being implemented or updated feature 💡 A new feature being implemented mvvm-toolkit 🧰 Issues/PRs for the MVVM Toolkit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for [ObservableProperty] on partial properties

3 participants