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

ResourceProvider upgrade #16928

Merged
merged 6 commits into from
Sep 12, 2024
Merged

ResourceProvider upgrade #16928

merged 6 commits into from
Sep 12, 2024

Conversation

maxkatz6
Copy link
Member

@maxkatz6 maxkatz6 commented Sep 4, 2024

What does the pull request do?

This PR makes ResourceProvider abstract class more usable/appealing to developers to inherit.
Before ResourceProvider, the only choice for custom resource dictionaries was to use private APIs.
In 11.2 we got ResourceProvider, but it didn't inherit AvaloniaObject, making it less useful, when developer needs any dynamic property.

using Avalonia.Collections;
using Avalonia.Controls;
using Avalonia.Styling;

namespace Avalonia.Themes.Fluent;

internal class ColorPaletteResourcesCollection : AvaloniaDictionary<ThemeVariant, ColorPaletteResources>, IResourceProvider
internal sealed class ColorPaletteResourcesCollection : ResourceProvider, IDictionary<ThemeVariant, ColorPaletteResources>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of new boilerplate, because C# can't do multiple inheritance.

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0051666-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0051749-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0051822-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@maxkatz6 maxkatz6 merged commit c50e731 into master Sep 12, 2024
11 checks passed
@maxkatz6 maxkatz6 deleted the ResourceProvider-upgrade branch September 12, 2024 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants