我正在使用 .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
@弗朗西斯科·巴尔加斯。 我在测试时遇到了问题。
Cannot locate resource 'themes/materialdesigntheme.defaults.xaml'.
我在nuget包上看到了错误信息,我不确定是否是nuget包上的错误。
如果您也有此错误信息,建议您尝试在materialdesigntheme论坛提出问题,看看是否是包错误。