eran otzap
eran otzap

Reputation: 12533

Overriding StyleTypedProperty Attribute

I have a CustomControl Deriving from ComboBox

  CustomComboBox : ComboBox 
  {} 

The thing is that ComboBox is decorated with a StyleTypedProperty Attribute :

 [StyleTypedProperty(Property = "ItemContainerStyle", StyleTargetType = typeof(ComboBoxItem))]
 public class ComboBox  {} 

I want to supply a different StyleTargetType , is such a work around possible ?

iv'e also tried defining my own :

[StyleTypedProperty(Property = "ItemContainerStyle", StyleTargetType = typeof(CustomComboBoxItem))]

that had no effect ..

Upvotes: 3

Views: 849

Answers (1)

Sheridan
Sheridan

Reputation: 69989

It seems that this is not possible. Please refer to the following links for more information on this subject:

Overwrite customattribute on derived class

change attributes to a base class property in derived class without overriding

How to change attribute in derived class

Upvotes: 1

Related Questions