I created a UserControl in WPF. This user control has several text boxes that are bound to properties on a database object which is referenced by proptery on the UserControl. The xaml looks like:
<TextBox Name='_txtFirstName' Text='{Binding Path=Contact.FirstName, UpdateSourceTrigger=PropertyChanged}'/>
This worked properly until I made the Contact property into a dependency property so that I could bind it to the selected item in a ListBox. Once I did this the binding of the TextBoxes stopped working. Why is this?
The DependencyProperty code was:
public static readonly DependencyProperty ContactProperty = DependencyProperty.Register( 'Contact', typeof(Contacts), typeof(ContactView));
I figured out the problem. I forgot to change this code:
To this:
Now it works properly.