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

FontImage markup extension doesn't allow AppThemeBinding #23347

Open
davidortinau opened this issue Jun 28, 2024 · 5 comments · May be fixed by #23657
Open

FontImage markup extension doesn't allow AppThemeBinding #23347

davidortinau opened this issue Jun 28, 2024 · 5 comments · May be fixed by #23657
Assignees
Labels
area-xaml XAML, CSS, Triggers, Behaviors platform/iOS 🍎 t/bug Something isn't working
Milestone

Comments

@davidortinau
Copy link
Contributor

Description

This works in Hot Reload, but won't compile.

<Button Text="Comment" 
                            Background="Transparent" 
                            TextColor="{AppThemeBinding Light=Black, Dark=White}" 
                            ImageSource="{FontImage Glyph={x:Static f:FontAwesome.CommentAlt}, Color={AppThemeBinding Light=Black, Dark=White}, FontFamily=FontAwesome, Size=18}" />

This works everywhere:

<Button Text="Comment" 
                            Background="Transparent" 
                            TextColor="{AppThemeBinding Light=Black, Dark=White}" >
                            <Button.ImageSource>
                                <FontImageSource Glyph="{x:Static f:FontAwesome.CommentAlt}" 
                                    Color="{AppThemeBinding Light=Black, Dark=White}" 
                                    FontFamily="FontAwesome" 
                                    Size="18" />
                            </Button.ImageSource>
                        </Button>

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

8.0.61 SR6.1

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

@davidortinau davidortinau added the t/bug Something isn't working label Jun 28, 2024
Copy link
Contributor

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@PureWeen PureWeen added this to the Backlog milestone Jul 11, 2024
@PureWeen PureWeen added the area-xaml XAML, CSS, Triggers, Behaviors label Jul 11, 2024
@StephaneDelcroix StephaneDelcroix self-assigned this Jul 15, 2024
@StephaneDelcroix
Copy link
Contributor

StephaneDelcroix commented Jul 15, 2024

I think this was discussed in the past already, but it looks like the FontImageExtension could be removed, and you could use the FontImageSource element with a markup syntax

StephaneDelcroix added a commit that referenced this issue Jul 17, 2024
The passthrough markup extensions serves no purposes, and isn't as
flexible as the complete FontImageSource (allowing bindings,
dynamicresources, ...)

For convenience, the element syntax can be used as a markup syntax
{FontImagesource}

- fixes #23347
@StephaneDelcroix StephaneDelcroix linked a pull request Jul 17, 2024 that will close this issue
@StephaneDelcroix
Copy link
Contributor

as a workaround, using {FontImageSource} works. Once #23657 is merged, it also becomes the recommended way, as {fontImage will be deprecated}

StephaneDelcroix added a commit that referenced this issue Jul 29, 2024
The passthrough markup extensions serves no purposes, and isn't as
flexible as the complete FontImageSource (allowing bindings,
dynamicresources, ...)

For convenience, the element syntax can be used as a markup syntax
{FontImagesource}

- fixes #23347
@davidortinau
Copy link
Contributor Author

@mgoertz-msft @DianaSoltani can we get a code analyzer fix for this and work it into Upgrade Assistant?

@mgoertz-msft
Copy link
Contributor

I would start by marking [Obsolete(...)] with a message of what to use instead. All these one-off analyzers/codefixers aren't cheap since we do not have a good infrastructure for manipulating XAML. We can add that to the score card. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-xaml XAML, CSS, Triggers, Behaviors platform/iOS 🍎 t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants