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 abilities to control the access level of generated [ObservableProperty] attribute #585

Closed
laolarou726 opened this issue Jan 25, 2023 · 1 comment
Labels
duplicate 👥 Indicates that an identical issue or PR already exists feature request 📬 A request for new changes to improve functionality mvvm-toolkit 🧰 Issues/PRs for the MVVM Toolkit

Comments

@laolarou726
Copy link

Overview

Currently CommunityToolkit can only generate ObservableProperties with both public getter and setter. Sometimes we need the property be private or the setter be private. Maybe we can have multiple attributes like [Readonly] to change the behavior of the generation.

API breakdown

[ObservableProperty]
[Readonly]
private int _counter; // generate property with {get;}

[ObservableProperty]
[PrivateSet]
private string _text; // generate property with {get; private set;}

Usage example

Same as previous one

Breaking change?

No

Alternatives

Maybe trying to use any attributes that C# already have?

Additional context

No response

Help us help you

Yes, I'd like to be assigned to work on this item

@laolarou726 laolarou726 added the feature request 📬 A request for new changes to improve functionality label Jan 25, 2023
@Sergio0694
Copy link
Member

Duplicate of #555, this will be supported through that.

@Sergio0694 Sergio0694 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 27, 2023
@Sergio0694 Sergio0694 added duplicate 👥 Indicates that an identical issue or PR already exists mvvm-toolkit 🧰 Issues/PRs for the MVVM Toolkit labels Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate 👥 Indicates that an identical issue or PR already exists feature request 📬 A request for new changes to improve functionality mvvm-toolkit 🧰 Issues/PRs for the MVVM Toolkit
Projects
None yet
Development

No branches or pull requests

2 participants