MauiIcons
MauiIcons copied to clipboard
Icons does not appearing when using Style and Trigger Setter's
Describe the bug If the Label.Text property is set from XAML markup - the icons is displayed. But if the Text property is set from Style.Setter, the icons is not displayed.
To Reproduce
Set Label.Text property in XAML markup:
<Label Text="{mi:MaterialOutlined Icon=ArrowDropUp, IconColor={StaticResource Primary}}" />
result:
use Styles:
<Label>
<Label.Style>
<Style TargetType="Label">
<Setter Property="Text" Value="{mi:MaterialOutlined Icon=ArrowDropDown, IconColor={StaticResource Primary}}" />
</Style>
</Label.Style>
</Label>
result:
Expected behavior use Styles:
<Label>
<Label.Style>
<Style TargetType="Label">
<Setter Property="Text" Value="{mi:MaterialOutlined Icon=ArrowDropDown, IconColor={StaticResource Primary}}" />
</Style>
</Label.Style>
</Label>
result:
Additional context API33 Android 13.0 <TargetFrameworks>net8.0-android</TargetFrameworks>
Describe the bug If the Label.Text property is set from XAML markup - the icons is displayed. But if the Text property is set from Style.Setter, the icons is not displayed.
To Reproduce Set Label.Text property in XAML markup:
<Label Text="{mi:MaterialOutlined Icon=ArrowDropUp, IconColor={StaticResource Primary}}" />
result:use Styles:
<Label> <Label.Style> <Style TargetType="Label"> <Setter Property="Text" Value="{mi:MaterialOutlined Icon=ArrowDropDown, IconColor={StaticResource Primary}}" /> </Style> </Label.Style> </Label>
result:
Expected behavior use Styles:
<Label> <Label.Style> <Style TargetType="Label"> <Setter Property="Text" Value="{mi:MaterialOutlined Icon=ArrowDropDown, IconColor={StaticResource Primary}}" /> </Style> </Label.Style> </Label>
result:
Additional context API33 Android 13.0 <TargetFrameworks>net8.0-android</TargetFrameworks>
Thanks for reporting, I guess this scenario is rarely used, seems like we don't have test for it yet or nor a complete implementation to support style setter. Will release a patch with fix for this as soon as possible.
...I guess this scenario is rarely used...
I think this should have widespread use:
You can use Setter's not only with styles (I just gave styles as an example), but also in triggers - they have the same Setter's. For example, buttons that change their state (icon) - now I am forced to create several buttons and hide unnecessary ones, instead of just changing the button icon through a trigger.
...I guess this scenario is rarely used...
I think this should have widespread use:
You can use Setter's not only with styles (I just gave styles as an example), but also in triggers - they have the same Setter's. For example, buttons that change their state (icon) - now I am forced to create several buttons and hide unnecessary ones, instead of just changing the button icon through a trigger.
Yeah, I know
When we setting up a roadmap for v2, there's no request regarding support for multitrigger, triggers or setter support from devs. Therefore we mainly focused on supporting Xaml Markup Extension Across Different Controls.
Anyway, this feature request would be great starting point for supporting all Maui triggers and setters.
I'd really appreciate, if you share me sample of Xaml that uses Multitrigger, Single trigger and Setters that covers the whole use case.
Hey, is this fixed in v3.0.0?
Hey, is this fixed in v3.0.0?
This feature is not part of v3