Problems inserting image into a Button

0

I'm having trouble inserting an image of the "PackIconFontAwesome" package into a button. I installed the Mahapps Icons package and referenced it in my view, but an error appears as shown below. What is missing?

<ResourceDictionary><ResourceDictionary.MergedDictionaries><ResourceDictionarySource="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.Buttons.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/FlatButton.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Red.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseDark.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.AnimatedTabControl.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.AnimatedSingleRowTabControl.xaml" />
                <ResourceDictionary Source="/Resources/Icons.xaml" />
            </ResourceDictionary.MergedDictionaries>
</ResourceDictionary>

Reference naming view:

xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"

Button Code:

<Button>
    <StackPanel Orientation="Horizontal">
        <iconpacks:PackIconMaterial Kind="Cookie"
                    Margin="4 4 2 4"
                    Width="24"
                    Height="24"
                    VerticalAlignment="Center" />
        <TextBlock Text="Test"
    Margin="2 4 4 4"
    VerticalAlignment="Center" />
    </StackPanel>
</Button>
    
asked by anonymous 05.01.2018 / 14:42

1 answer

0

Add the reference

xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"

Font

    
05.01.2018 / 15:59