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

RadRibbonButton and vector image

4 Answers 202 Views
RibbonView and RibbonWindow
This is a migrated thread and some comments may be shown as answers.
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
Patrick asked on 12 May 2017, 09:47 AM

Hello,

With the advent of high-resolution monitors, it becomes very interesting to use vector images for the content of the buttons.

I've read an old forum thread when you said that we can set the content of the button to the vector image. It works weill for normal buttons but not for ribbon buttons: when the button is minimized, it disappeared! Surely because it is using the SmallIcon property, that is empty in this case.

Do you plan to introduce this feature in the near future?

4 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 16 May 2017, 03:27 PM
Hello Patrick,

Currently, there are no plans to introduce such feature. To achieve your requirement you can create a custom button that derives from RadRibbonButton. I prepared an example demonstrating such approach. I hope this helps.

Regards,
Martin Ivanov
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
answered on 16 May 2017, 03:42 PM

Hi Martin,

Thanks for the example code.

The problem I see is that it uses a custom template, So I need to:

  1. make a custom template for each theme I support.
  2. make the custom templates for RadRibbonButton, RadRibbonToggleButton, RadRibbonRadioButton, RadRibbonDropDownButton and RadRibbonSplitButton.
  3. check all this custom templates each time a new version of UI for WPF is out.

So this make 15 themes * 5 buttons, so 75 templates to make and check!!!!!

That's too much work for just this.

Don't forget that each developper that wants to implement this feature should also do the same. If Telerik corrects its code to support this, nobody else has to do this huge work.

0
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
answered on 16 May 2017, 03:50 PM

Hi Martin,

I've corrected the references to the Telerik assemblies in the project and run it: the main window is empty.

0
Martin Ivanov
Telerik team
answered on 19 May 2017, 12:29 PM
Hello Patrick,

The empty window is probably caused if the referenced Telerik assemblies are NoXaml. In this case you will also need to merge the resource dictionaries with the theme styles, and also define an implicit style for the custom button

The approach in the project could be utilized for a code-behind scenario. In this case you won't need to create and maintain many styles (one for each theme). I updated my last project to demonstrate this. I hope it helps.

About your feedback, thank you for sharing this with us. We agree that the suggested approach is not very convenient. At this point, we won't be able to change the ribbon buttons current icon API to work also with WPF Path elements without introducing a breaking change for other users. However, we will consider some kind of new API that allows you to this.

Regards,
Martin Ivanov
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
RibbonView and RibbonWindow
Asked by
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Martin Ivanov
Telerik team
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
Share this question
or