custom property for setting pane

2 posts, 0 answers
  1. Gabi
    Gabi avatar
    7 posts
    Member since:
    Jun 2011

    Posted 10 Jan 2013 Link to this post


    i want to create custom shapes like textbox, grid etc.., and allof them will have custom property.
    Till now i am able to create few shapes with one property, but i am not getting exact approach to execute that operation.
    Please guide me from where i can get a sample application to create custom shapes with large no. of custom property and each control is used as an object while being drag and drop from listbox to raddiagram.

  2. Francois Vanderseypen
    Francois Vanderseypen avatar
    46 posts
    Member since:
    Oct 2009

    Posted 10 Jan 2013 Link to this post


    the financial dashboard contained within the official samples (which was orginally published as an article here) boasts quite a few custom shapes which host a datagrid, a pie chart, gauges and more. I'd think this sample should get you going. 
    Regarding the properties, you simply add standard or dependency properties as you wish. To add a custom shape you'd code something like;

    var shape = new YourCustomShape();

    If you use a shape library and dragdrop from a toolbox onto the diagram surface you can check the ItemsChanged event and then detect the type of the shape. If it's a custom shape (or even better, if you implemented an interface) you can then cast to the custom type and access all your (custom) properties.

    Hope this helps, Fr.
Back to Top