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

custom property for setting pane

1 Answer 56 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Jeremy
Top achievements
Rank 1
Jeremy asked on 10 Jan 2013, 12:46 PM
Hi,

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.

Thanks

1 Answer, 1 is accepted

Sort by
0
Francois Vanderseypen
Top achievements
Rank 2
answered on 10 Jan 2013, 01:12 PM
Gabi,

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();
diagram.AddShape(shape);

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.
Tags
Diagram
Asked by
Jeremy
Top achievements
Rank 1
Answers by
Francois Vanderseypen
Top achievements
Rank 2
Share this question
or