Closed indyjason79 closed 5 months ago
@indyjason79 This issue seems to be related to Maui App Theme Binding Support https://github.com/dotnet/maui/issues/15573
Currently, You can use AppThemeBinding on MauiIcons Built in Control, that does support it or a Control that has Direct BindableProperty to Color like Label TextColor and etc..
<mi:MauiIcon Icon="{mi:Material Icon=AccessAlarms}" IconColor="{AppThemeBinding Dark={StaticResource Blue200Accent}, Light={StaticResource Blue100Accent}}" />
<Label Text="{mi:Material Icon=AccessAlarms}" TextColor="{AppThemeBinding Dark={StaticResource Blue200Accent}, Light={StaticResource Blue100Accent}}"/>
@indyjason79 Little While Ago, I have rollout a new update for MauiIcons, that enables us to use ImageSource Like Below Code
<Image>
<Image.Source>
<FontImageSource Glyph="{mi:Material Icon=AccessAlarms}" Color="{AppThemeBinding Dark={StaticResource
Blue200Accent}, Light={StaticResource Blue100Accent}}"/>
</Image.Source>
</Image>
@indyjason79 Little While Ago, I have rollout a new update for MauiIcons, that enables us to use ImageSource Like Below Code
<Image> <Image.Source> <FontImageSource Glyph="{mi:Material Icon=AccessAlarms}" Color="{AppThemeBinding Dark={StaticResource Blue200Accent}, Light={StaticResource Blue100Accent}}"/> </Image.Source> </Image>
That's exactly what I was trying to do. Thanks for the quick reply, and love the library! :D
@indyjason79 Little While Ago, I have rollout a new update for MauiIcons, that enables us to use ImageSource Like Below Code
<Image> <Image.Source> <FontImageSource Glyph="{mi:Material Icon=AccessAlarms}" Color="{AppThemeBinding Dark={StaticResource Blue200Accent}, Light={StaticResource Blue100Accent}}"/> </Image.Source> </Image>
That's exactly what I was trying to do. Thanks for the quick reply, and love the library! :D
Really glad that I can sort this issue out 👍
Describe the bug Trying to use AppThemeBinding for my IconColor like so:
and get the following compile time exception:
Pages\ProductsPage.xaml(108,29): XamlC error XFC0009: No property, BindableProperty, or event found for "IconColor", or mismatching type between value and property.
To Reproduce Steps to reproduce the behavior:
Expected behavior I expected to be able to set the color based on the theme like you can do everywhere else.
Screenshots N/A
Desktop and Smartphone (please complete the following information):
Additional context N/A