Hi,
I have WPF usercontrol that is binded to some data, when I run the usercontrol it shows the data, but when I place the usercontrol on WPF window it shows blank with no data!
What is the correct way to add binded usercontrol to WPF window?
Hi,
I have WPF usercontrol that is binded to some data, when I run the usercontrol it shows the data, but when I place the usercontrol on WPF window it shows blank with no data!
What is the correct way to add binded usercontrol to WPF window?
You need to define an xlmns which refers to your application and namespace, something like
xmlns:vw="clr-namespace:MyApp.View"
then you can reference your UserControl with
<vw:MyControl DataContext="{Binding MyData}" />
It sounds as if you might be doing it all apart from the binding - run your app and look in the Ouput window to see if there are binding errors.