hi @Arathi Jinde
i think user control is meant to be project specific unlike custom control which meant to be a general purpose, however regarding your question since you didn't show your code we assumed the UserControl has it's viewmodel
you likely will use it like so <lib:UserControlView DataContext="{Binding UserControlViewModel }">
In WPF which is better MVVM way of loading an userControl/customcontrol from a different library project into mainWindow XAML
Arathi Jinde
6
Reputation points
there is seperate library for usercontrol which has to be loaded in another exe console project which is better approach for the same 1. using contentcontrol and set the content to the user control 2. refer the library in the mainwindow.xaxml and add the usercontrol inside the xaml <lib:userControl> or any other better way of achieving this ?
1 answer
Sort by: Most helpful
-
essamce 621 Reputation points
2021-03-23T20:46:56.963+00:00