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

Extract RadListBoxItem Style Using Blend 2015

3 Answers 250 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 22 Aug 2016, 05:00 PM

Hello,

I am using VS Professional 2015, DevCraft Ultimate version 2016.2.613, UI for WPF RadListBox.  Using Office2013 Theme, I wish to override the color of a RadListBox's selected RadListBoxItem.  I also want to override this background color for mouseover.  Currently these are an orange color and I want to change that.  My understanding is that the RadListBoxItem control template has a border named "SelectedVisual" and I need to override its background color.  Maybe something similar for mouseover? (haven't got there yet).  My problem is that I can't figure out how to do any of this using Expression Blend 2015.  I'm on the Objects and Timeline pane and when I right click on my RadListBox I don't see an option for "Edit Additional Styles" which I think would get me to the RadListBoxItem's style.  I do see "Edit Additional Templates" but nothing I try around that option is getting me to the "SelectedVisual" border.  I would welcome any info on 1) how to do this in Blend or 2) any recommended alternative method to override RadListBoxItem's selected and mouseover background colors.  Please see attached imagesto better visualize what I'm trying to do.

 

Thanks,

Chris

3 Answers, 1 is accepted

Sort by
0
Chris
Top achievements
Rank 1
answered on 22 Aug 2016, 07:39 PM

So I'm looking at my Telerik installation, specifically at \Telerik\UI for WPF Q1 2016\Themes.Implicit\WPF40\Office2013\Themes and I have located a control template for RadListBoxItem inside file "Telerik.Windows.Controls.xaml".  I assume it is "the" one template I need.  This control template is probably what I would be extracting using Blend, I would just like to know for sure.  I would also like to know what I'm doing wrong in Blend that I can't extract the style like I want.  Anyway, adding that control template to my solution gets rid of my orange color on the RadListBox.  But it is also showing up on my RadPropertyGrid and on the tabs of my RadDock control. Will I need to do the same template manipulation for them or is there something I can do globally at the theme level?  I'm rather new to WPF and XAML so apologies if that is obvious.

 

Thanks,

Chris

0
Martin
Telerik team
answered on 24 Aug 2016, 10:33 AM
Hi Chris,

The one way to get the template is through Blend or through VS's Designer. You can find an explanation for this in the following articles from our documentation - for Blend (although it is for an older version) and for VisualStudio, and the other way is to find the template in the generated XAML for the concrete theme.

From the gif you have attached I can see that you are probably using XAML and NoXaml assemblies and that is why you are seeing orange and gradient elements (they come from the default Office Black theme) (and extracting the templates might not work properly as well). Office2013 theme works only with noXAML assemblies, so you can include them instead, as well as the theme assembly, and merge the resource dictionaries in your App.xaml. You can find explanation of the Implicit styles theming mechanism (noXAML) in the following article. This will eliminate any orange elements, since the default Office2013 appearance is mainly in blue.

However, what I understand from your follow-up message is that you would like to change the similar visual elements globally for the whole theme. Here is the brief article for the Office2013 theme where its resources and palette are explained.

Finally, I can propose you try our ColorThemeGenerator which is created for changing globally the brushes for the newer themes. There you can modify the brushes for Office2013 and see the changes instantly.

Regards,
Martin
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Chris
Top achievements
Rank 1
answered on 24 Aug 2016, 02:32 PM

Thanks Martin!  Excellent info especially regarding the XAML/noXAML assemblies.  I didn't realize I should be using noXAML assemblies for the Office2013 theme.  I will dig into your response further and reply back once I have something more to share.

Regards,

Chris

Tags
ListBox
Asked by
Chris
Top achievements
Rank 1
Answers by
Chris
Top achievements
Rank 1
Martin
Telerik team
Share this question
or