The DiagramSurface type exposes the following members.

Constructors

  NameDescription
DiagramSurface
Initializes a new instance of the DiagramSurface class.

Methods

  NameDescription
ApplyLayoutAlgorithm
Applies the given layout algorithm to the diagram, re-formats all the connections and takes a snapshot for undo/redo integration.
CancelLastSnapshot
Cancels the last snapshot that was taken so that it is ignored by the undo command.
ClearDirty
Clears the IsDirty flag. Call this method when saving the diagram.
FindConnectionElement
Returns the DiagramConnectionElement that represents the visual for the given IDiagramConnection. This method returns null if no such DiagramConnectionElement can be found.
FindElementAtPoint
Returns the DiagramElement that interescts with the given Point. This could be a DiagramNodeElement or a DiagramConnectionElement. Returns null if there is no DiagramElement at the given point.
FindMouseOverElement
Returns the DiagramElement that the mouse is currently over. This could be a DiagramNodeElement or a DiagramConnectionElement. Returns null if the mouse is not currently over any DiagramElement.
FindNodeElement
Returns the DiagramNodeElement that represents the visual for the given IDiagramNode. This method returns null if no such DiagramNodeElement can be found.
GetLogicalBounds
Gets the diagram model bounds corresponding to a rectangle on the display (in control coordinates). This method is used to compensate for the effects of zooming and scrolling on a DiagramSurface.
GetMousePosition
Returns a Point reflecting the position of the mouse pointer relative to the (0, 0) coordinate on this DiagramSurface.
GetPhysicalBounds
Gets the display rectangle (in control coordinates) corresponding to a region of the diagram model. This method is used to compensate for the effects of zooming and scrolling on a DiagramSurface.
GetViewport
Gets the viewport (the part of the diagram which is visible).
InstallLicense
Performs manual licensing for specialized deployment scenarios.
OnApplyTemplate
Called by the framework when a template is applied to the control.
(Overrides FrameworkElement..::.OnApplyTemplate()()().)
OnKeyDown
Called when a key is pressed while this DiagramSurface has focus.
(Overrides UIElement..::.OnKeyDown(KeyEventArgs).)
OnKeyUp
Called when a key is released while this DiagramSurface has focus.
(Overrides UIElement..::.OnKeyUp(KeyEventArgs).)
OnMouseDown
Invoked when an unhandled Mouse.MouseDown attached event reaches an element in its route that is derived from this class.
(Overrides UIElement..::.OnMouseDown(MouseButtonEventArgs).)
OnMouseMove
Invoked when an unhandled Mouse.MouseUp attached event reaches an element in its route that is derived from this class.
(Overrides UIElement..::.OnMouseMove(MouseEventArgs).)
OnMouseUp
Invoked when an unhandled Mouse.MouseUp attached event reaches an element in its route that is derived from this class.
(Overrides UIElement..::.OnMouseUp(MouseButtonEventArgs).)
ResetUndo
Resets the undo feature by clearing all the snapshots that have been made up to now.
SetDirty
Marks the diagram as dirty (having changed).
SetViewport
Sets the viewport (the part of the diagram which is visible).
SizeToFit
Sets the viewport of the ScrollViewer to fit the entire diagram of this DiagramSurface.
TakeSnapshot
Saves the current state of the diagram that this DiagramSurface is displaying. This saved state is used for undo purposes. This method should be called AFTER an action has modified the DiagramSurface.

Fields

  NameDescription
