I'm extending a rad element for custom behavior (specifically, I'm making a multi-select drop down where the textbox acts as a search input). I'm trying to add a custom property,
IsHighlighted to
RadListBoxItem. I have a custom XML style sheet for my control which is being loaded and works, except that it doesn't highlight as expected.
Here are the modifications I've made:
- I've created a MultiSelectComboBoxElement that extends RadComboBoxElement. I define a public static RadProperty IsHighlightedProperty in this class. It's static constructor registers my theme (XML) from storage (this was based on the default combobox theme) and registers the property as follows:
Notice, I'm trying to add the rad property to
RadListBoxItem in the
MultiSelectComboBoxElement static constructor.
- My theme (XML) defines some visual settings for RadListBoxItems with selector condtions that use my new property. Here's one example:
I set the
IsHighlighted value in code using
item.SetValue(IsHighlightedProperty, true). This seems to work because subsequent calls to
item.GetValue(IsHighlightedProperty) return
true. I know telerik is using my theme as I see other visual changes and it does not throw any exceptions about not being able to find the
IsHighlighted property, but the control style never changes at runtime (the item's background doesn't change). Any help would be greatly appreciated.