With the introduction of the new style system, the following default-value properties in the Diagram class are considered obsolete and will no longer have any effect on newly created items:
To provide the same functionality as those properties did before, use a Theme object with styles associated with the appropriate diagram item types. For example, to provide default pen for shape nodes, use the following code:
C# Copy Code |
---|
ShapeNodeStyle defaultStyle = new ShapeNodeStyle(); |
Visual Basic Copy Code |
---|
Dim defaultStyle As New ShapeNodeStyle() |
For convenience, the CreateThemeFromDefaults method of the Diagram class can create this Theme object from the diagram's current default values.
Alternatively, you can set the default values through a set of shortcut properties in the Diagram class. These shortcut properties create a Theme object internally, register the appropriate classes and assign the theme to the diagram. The following table illustrates this.
Important! |
---|
The Font, Brush, and Pen properties of diagram items are no longer guaranteed to be non-null. In fact their default value is now null, so replace these properties with their EffectiveFont, EffectiveBrush, and EffectivePen counterparts. |