AllowNodeCollisionsProperty
Identifies the AllowNodeCollisions property.
AllowSegmentToNodeCollisionsProperty
Identifies the AllowSegmentToNodeCollisions property.
CanAddOrRemoveNodesProperty
Identifies the CanAddOrRemoveNodes property.
CanConnectToConnectionsProperty
Identifies the CanConnectToConnections property.
CanModifyConnectionContentProperty
Identifies the CanModifyConnectionContent property.
CanModifyConnectivityProperty
Identifies the CanModifyConnectivity property.
CanModifyNodeContentProperty
Identifies the CanModifyNodeContent property.
CanRotateNodesProperty
Identifies the CanRotateNodes property.
CollisionBufferProperty
Identifies the CollisionBuffer property.
DefaultCreateConnectionLineStyleProperty
Identifies the DefaultCreateConnectionLineStyle property.
DiagramElementsProperty
Identifies the DiagramElements property.
DiagramProperty
Identifies the Diagram property.
DragActionProperty
Identifies the DragAction property.
ElementFactoryProperty
Identifies the ElementFactory property.
FormatterProperty
Identifies the Formatter property.
HorizontalScrollBarVisibilityProperty
Identifies the HorizontalScrollBarVisibility property.
HorizontalSnapSpecifierProperty
Identifies the HorizontalSnapSpecifier property.
IsDirtyProperty
Identifies the IsDirty property.
IsReadOnlyProperty
Identifies the IsReadOnly property.
IsSmartScrollingEnabledProperty
Identifies the IsSmartScrollingEnabled property.
MarqueeDragCompletedEvent
Identifies the MarqueeDragCompleted routed event.
MarqueeDragStartedEvent
Identifies the MarqueeDragStarted routed event.
MarqueeStyleProperty
Identifies the MarqueeStyle property.
OverflowBehaviorProperty
Identifies the OverflowBehavior property.
ReadOnlyCanSelectProperty
Identifies the ReadOnlyCanSelect property.
ScrollViewerProperty
Identifies the ScrollViewer property.
SelectedElementProperty
Identifies the SelectedElement property.
SelectedElementsProperty
Identifies the SelectedElements property.
SelectedItemProperty
Identifies the SelectedItem property.
SelectedItemsProperty
Identifies the SelectedItems property.
SelectionModeProperty
Identifies the SelectionMode property.
ShowConnectionPointsProperty
Identifies the ShowConnectionPoints property.
SnapLineDrawingProperty
Identifies the SnapLineDrawing property.
VerticalScrollBarVisibilityProperty
Identifies the VerticalScrollBarVisibility property.
VerticalSnapSpecifierProperty
Identifies the VerticalSnapSpecifier property.
ZoomModeProperty
Identifies the ZoomMode property.
ZoomProperty
Identifies the Zoom property.

Properties

  NameDescription
