The reason is, you get an error when you attempt to set the data context of the user control.
Let’s say you try this: You will not receive an error for trying to set the user control’s data context.
Your user control can be as simple as this: Now your user control can bind; and it can bind one or two way!
It’s up to use to use the mode that is appropriate for the controls you are embedding in your user control.
We just need to bind widgets to the View Model to read and write data. Before we move on to the definition of the Notice that there is absolutely nothing superfluous in it whatsoever.
Binding inside your user control isn’t exactly obvious either.I wouldn’t want to write a completely trivial example that didn’t do anything.With that in mind, let me lay out the ground rules.Our model is simple; consisting of a single property is the text that the user will enter.
The getter returns the current value of the property.There are two important components of the framework. It should also be noted that all View Model classes that are bound to by the View should implement this (even if the values don’t change from the View Model) as there is a known memory leak that may occur if they don’t (see the Microsoft support article).