Problems Inserting Image on a Button

Asked

Viewed 59 times

0

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

inserir a descrição da imagem aqui

<ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="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 in my 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>

1 answer

0


Add the reference

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

Source

Browser other questions tagged

You are not signed in. Login or sign up in order to post.