Creating a 'canvas' with specific dimensions

2 posts, 0 answers
  1. Joel
    Joel avatar
    2 posts
    Member since:
    Mar 2013

    Posted 15 Mar 2013 Link to this post


    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. 


  2. Petar Mladenov
    Petar Mladenov avatar
    2991 posts

    Posted 20 Mar 2013 Link to this post

    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.

    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top