AllowNodeCollisions
Gets or sets whether this DiagramSurface should detect and manage collisions between two IDiagramNode objects. If this property is set to true, then collisions will be ignored.
AllowSegmentToNodeCollisions
Gets or sets whether this DiagramSurface should detect and manage collisions between DiagramConnectionSegment objects and DiagramNodeElement objects. If this property is set to true, then collisions will be ignored. Note that if this property is set to true, collisions still can not occur with a segment and the node that it is directly connected to.
CanAddOrRemoveNodes
Gets or sets if diagram nodes can be added or removed from the diagram of this DiagramSurface. The default is true. This is a dependency property.
CanConnectToConnections
Gets or sets whether or not connections are allowed to be connected to other connections from the time this property is set.
CanModifyConnectionContent
Gets or sets if the content of a connection within this DiagramSurface can be changed or not. The default is true; This is a dependency property.
CanModifyConnectivity
Gets or sets if connections can be relocated, added or removed from the diagram of this DiagramSurface. The default is true; This is a dependency property.
CanModifyNodeContent
Gets or sets if the content of a node within this DiagramSurface can be changed or not. The default is true; This is a dependency property.
CanRotateNodes
Gets or sets whether or not diagram nodes can be rotated. The default is false. This is a dependency property.
CollisionBuffer
Gets or sets the minimum distance between nodes and connection segments. This is a dependency property.
ConnectionElements
Gets all the DiagramConnectionElement objects displayed on this DiagramSurface.
DefaultCreateConnectionLineStyle
Gets or sets the Style used when the user drags to create a connection, if no DiagramConnectionTool is selected or the tool does not specify its own style. This is a dependency property.
DefaultMarqueeStyleKey
Gets the ResourceKey for the default Style used for drawing marquee selection rectangles.
Diagram
Gets or sets the diagram to be displayed. This is a dependency property.
DiagramBounds
Gets the bounding Rect of this DiagramSurface. This such rectangle is the smallest rectangle that fits all of the diagram elements in this DiagramSurface.
DiagramElements
Gets the collection of DiagramElement objects displayed on this DiagramSurface. This collection is sorted based on the ZIndex of the elements. This is a dependency property.
DragAction
Gets or sets the DiagramSurfaceDragAction to determine the behaviour of dragging the DiagramSurface. This is a dependency property.
ElementFactory
Gets or sets the IDiagramElementFactory used to construct DiagramElement objects for custom items. This must be populated if the diagram model contains custom items; it is ignored if the diagram model does not contain custom items. This is a dependency property.
Formatter
Gets or sets formatting and display settings for the diagram. This is a dependency property.
HorizontalOffset
Gets the HorizontalOffset property of the DiagramScrollViewer of this DiagramSurface. If the scroll viewer is null, then 0 is returned.
HorizontalScrollBarVisibility
Gets or sets the HorizontalScrollBarVisibility. The default is ScrollBarVisibility.Visible. This is a dependency property.
HorizontalSnapSpecifier
Gets or sets horizontal snapping for mouse dragging of nodes. This is a dependency property.
IsDirty
Gets or sets whether or not a change has been made to this DiagramSurface since the last time the diagram was saved. This is a dependency property.
IsReadOnly
Gets or sets whether the diagram display is read-only (cannot be modified by the user). This is a dependency property.
IsSmartScrollingEnabled
Gets or sets whether or not this DiagramSurface uses smart scrolling. Smart scrolling allows the viewport of the DiagramScrollViewer to be dynamically updated when an element is moved or sized of the screen. This is a dependency property.
MarqueeStyle
Gets or sets the Style applied to marquee selection rectangles. This is a dependency property.
NodeElements
Gets all the DiagramNodeElement objects displayed on this DiagramSurface.
OverflowBehavior
Gets or sets the overflow behavior. This is a dependency property.
PrintStyleKey
Gets the ResourceKey for the Style for formatting a DiagramSurface for printing.
ReadOnlyCanSelect
Gets or sets whether diagram elements can still be selected in read-only mode. The default is false. This is a dependency property.
ScrollViewer
Gets the DiagramScrollViewer used for scrolling the diagram view. This is a dependency property.
SelectedElement
Gets or sets the selected DiagramElement (node or connection). This is a dependency property.
SelectedElements
Gets the collection of selected elements. This is a dependency property.
SelectedItem
Gets or sets the selected diagram model item (IDiagramNode or IDiagramConnection. This is a dependency property.
SelectedItems
Gets the collection of selected diagram model items. This is a dependency property.
SelectionMode
Gets or sets the selection behavior for a DiagramSurface. The default is Single selection. This is a dependency property.
ShowConnectionPoints
Gets or sets whether to show connection points. This is a dependency property.
SnapLineDrawing
Gets or sets the method used to draw snap lines. This is a dependency property.
VerticalOffset
Gets the VerticalOffset property of the DiagramScrollViewer of this DiagramSurface. If the scroll viewer is null, then 0 is returned.
VerticalScrollBarVisibility
Gets or sets the VerticalScrollBarVisibility. The default is ScrollBarVisibility.Visible. This is a dependency property.
VerticalSnapSpecifier
Gets or sets the vertical snapping for mouse dragging of nodes. This is a dependency property.
Zoom
Gets or sets the zoom factor. This is a dependency property.
ZoomMode
Gets or sets built-in zooming behavior. This is a dependency property.

Events

  NameDescription
MarqueeDragCompleted
Occurs when a marquee drag is completed.
MarqueeDragStarted
Occurs when a marquee drag has begun.
SelectedElementChanged
Raised whenever the SelectedElement property of this DiagramSurface changes.
SelectedElementsChanged
Raised when the SelectedElements property changes.

See Also