Skip to content

Use Icons in XAML content

Andreas edited this page Jan 29, 2023 · 1 revision

Due do bad performance, we moved all FontKeys into a static class (one class for each font). Please follow this guide either to migrate from {StaticResource ...} or to start with a fresh app.

Reference icons

In each XAML content, where you want to use the icons, please reference following namespace.

xmlns:icons="clr-namespace:AndreasReitberger.Shared.FontIcons;assembly=SharedMauiXamlStylesLibrary"

Migrate

If you already have used our style library, please replace all StaticResource as followd.

<!-- Replace -->
{StaticResource MaterialDesign_{IconName}}
<!-- with -->
{x:Static icons:MaterialIcons.{IconName}}

Available fonts

  • MaterialDesign: {x:Static icons:MaterialIcons.{IconName}}
  • FluentIcon: {x:Static icons:FluentIcons.{IconName}}
  • Syncfusion: {x:Static icons:SyncfusionIcons.{IconName}}

Clone this wiki locally