Posted 14 years ago
by Owen Christensen
-
Software Engineer,
Minitab Inc.
Version: 10.2.0532
Platform: .NET 4.0
Environment: Windows 7 (64-bit)
I have two subclasses: one of Ribbon.Controls.ComboBox and one of ComboBoxItem.
Overriding GetContainerForItemOverride to return my ComboBoxItem subclass, causes all the styling to be lost on the item. I'm not overriding the metadata for DefaultStyleKeyProperty and even explicitly setting it to typeof(ComboBoxItem) doesn't seem to fix this issue...and ideas?
I've tested this subclassing as described with the only code being the override of GetContainerForItemOverride and it does the same so there is no possibility this is (directly) due to my code.[Modified at 11/15/2010 03:42 PM]
[Modified at 11/15/2010 03:42 PM]
Overriding GetContainerForItemOverride to return my ComboBoxItem subclass, causes all the styling to be lost on the item. I'm not overriding the metadata for DefaultStyleKeyProperty and even explicitly setting it to typeof(ComboBoxItem) doesn't seem to fix this issue...and ideas?
I've tested this subclassing as described with the only code being the override of GetContainerForItemOverride and it does the same so there is no possibility this is (directly) due to my code.
public sealed class BackstageComboBox : ActiproSoftware.Windows.Controls.Ribbon.Controls.ComboBox
{
protected override System.Windows.DependencyObject GetContainerForItemOverride()
{
return new BackstageComboBoxItem();
}
}
public sealed class BackstageComboBoxItem : ComboBoxItem { }
[Modified at 11/15/2010 03:42 PM]