Repository navigation
fix(icons): Handle ImageIconSource in MakeIconElementFrom - #25595
Conversation
The shared helper used by TitleBar, TabViewItem, InfoBar and TeachingTip had no branch for ImageIconSource, so it returned null and the icon slot stayed empty. Add the branch before BitmapIconSource, like WinUI does. Fixes unoplatform#25465
|
This pull request is merged. |
MartinZikmund
left a comment
There was a problem hiding this comment.
Thanks @buzztouniverse! This matches WinUI's SharedHelpers::MakeIconElementFrom (controls/dev/dll/SharedHelpers.cpp) 1:1: same placement before the BitmapIconSource branch, same ImageSource/Foreground copy as ImageIconSource::CreateIconElementCore. The test goes through the real TitleBar path and fails without the fix. LGTM.
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. |
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 247581 found UI Test snapshots differences: Details
|
|
🎉 Congratulations on getting your very first pull request merged into Uno Platform! This is a huge milestone — you are now officially part of the community of contributors helping shape the future of cross-platform .NET development, and your code will reach developers and apps all over the world. 🌍 |

GitHub Issue: closes #25465
PR Type:
🐞 Bugfix
What changed? 🚀
SharedHelpers.MakeIconElementFromhandledFontIconSource,SymbolIconSource,BitmapIconSourceandPathIconSource, but had no branch forImageIconSource. It returnednullfor it, soTitleBar,TabViewItem,InfoBarandTeachingTipshowed an empty icon slot when given anImageIconSource.This adds the missing branch: it creates an
ImageIconand copiesImageSourceandForeground. It sits before theBitmapIconSourcebranch, same order as WinUI'sSharedHelpers::MakeIconElementFrom.Also added a runtime test in
Given_TitleBarthat sets anImageIconSourceand checks that anImageIconusing the same image is created.PR Checklist ✅
Screenshots Compare Test Runresults.