在WPF上添加图标

问题描述 投票:0回答:1

我正在使用 .Net WPF Framework 4.7.2 构建一个 WPF 项目。 我正在尝试使用 MaterialDesign 库,所以我有这个 App.xaml 文件:

<Application x:Class="DesfireCodificatoreWPF.App"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:materialDesign="https://materialdesigninxaml.net/winfx/xaml/themes"
         StartupUri="MainWindow.xaml">
<Application.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
            <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
            <ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.DeepPurple.xaml" />
            <ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Lime.xaml" />
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
</Application.Resources>
</Application>

但它说无法加载文件或程序集“MaterialDesign...” 我不明白为什么。我已经安装了 MaterialDesignThemes.Wpf 和 MaterialDesignColors

wpf visual-studio material-design
1个回答
0
投票

@弗朗西斯科·巴尔加斯。 我在测试时遇到了问题。

Cannot locate resource 'themes/materialdesigntheme.defaults.xaml'. 
我在nuget包上看到了错误信息,我不确定是否是nuget包上的错误。

如果您也有此错误信息,建议您尝试在materialdesigntheme论坛提出问题,看看是否是包错误。

© www.soinside.com 2019 - 2024. All rights reserved.