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

Allow generating observable properties with private setters #896

Closed
mikernet opened this issue Jul 2, 2024 · 1 comment
Closed

Allow generating observable properties with private setters #896

mikernet opened this issue Jul 2, 2024 · 1 comment
Labels
duplicate 👥 Indicates that an identical issue or PR already exists feature request 📬 A request for new changes to improve functionality

Comments

@mikernet
Copy link

mikernet commented Jul 2, 2024

Overview

Would be nice if you could generate observable properties with private setters. Many observable properties should only be privately settable.

API breakdown

Add the following property to ObservablePropertyAttribute:

public bool PrivateSetter { get; set; }

Usage example

public partial class MyViewModel : ObservableObject
{
    [ObservableProperty(PrivateSetter = true)]
    private bool _isLoaded;

    public async Task LoadAsync()
    {
        Data = await ...;
        IsLoaded = true;
    }
}

Breaking change?

No

Alternatives

None

Additional context

No response

Help us help you

No, just wanted to propose this

@mikernet mikernet added the feature request 📬 A request for new changes to improve functionality label Jul 2, 2024
@Sergio0694
Copy link
Member

Duplicate of #291.
Superseded by #555.

@Sergio0694 Sergio0694 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 2, 2024
@Sergio0694 Sergio0694 added the duplicate 👥 Indicates that an identical issue or PR already exists label Jul 2, 2024
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
Projects
None yet
Development

No branches or pull requests

2 participants