Gets or sets the default shape of shape nodes.
Namespace: MindFusion.Diagramming
Assembly: MindFusion.Diagramming.Silverlight
C# Copy Code |
---|
public Shape DefaultShape { get; set; } |
Visual Basic Copy Code |
---|
Public Property DefaultShape As Shape |
The Shape property of newly created shape nodes is initialized with the value of this property. It defines a series of lines, arcs and curves composed in a complex shape. There are 87 predefined shapes exposed as static members of the Shape class. You can also define your own shapes as shown below.
The following example demonstrates how to create a custom shape and set it as a default in the diagram:
C# Copy Code |
---|
private void example_Click(object sender, RoutedEventArgs e) { // Define a custom shape // this is the same as: fc.DefaultShape = Shape.FromId("Tape"); diagram.DefaultShape = new Shape( new ElementTemplate[] { new LineTemplate(50, 100, 85, 100), new LineTemplate(85, 100, 85, 90), new LineTemplate(85, 90, 70, 90), new BezierTemplate(70, 90, 85, 90, 100, 75, 100, 50), new BezierTemplate(100, 50, 100, 25, 75, 0, 50, 0), new BezierTemplate(50, 0, 25, 0, 0, 25, 0, 50), new BezierTemplate(0, 50, 0, 75, 25, 100, 50, 100) }, FillRule.EvenOdd); } |
Visual Basic Copy Code |
---|
Private Sub example_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles example.Click ' Define a custom shape End Sub |