This is a migrated thread and some comments may be shown as answers.

RadComboBoxItem - Change Foreground on Mouseover

1 Answer 71 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Paul Exler
Top achievements
Rank 1
Paul Exler asked on 19 Jun 2012, 12:02 PM
How to change the Foregroundcolor of the ContentPresenter for a state like MouseOver?

When i create a copy of the RadComboBoxItem Template, i have access to the States of the ItemTemplate.
But as long the ContentPresenter grabs his ForegroundColor from the Style (and not from its Template) i cannot set my own Foreground for a state.

How to solve that?

It's an WPF Project and i am using Blend 4, with RadControls for WPF Q3 2011 SP1

Thanks for any idea.

1 Answer, 1 is accepted

Sort by
0
Dani
Telerik team
answered on 19 Jun 2012, 06:09 PM
Hi Paul,

The MouseOver animations are contained in the VisualStates just as you pointed out. So, in order to change Foreground on mouse over, you will need to modify the Style (to be more specific, the brush that the mouse over state uses) and not the ContentTemplate.

Since you cannot set the Foreground property in a ContentPresenter, what you can do is to generate the ItemContainerStyle for the RadComboBox and then change the ContentPresenter to a ContentControl. Then, you are free to specify a custom Foreground brush for that ContentControl in the MouseOver state.

I hope this helps.

Kind regards,
Dani
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Tags
ComboBox
Asked by
Paul Exler
Top achievements
Rank 1
Answers by
Dani
Telerik team
Share this question
or