I am trying to make an UI with material design but when I want to use it I have an error: The resource " MaterialDesignFloatingHintTextBox" could not be resolved.
https://ibb.co/PcvdmqH how the error looks like
I installed from NuGet MaterialDesignThemes
I imported this xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
And in App.xaml I wrote this:
<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>
How can I fix it?
First check your project resources, that you have the nugets for Material Design.
Add this code in your App.Xaml file; under Application.Resources.
It works for me.
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With