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

Creating a 'canvas' with specific dimensions

1 Answer 94 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Joel
Top achievements
Rank 1
Joel asked on 15 Mar 2013, 09:16 PM
Hello,

Is it possible to create a 'canvas' with specific dimensions?

For example, on one of your Diagram examples you have a 'New' button. I want the user to be able to press a 'New' button and then be presented with a pop-up asking for the 'canvas' size. When the user enters a valid canvas size and clicks 'Ok' a new 'canvas' would be created with the specified size, in a docakble panel, the user would then be unable to 'draw' outside of this canvas. 

Cheers,
Joel. 

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 20 Mar 2013, 01:28 PM
Hi Joel,

 Actually our Diagram has Canvas in its ControlTemplate. So I guess setting Width and Height and then creating (if required) a new Diagram with this size is ok for you. If you need to restrict the Shapes from moving them outside this canvas, you can see how this is implemented in our Custom Services Demo in our new XAML SDK in GitHub. We hope you will find it useful.

Regards,
Petar Mladenov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Diagram
Asked by
Joel
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or