Kinnara / ModernWpf

Modern styles and controls for your WPF applications
MIT License
4.51k stars 449 forks source link

Integrate FontAwesome in NavigationViewItem #675

Open oghenez opened 1 month ago

oghenez commented 1 month ago

Hello

I have struggled to incluse fontawesome without success. First in my App.xaml file i included like this

 <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ui:ThemeResources />
                <ui:XamlControlsResources />
            </ResourceDictionary.MergedDictionaries>

            <FontFamily x:Key="FontAwesome">pack://application:,,,/NavigationDemo;component/Fonts/FontAwesome-5-Free-Regular-400.otf</FontFamily>

        </ResourceDictionary>
    </Application.Resources>
</Application>

and i tried to use like this


<ui:NavigationViewItem Content="Add" Tag="home">
                    <ui:NavigationViewItem.Icon>
                        <ui:FontIcon FontFamily="{StaticResource FontAwesome}" Glyph="&#xf015;" /> 
                    </ui:NavigationViewItem.Icon>
                </ui:NavigationViewItem>

                <ui:NavigationViewItem Content="customer" Tag="customer" Icon="Contact"/>

But without success, pls can someone help me out