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

Highligh Brush

3 Answers 87 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Oran
Top achievements
Rank 1
Oran asked on 11 Jan 2011, 09:14 PM
I need to change the mouse and selection highlight brush for all my telerik components. What is the way to achieve that?

Thanks,
Oran

3 Answers, 1 is accepted

Sort by
0
Dani
Telerik team
answered on 12 Jan 2011, 10:30 AM
Hello Oran,

If you only need to change two brushes, you might want to reconsider the choice of a theme.

On the other hand, if you still need to change only brushes,  what you need is a custom theme which will hold styles for each TelerikControl you use and manually change the two brushes for each of the controls.
However, you need to keep in mind that using a custom theme is more or less equal to hard-coding styles in your application - it needs maintenance with future releases of the control.

Regards,
Dani
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Oran
Top achievements
Rank 1
answered on 12 Jan 2011, 10:34 AM
I think we have misunderstood each other..

I see that every theme has its own identical brush that ALL controls are using. For example : the Office Silver theme is using some orange highlight brush both for MouseOver and Selection(which is a darker orange than the MouseOver).

My guess was that these two brushes are used globally by all controls and i just need to know how to reconfigure them and all the application highlighted selections and mouse overs will change.

From your answer i may understand that there are no global brushes and each control hard code its brush identically...

Is That True??

Thanks,
Oran
0
Dani
Telerik team
answered on 14 Jan 2011, 09:28 AM
Hi Oran,

There are "global" brushes. However you do not have access to them in their raw version. And even such access level was possible , it would not help you affect all controls. The theming mechanism for RadControls uses preprocessed XAML and merges only the needed resources.

Yes, a lot of the resources are, of course, shared. However, due to some considerations, this is not the case with all RadControls. For example, most controls use a ControlBackground_Normal brush for their background, but RadScheduler uses a SchedulerBackground brush.

Shortly, you cannot change a single brush that will affect all controls. What you need to do is generate the style for a control and change that brush from the generated resources. In case you have a custom theme with a separate style file for each control, of course, as a result some of the generated resources will be repeated . This is the point where you can take all shared brushes and other shared resources to a single external file referenced by all style files.

Regards,
Dani
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
General Discussions
Asked by
Oran
Top achievements
Rank 1
Answers by
Dani
Telerik team
Oran
Top achievements
Rank 1
Share this question
or