【发布时间】:2019-09-29 10:48:41
【问题描述】:
我正在尝试使用 Material Design 制作 UI,但是当我想使用它时出现错误:资源“MaterialDesignFloatingHintTextBox”无法解析。
https://ibb.co/PcvdmqH 错误的样子
我从 NuGet MaterialDesignThemes 安装
我导入了这个xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
我在 App.xaml 中写了这个:
<ResourceDictionary x:Key="MaterialDesign">
<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.Blue.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Indigo.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
我该如何解决?
【问题讨论】:
-
您需要一个干净的解决方案并在将代码添加到 App.xaml 后重新构建
-
您找到解决方案了吗?
标签: c# wpf user-interface material-design-in-xaml