1

I have a problem with using d: in front of attributes, to display them in the XAML Designer.

<StackPanel DataContext="{Binding ElementName=ControlForProjectSettings, Path=ViewModel}"
            HorizontalAlignment="Center" d:DataContext="{Binding ElementName=ControlForProjectSettings, Path=ViewModel}">
    <TextBlock Style="{StaticResource HeadingTextBlocksStyle}" Text="Project Settings" d:Text="Test"/>
</StackPanel>

Only the d:DataContext property gets resolved but d:Text tells me The property text does not existing in the "http://schemas.microsoft.com/expression/blend/2008" namespace
Of course I am using the following lines of code in my header XAML document:

xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"

This is one of my sources that i read: Use Design Time Data with the XAML Designer in Visual Studio
I am using Visual Studio 2019 version 16.8 and .NET Framework.
Any suggestions why it's not working for me?

Stan1k
  • 338
  • 2
  • 17

1 Answers1

1

At the moment, this only works for .NET Core. In the referenced article it reads "You can use d: with attributes for any UWP or WPF .NET Core control, like colors, font sizes, and spacing. You can even add it to the control itself."

Jeff
  • 646
  • 1
  • 7
  • 13
  • 1
    That's right but when you move to the section **Requirements**, one bullet point says "_This feature is also available for .NET Framework in the Preview channel. To enable it, go to Tools > Options > Environment > Preview Features, select New WPF XAML Designer for .NET Framework and then restart Visual Studio._ Unfortunately when I go to the Preview channel, I don't see this option. Any ideas why I can't see it? – Stan1k Dec 17 '20 at 08:34
  • Correct. They have not implemented this as of 16.8.3 - still waiting for this myself. – Jeff Dec 18 '20 at 02:21