I just pasted the PasswordBox input field from the resource and Visual studio says that
'The member 'Foreground' is not recognized or, accessible'.
Is this an issue or, am I missing something?
@shunjid I assume you mean you have something like this:
<PasswordBox x:Name="FloatingPasswordBox"
materialDesign:HintAssist.Hint="Floating Password"
materialDesign:HintAssist.Foreground="Green"
materialDesign:TextFieldAssist.UnderlineBrush="Green"
Style="{StaticResource MaterialDesignFloatingHintPasswordBox}" />
You will also need the including namespace on the root element
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
Like it was done here
@Keboo
Root element means MainWindow.xaml?
In my MainWindow.xaml you can see,
<Window x:Class="SimpleForms.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:SimpleForms"
mc:Ignorable="d"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
TextElement.FontWeight="Regular"
TextElement.FontSize="13"
TextOptions.TextFormattingMode="Ideal"
TextOptions.TextRenderingMode="Auto"
Background="{DynamicResource MaterialDesignPaper}"
FontFamily="{DynamicResource MaterialDesignFont}"
Title="MainWindow" Height="600" Width="480">
And In App.xaml
<Application x:Class="SimpleForms.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:SimpleForms"
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>
But still It's not getting recognized :-(
Are you using the latest 2.5.1 preview NuGet? The change is only in the 2.5.1 preview package.
@Keboo
It's 2.5.0.1205
Ah that is the problem then, you will need to use the newer 2.5.1 preview NuGet package if you want that property.
@Keboo In Visual Studio When I am trying to download it shows 2.5.0.1205 as the latest one. How do I install 2.5.1 then?
There is a little checkbox called "Include Prerelease". Once checked it will show the preview packages along with the full releases. Docs here
Finally, This is happening.
Thanks a lot @Keboo 鉂わ笍