I have a user control with a public property that I would like to set in XAML. Here it is below.
Testcontrol.xaml
<UserControl x:Class="Scale.Controls.TestControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300">
TestControl.xaml.cs
using System.Windows.Controls; namespace MyProject.Controls { public partial class TestControl : UserControl { public string TestMe { get; set; } public TestControl() { InitializeComponent(); } } }
Then, in my MainWindow.xaml file, I try to include this:
<controls:TestControl TestMe="asdf" />
However, although Visual Studio automatically populates the TestMe property, I then see things with a squiggly expression that says, "The Test Me member is not recognized or unavailable," as shown below.

I could have sworn I used to do something similar in other projects. How can I access (e.g. set) public properties via XAML as follows?
c # wpf xaml
Soapergem
source share