[go: up one dir, main page]

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

More observable collections #901

Open
Shadowblitz16 opened this issue Jul 8, 2024 · 0 comments
Open

More observable collections #901

Shadowblitz16 opened this issue Jul 8, 2024 · 0 comments
Labels
feature request 📬 A request for new changes to improve functionality

Comments

@Shadowblitz16
Copy link

Overview

I am trying to write some observable data classes which use mutable array of a fixed size.
I need something like ObservableCollection but without the ability to add and remove items.

I also noticed that there are no equivalents of Dictionary, Stack, Queue, and HashSet which would be nice.

API breakdown

Observable Arrays would be ObservableCollection without any methods that add or remove items.
Items could still be mutated and they would trigger collection.property changes

I don't know about the other collections, I'm sure they would just use the same api as the normal system.collections do they would just support notification.

Usage example

public sealed class ColorMap : ObservableArray<ObservableColor>
{
    public ColorMap(uint colorCount, uint shadeCount=1) : base(colorCount * shadeCount)
    {
        
    }
}

Breaking change?

I'm not sure

Alternatives

For array exposing the ability to add and remove items, for things like dictionary probably nothing.

Additional context

Right now I am trying to make a indexed image system using notifications.
When the color in the palette or image changes I reflect that on the actual bitmap.

Help us help you

No, just wanted to propose this

@Shadowblitz16 Shadowblitz16 added the feature request 📬 A request for new changes to improve functionality label Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request 📬 A request for new changes to improve functionality
Projects
None yet
Development

No branches or pull requests

1 participant