WPF Custom controls/User controls binding issues and total confusion
need to create a reusable WPF control for displaying plugin settings. There is a defined set of settings, e.g., toggle, combo, file path.
Each of those settings requires its own WPF control.
My initial attempt was to create a User Control, and define a Dependency Property within it:
I set the data context in the constructor to
this
Initially, I've tried using IEnumerable
as a type, but let's stay with this non-collection type for now.
The view of the User control is:
I place my control into my MainWindow.xaml:
But the data is not bound!!!1 Reply
The MainWindow has its data context set to a ViewModel utilizing CommunityToolkit MVVM.
But here's the kicker... when I go back to the MainWindow.xaml, and modify the binding to:
where
Root
is the x:Name
of the UserControl.
What in the world is going on???