RadRibbonButton and vector image

5 posts, 0 answers
  1. Patrick
    Patrick avatar
    382 posts
    Member since:
    Aug 2012

    Posted 12 May Link to this post

    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?

  2. Martin Ivanov
    Admin
    Martin Ivanov avatar
    1410 posts

    Posted 16 May Link to this post

    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.
  3. Patrick
    Patrick avatar
    382 posts
    Member since:
    Aug 2012

    Posted 16 May in reply to Martin Ivanov Link to this post

    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.

  4. Patrick
    Patrick avatar
    382 posts
    Member since:
    Aug 2012

    Posted 16 May in reply to Martin Ivanov Link to this post

    Hi Martin,

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

  5. Martin Ivanov
    Admin
    Martin Ivanov avatar
    1410 posts

    Posted 19 May Link to this post

    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.
Back to Top