There seems to be a bit of yes/no/absolutely/no way info floating around on the web about this. I'd like to be able to create a base class.
class GenericUserControl<T> : UserControl {
// Lots of cools stuff based on T cause I wanna! In fact T
// will be the ViewModelClass but please no pedantic discussion on what
// MVVM is or is not. I want generics in XAML!
}
Then create a new concrete user control in the designer based off GenericUserControl
class MyControl : GenericUserControl<MyControlViewModel> {
}
I've seen a number of blog post claiming this is possible using x:TypeArguments in XAML and there seems to be XAML doc http://msdn.microsoft.com/en-us/library/ms750476.aspx suggesting this feature is possible but then again I've found posts saying this feature is broken in Visual Studio 2012.
So if this is possible and any genius can figure out how to get it working specifically with VS 2012 then please post a tested solution here and I will be super happy.