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

How to changed name of the shapes

1 Answer 76 Views
ImageEditor
This is a migrated thread and some comments may be shown as answers.
Frank
Top achievements
Rank 1
Frank asked on 14 Jan 2019, 02:53 PM

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.

1 Answer, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 17 Jan 2019, 09:54 AM
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.
Tags
ImageEditor
Asked by
Frank
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or