如何解决“ MaterialDesignFloatingHintTextBox”无法解决

时间:2019-09-29 10:48:41

标签: c# wpf user-interface material-design-in-xaml

我正在尝试使用材质设计制作UI,但是当我要使用它时出现错误:资源“ MaterialDesignFloatingHintTextBox”无法解析。

https://ibb.co/PcvdmqH错误的样子

我从NuGet MaterialDesignThemes安装 我导入了此ID, DATE, TIME, VALUE 001,2019-01-01, 0010, 150 001,2019-01-01, 0030, 160 001,2019-01-01, 0050, 150 002,2019-01-01, 0010, 151 002,2019-01-01, 0030, 161 002,2019-01-01, 0040, 162 002,2019-01-01, 0051, 152

在App.xaml中,我这样写:

xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"

我该如何解决?

2 个答案:

答案 0 :(得分:0)

您需要将其放置在xaml文件的顶部,您要在其中放置具有materialmaterialfloatinghint样式样式的文本框

xmlns:materialDesign =“ http://materialdesigninxaml.net/winfx/xaml/themes”

答案 1 :(得分:0)

尝试还添加以下内容:

<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TextBox.xaml" />