Each new item, created either by the user or programmatically, is initialized with some kind of default property values.
If you create items by using the new operator and adding them the diagram's Nodes or Links collection, you can initialize the items by passing a Diagram reference to the respective constructor, or by passing another item to the copy constructor. In the former case, item properties are initialized from the default-property values defined in Diagram. In the latter case, properties are copied from the prototype item.
When users draw new items, the items are initialized from the Diagram properties, but you can change the default values by handling the InitializeNode and InitializeLink events.
Items created via the diagram's Factory object are always initialized from the default-property values defined in Diagram.
Below are listed item properties and the corresponding constants or Diagram properties through which they are initialized.
Note that some properties in the tables below are marked as styled. Styled properties usually default to null (Nothing in Visual Basic), unless the item is created through the prototype constructor, in which case the values of the styled properties are obtained from the prototype item. When a style property is null, its effective value is determined by the style associated with the item or the theme applied to the diagram. For more information on how the style system works, check Styles and Themes.
DiagramItem Property | Initialized With |
---|---|
Brush (styled) | null (affected by Brush of the corresponding DiagramItemStyle) |
false | |
Font (styled) | null (affected by FontFamily, FontSize, FontStyle, and FontUnit of the corresponding DiagramItemStyle) |
Pen (styled) | null (affected by Stroke and StrokeThickness of the corresponding DiagramItemStyle) |
ShadowBrush (styled) | null (affected by ShadowBrush of the corresponding DiagramItemStyle) |
null | |
TextBrush (styled) | null (affected by TextBrush of the corresponding DiagramItemStyle) |
(empty string) | |
true |
ShapeNode Property | Initialized With |
---|---|
null | |
false |
ContainerNode Property | Initialized With |
---|---|
false | |
CaptionBrush (styled) | null (affected by TextBrush of the corresponding DiagramItemStyle) |
false | |
TableNode Property | Initialized With |
---|---|
CaptionBrush (styled) | null (affected by TextBrush of the associated TableNodeStyle) |
Centered horizontal and vertical alignment | |
null | |
DiagramLink Property | Initialized With |
---|---|
HeadPen (styled) | null (affected by HeadStroke and HeadStrokeThickness of the associated DiagramLinkStyle) |