[Proposal] Extension bindings for AppTheme and AppThemeColor
fredericoregateiro opened this issue · 1 comments
fredericoregateiro commented
Extension bindings for AppTheme and AppThemeColor
- Proposed
- Prototype
- Implementation
- iOS Support
- Android Support
- macOS Support
- Windows Support
- Unit Tests
- Sample
- Documentation: MicrosoftDocs/CommunityToolkit#157
Link to Discussion
AppThemeBinding in Markup #627
Summary
Create binding extensions for SetAppTheme
and SetAppThemeColor
Motivation
Detailed Design
Usage Syntax
new Button().AppThemeBinding(Button.TextColorProperty, Colors.Green, Colors.Orange)
C# Usage
public static TBindable AppThemeBinding<TBindable, T>(this TBindable bindable, BindableProperty bindableProperty, T light, T dark) where TBindable : BindableObject
{
bindable.SetAppTheme(bindableProperty, light, dark);
return bindable;
}
public static TBindable AppThemeColorBinding<TBindable>(this TBindable bindable, BindableProperty bindableProperty, Color light, Color dark) where TBindable : BindableObject
{
bindable.SetAppThemeColor(bindableProperty, light, dark);
return bindable;
}
Drawbacks
Alternatives
Unresolved Questions
brminnick commented
Thanks @fredericoregateiro!
@bijington has volunteered to Champion this PR. The next step before we can review/merge a PR is to vote on this Proposal.
To learn more about our process for new features, you can read the “Submitting a New Feature” section here: https://github.com/CommunityToolkit/Maui.Markup#submitting-a-new-feature