Silverlight UserControl Binding to Object Properties


On your main user control create a member variable for your object. Your object will need to implement the INotifyPropertyChanged interface. In your constructor, set the data context to the member variable. Your child user control will need to provide a dependency property and implement the INotifyPropertyChanged interface. Place your child user control on to the main user control, and set its binding in XAML to the name of the property, and set its mode to two way: Text="{Binding MyDataProperty, Mode="TwoWay}".

Advertisements