Material XAML Toolkit 项目设置问题的设计

Material Design for XAML Toolkit project setup problem

我已经启动了一个空白的新 .NET Framework 4.8.0 WPF 项目,并且正在尝试将 Material Design for XAML Toolkit 添加到其中。我开始关注 quick start guide located on the Github wiki. I installed the nuget packages manually, by using the .nupkg files located here。我进入了添加库的第一个第二步,砰的一声,错误。

无法加载文件或程序集 'MaterialDesignThemes.Wpf, Culture=neutral' 或其依赖项之一。系统找不到指定的文件。"

我已经找了几个小时来解决这个问题,但没有成功。有什么想法吗?

我的app.xaml:

<Application x:Class="Launcher.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="clr-namespace:Launcher"
             xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
             StartupUri="MainWindow.xaml">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <materialDesign:BundledTheme BaseTheme="Light" PrimaryColor="DeepPurple" SecondaryColor="Lime" />
                <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>

自从开始新项目以来,其他一切都保持原样。

谢谢:)

事实证明,教程中的这个有效。

<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>

前两个词典有错误,但仍然可以编译,编译后错误消失。我不知道为什么。