How to changed name of the shapes

2 posts, 0 answers
  1. Frank
    Frank avatar
    28 posts
    Member since:
    May 2006

    Posted 14 Jan 2019 Link to this post

    Hi,

    I'm trying to change the names of the shapes I show inside the image editor tool but I can not get my head arround it how to do it.

    I want to change the text of the shape rectangle and ellipse.

    How to approach this problem?

    Best regards.

  2. Dinko
    Admin
    Dinko avatar
    1028 posts

    Posted 17 Jan 2019 Link to this post

    Hi Frank,

    Thank you for the provided images.

    The shapes of the ShapeTool does not provide out of the box way to change its name in the combo box. What I can suggest you to workaround this is to create a custom class which derives from the desired shapes and specifies a custom property.
    public class MyEllipse : EllipseShape
    {
        public string Name { get; set; }
        public MyEllipse()
        {
            Name = "Custom Name";
        }
    }

    Then you can extract and modify the template of the ShapeToolSettings element. In the template you can navigate to a RadComboBox element with x:Name PART_ShapeComboBox and change the DisplayMemberPath property.

    I have created a sample project which demonstrates this behavior. Before running the project set your image path in code behind.


    Regards,
    Dinko
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top