-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
ResourceProvider upgrade #16928
Conversation
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> |
There was a problem hiding this comment.
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.
You can test this PR using the following package version. |
You can test this PR using the following package version. |
You can test this PR using the following package version. |
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.