Mark
Mark

Reputation: 1

Binding in WPF usercontrol

I have WPF usercontrol with some binded controls to data source, when I run the usercontrol it shows the data OK, if I add the usercontrol to window and show the window, the data are not displayed on the usercontrol??

any help will be appreciated

Upvotes: 0

Views: 318

Answers (1)

Ed Ayers
Ed Ayers

Reputation: 1354

Based on the information you have given me I would think this would solve the problem:

When you add the UserControl set the DataContext property on the UserControl to the object you are binding to.

If that doesn't solve it write some more information about your problem in the question. Cool.

Upvotes: 1

Related Questions