Suppose we have a generic View model like this:
public class MyViewModel : INotifyPropertyChanged where T : Class1 { private T _objectModel; pub
You're not capable of setting a generic viewmodel in XAML because XAML requires known types at compile time.
Dependency injection is your best bet
public class MyControl : UserControl{ public MyControl(Object viewModel){ this.DataContext = viewModel; } }