I want to create a Custom Control derived from ComboBox, however if I create custom control from visual studio template, it creates a default style of Control and I have to then open MSDN's control template of ComboBox and then recreate entire combobox style once again an in generic.xaml
What I want to do is, I want to create a custom control derived from ComboBox and in the generic.xaml I only want to define ItemTemplate and not entire ControlTemplate.
However if I keep the line
static MyComboBox()
{
DefaultStyleKeyProperty.
OverrideMetadata(typeof(MyComboBox),
new FrameworkPropertyMetadata(
typeof(MyComboBox)));
}
Then I dont see anything at all if I remove the ControlTemplate from generic.xaml, however if I define key ItemTemplate in generic.xaml, how should I initialize my static constructor in order to refelct only ItemTemplate?
Sure I can redesign the xaml theme from msdn help but isnt there any easy way to do it?