Trending
WHO warns smoking may reduce fertility in both men and women is trending now Diphtheria outbreak: Nigeria’s capital city confirms 5 cases, 2 deaths is trending now EHealth Africa Supports Vaccination Of 23m Children is trending now A star is exploding 45 million light-years away — here's how you can see it is trending now Ancient Alligator Relative Lived Right After Dinosaur-Killing Asteroid is trending now Rocket Lab protests NASA's decision to award Blue Origin $700 million Mars orbiter contra… is trending now International Scientists Uncover Reason Behind Slowdown In Star Formation is trending now Man Utd 4-0 Sabah: Winning return to Champions League as Benjamin Sesko scores again for … is trending now 'Stop making promises!' - Moroccan PM steps in after football boss claims 2030 World Cup … is trending now FIFA confirm lifetime bans for two former officials after extensive abuse of position and… is trending now Manchester United ban 685 fan accounts and sanction hundreds more following extensive tic… is trending now 90 Day Fiancé Season 7 Couples: Where Are They Now? is trending now WHO warns smoking may reduce fertility in both men and women is trending now Diphtheria outbreak: Nigeria’s capital city confirms 5 cases, 2 deaths is trending now EHealth Africa Supports Vaccination Of 23m Children is trending now A star is exploding 45 million light-years away — here's how you can see it is trending now Ancient Alligator Relative Lived Right After Dinosaur-Killing Asteroid is trending now Rocket Lab protests NASA's decision to award Blue Origin $700 million Mars orbiter contra… is trending now International Scientists Uncover Reason Behind Slowdown In Star Formation is trending now Man Utd 4-0 Sabah: Winning return to Champions League as Benjamin Sesko scores again for … is trending now 'Stop making promises!' - Moroccan PM steps in after football boss claims 2030 World Cup … is trending now FIFA confirm lifetime bans for two former officials after extensive abuse of position and… is trending now Manchester United ban 685 fan accounts and sanction hundreds more following extensive tic… is trending now 90 Day Fiancé Season 7 Couples: Where Are They Now? is trending now
XML

Say Goodbye to the FontImageExtension in .NET MAUI 👋

Say Goodbye to the FontImageExtension in .NET MAUI 👋

For quite some time, the FontImageExtension has been used to display font icons inside controls. But, as part of the news in .NET 10 for .NET MAUI, this extension is now deprecated, which means you should no longer use it in your projects and start preparing to migrate to the new recommended extension. But… which one is the recommended extension? 🤔…Continue Reading→

For quite some time, the FontImageExtension has been used to display font icons inside controls. But, as part of the news in .NET 10 for .NET MAUI, this extension is now deprecated, which means you should no longer use it in your projects and start preparing to migrate to the new recommended extension.

But… which one is the recommended extension? 🤔

We now have the FontImageSource markup extension, which allows you to display icons just like the deprecated one, but in a clearer and more consistent way.

Using FontImageSource is very simple, you just need to know the following properties:

➖ Glyph:            The symbol of the icon.

➖ Color:             The color of the icon.

➖ Size:                The size of the icon.

➖ FontFamily:  The font that contains the icon (e.g., FontAwesome).

And you have two ways to implement it, as I’ll show you below:

1⃣ Inline syntax

This is a more direct and compact way, where FontImageSource is defined directly as the value of the ImageSource property. However, keep in mind that if you need to define multiple properties/values, it can become a bit harder to read.

2⃣ Property element syntax

In this expanded option, instead of setting the value directly in the attribute, you have to open a <Control.ImageSource> block. For example, if you are working with a Button, you can add a <Button.ImageSource> block and place the FontImageSource inside it.

It may look much longer because it requires a more detailed structure, but it’s far more readable, especially when it contains multiple properties.


And that’s it! 🎉 In just a few minutes you know how to react when you see FontImageExtension: simply replace it with FontImageSource! 😎

🙌 Thanks for reading my article!

If you have any questions, feel free to leave them in the comments. 💚💕

See you next time! 🙋‍♀️

References

This article was based on the official documentation.

View original source →

Related