Since .Net 4 does support generics in XAML, I’d like to create a UserControl using generics, like:
public class MyComboBox<T>
{
}
I can declare the UserControl quite well, but how would I use it in a XAML file?
Or can’t this be done in XAML?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That would be:
Note that it’s the XAML 2009 format that supports this. But Visual Studio (even 2010) has no support for compiling XAML 2009 to BAML, only for loading loose xaml files. In the current state, unless you want to load all your .xaml files dynamically, you can’t use those new features.