ClassRadDiagram
Represents a powerful diagramming control that allows visualization and editing of diagrams, flowcharts, organizational charts, and other visual graph structures. Provides functionality for creating, connecting, and manipulating shapes within a canvas.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.RadDiagram.dll
Syntax:
[TelerikToolboxCategory("Diagram")]
[ComplexBindingProperties("DataSource")]
public class RadDiagram : RadControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IAnalyticsProvider, IPrintable
Inheritance: objectMarshalByRefObjectComponentControlScrollableControlRadControlRadDiagram
Implements:
Inherited Members
Constructors
RadDiagram()
Initializes a new instance of the RadDiagram class. Sets up the control with default settings and enables gesture support.
Declaration
public RadDiagram()
Properties
ActiveTool
Gets or sets the tool which is active when interacting with the diagram elements.
AllowCopy
Gets or sets a value indicating whether copying is allowed.
Declaration
public bool AllowCopy { get; set; }
Property Value
True if copying is allowed; otherwise, false.
AllowCut
Gets or sets a value indicating whether cutting is allowed.
Declaration
public bool AllowCut { get; set; }
Property Value
True if cutting is allowed; otherwise, false.
AllowDelete
Gets or sets a value indicating whether deleting is allowed.
Declaration
public bool AllowDelete { get; set; }
Property Value
True if deleting is allowed; otherwise, false.
AllowPaste
Gets or sets a value indicating whether pasting is allowed.
Declaration
public bool AllowPaste { get; set; }
Property Value
True if pasting is allowed; otherwise, false.
AutoLayout
Gets or sets the auto layout.
BackgroundGrid
Declaration
public virtual BackgroundGrid BackgroundGrid { get; }
Property Value
BackgroundPageGrid
Declaration
public virtual BackgroundPageGrid BackgroundPageGrid { get; }
Property Value
ConnectionBridge
Gets or sets the connection bridge type.
Declaration
public BridgeType ConnectionBridge { get; set; }
Property Value
ConnectionDataMember
Gets or sets the links data member.
Declaration
[Browsable(true)]
public string ConnectionDataMember { get; set; }
Property Value
The data member.
ConnectionRoundedCorners
Gets or sets whether the corners of the (polyline) connection are rounded.
Declaration
public bool ConnectionRoundedCorners { get; set; }
Property Value
Remarks
This property has only an effect when the ConnectionType is set to Polyline.
ConnectionSourceCapTypeMember
Gets or sets the ConnectionSourceCapTypeMember data member.
Declaration
[Browsable(true)]
public string ConnectionSourceCapTypeMember { get; set; }
Property Value
The data member.
ConnectionSourceConnectorMember
Gets or sets the SourceConnector data member.
Declaration
[Browsable(true)]
public string ConnectionSourceConnectorMember { get; set; }
Property Value
The data member.
ConnectionSourceShapeIdMember
Gets or sets the ConnectionTargetShapeIdMember data member.
Declaration
[Browsable(true)]
public string ConnectionSourceShapeIdMember { get; set; }
Property Value
The data member.
ConnectionTargetCapTypeMember
Gets or sets the ConnectionTargetCapTypeMember data member.
Declaration
[Browsable(true)]
public string ConnectionTargetCapTypeMember { get; set; }
Property Value
The data member.
ConnectionTargetConnectorMember
Gets or sets the Target connector data member.
Declaration
[Browsable(true)]
public string ConnectionTargetConnectorMember { get; set; }
Property Value
The data member.
ConnectionTargetShapeIdMember
Gets or sets the ConnectionTargetShapeIdMember data member.
Declaration
[Browsable(true)]
public string ConnectionTargetShapeIdMember { get; set; }
Property Value
The data member.
ConnectionTextMember
Gets or sets the ConnectionTextMember data member.
Declaration
[Browsable(true)]
public string ConnectionTextMember { get; set; }
Property Value
The data member.
Connections
Gets the connections.
Declaration
[Browsable(false)]
public ConnectionCollection Connections { get; }
Property Value
ContainerGenerator
Gets the container generator.
Declaration
public IContainerGenerator<RadDiagramItem> ContainerGenerator { get; }
Property Value
DataSource
Gets or sets the data source of the RadDiagram.
DefaultSize
Gets the default size of the RadDiagram control.
DiagramElement
Declaration
public RadDiagramElement DiagramElement { get; set; }
Property Value
DisplayMemberPath
Gets or sets the display member path.
Declaration
public string DisplayMemberPath { get; set; }
Property Value
The display member path.
GraphSource
Gets or sets the graph source.
Declaration
public IGraphSource GraphSource { get; set; }
Property Value
The graph source.
Groups
Gets the group collection.
Declaration
[Browsable(false)]
public IEnumerable<IGroup> Groups { get; }
Property Value
IEnumerable<IGroup>
HorizontalScrollbarVisibility
Declaration
public ScrollBarVisibility HorizontalScrollbarVisibility { get; set; }
Property Value
IsBackgroundSurfaceVisible
Gets or sets whether the background grid is visible.
Declaration
public bool IsBackgroundSurfaceVisible { get; set; }
Property Value
IsConnectorsManipulationEnabled
Gets or sets a value indicating whether manipulation on the connectors is enabled.
Declaration
public bool IsConnectorsManipulationEnabled { get; set; }
Property Value
True if manipulation on connectors is enabled; otherwise, false.
IsDataBound
Gets a value indicating whether this instance is data bound.
Declaration
[Browsable(false)]
public bool IsDataBound { get; }
Property Value
true if this instance is data bound; otherwise, false.
IsDraggingEnabled
Gets or sets a value indicating whether dragging is enabled.
Declaration
public bool IsDraggingEnabled { get; set; }
Property Value
True if dragging is enabled; otherwise, false.
IsEditable
Gets or sets a value indicating whether editing is enabled.
Declaration
public bool IsEditable { get; set; }
Property Value
True if editing is enabled; otherwise, false.
IsInformationAdornerVisible
Gets or sets whether the information adorner is visible.
Declaration
public bool IsInformationAdornerVisible { get; set; }
Property Value
IsManipulationAdornerVisible
Gets or sets a value indicating whether the manipulation adorner is visible.
Declaration
public bool IsManipulationAdornerVisible { get; set; }
Property Value
True if the manipulation adorner is visible; otherwise, false.
IsMouseCaptured
Gets or sets a value indicating whether the mouse is captured.
Declaration
public bool IsMouseCaptured { get; set; }
Property Value
True if the mouse is captured; otherwise, false.
IsPanEnabled
Gets or sets a value indicating whether panning is enabled.
Declaration
public bool IsPanEnabled { get; set; }
Property Value
True if panning is enabled; otherwise, false.
IsResizingEnabled
Gets or sets a value indicating whether resizing is enabled.
Declaration
public bool IsResizingEnabled { get; set; }
Property Value
True if resizing is enabled; otherwise, false.
IsRotationEnabled
Gets or sets a value indicating whether rotation is enabled.
Declaration
public bool IsRotationEnabled { get; set; }
Property Value
true if this rotation is enabled; otherwise, false.
IsSettingsPaneEnabled
Hide or Show the Settings pane button.
IsSnapToGridEnabled
Gets or sets a value indicating whether grid snapping is enabled.
Declaration
public bool IsSnapToGridEnabled { get; set; }
Property Value
True if grid snapping is enabled; otherwise, false.
IsSnapToItemsEnabled
Gets or sets a value indicating whether snapping of selected item(s) to the other items in the view port is enabled or not.
IsZoomEnabled
Gets or sets a value indicating whether zooming is enabled.
Declaration
public bool IsZoomEnabled { get; set; }
Property Value
True if zooming is enabled; otherwise, false.
Items
Gets or sets the diagramming items.
Declaration
[Browsable(false)]
public DiagramItemCollection Items { get; }
Property Value
The items.
Metadata
Gets the diagram metadata.
Declaration
[Browsable(false)]
public DiagramMetadata Metadata { get; }
Property Value
Position
Gets or sets the position.
Declaration
public Point Position { get; set; }
Property Value
; The position.
RectSelectionMode
Gets or sets the rectangle selection mode.
Declaration
public RectSelectionMode RectSelectionMode { get; set; }
Property Value
RouteConnections
Declaration
public bool RouteConnections { get; set; }
Property Value
Remarks
Setting this property has no effect on other connection types.
RoutingService
Declaration
public IRoutingService RoutingService { get; }
Property Value
SelectedIndex
Gets or sets the index of the first item in the current selection or returns negative one (-1) if the selection is empty.
SelectedItem
Gets or sets the first item in the current selection or returns null if the selection is empty. This is a dependency property.
SelectedItems
Gets the selected items.
Declaration
public IEnumerable<IDiagramItem> SelectedItems { get; }
Property Value
IEnumerable<IDiagramItem>
SelectionBounds
Gets the starting selection bounds.
SelectionMode
Gets or sets the selection mode.
Declaration
public SelectionMode SelectionMode { get; set; }
Property Value
ServiceLocator
Gets the service locator.
Declaration
public IServiceLocator ServiceLocator { get; }
Property Value
ShapeDataMember
Gets or sets the links data member.
Declaration
[Browsable(true)]
public string ShapeDataMember { get; set; }
Property Value
The data member.
ShapeHeightMember
Gets or sets the Shape height data member.
Declaration
[Browsable(true)]
public string ShapeHeightMember { get; set; }
Property Value
The data member.
ShapeIdMember
Gets or sets the ID data member.
Declaration
[Browsable(true)]
public string ShapeIdMember { get; set; }
Property Value
The data member.
ShapeTextMember
Gets or sets the links data member.
Declaration
[Browsable(true)]
public string ShapeTextMember { get; set; }
Property Value
The data member.
ShapeTypeMember
Gets or sets the Shape data member.
Declaration
[Browsable(true)]
public string ShapeTypeMember { get; set; }
Property Value
The data member.
ShapeWidthMember
Gets or sets the Shape height data member.
Declaration
[Browsable(true)]
public string ShapeWidthMember { get; set; }
Property Value
The data member.
ShapeXMember
Gets or sets the Shape X position data member.
Declaration
[Browsable(true)]
public string ShapeXMember { get; set; }
Property Value
The data member.
ShapeYMember
Gets or sets the Shape Y position data member.
Declaration
[Browsable(true)]
public string ShapeYMember { get; set; }
Property Value
The data member.
Shapes
Gets the shapes.
Declaration
[Browsable(false)]
public ShapeCollection Shapes { get; }
Property Value
SnapX
Gets or sets the horizontal snapping distance.
Declaration
public int SnapX { get; set; }
Property Value
The horizontal snapping distance.
SnapY
Gets or sets the vertical snapping distance.
Declaration
public int SnapY { get; set; }
Property Value
The vertical snapping distance.
UndoRedoService
Gets the undo redo service.
Declaration
public IUndoRedoService UndoRedoService { get; }
Property Value
VerticalScrollbarVisibility
Declaration
public ScrollBarVisibility VerticalScrollbarVisibility { get; set; }
Property Value
Viewport
Gets the bounds of the viewport.
Zoom
Gets or sets the zoom. A zoom value of 1 means 100% and less then 1 means a zoom out. Zoom value will be coerced to be greater than zero, not infinity and not Nan. In addition, Zoom value will be coerced to be greater or equal than MinimumZoom and smaller or equal than MaximumZoom.
Methods
AddConnection(IConnection, bool)
Adds a new connection to the diagram.
Declaration
public IConnection AddConnection(IConnection connection, bool isUndoable = false)
Parameters
connection
The connection to be added.
isUndoable
If set to true this action will be recorded in the undo stack.
Returns
AddConnection(IShape, IShape, bool)
Adds a new connection to the diagram connecting the given source and target shapes.
Declaration
public IConnection AddConnection(IShape source, IShape target, bool isUndoable = false)
Parameters
source
The source or start shape of the connection.
target
The target or end shape of the connection.
isUndoable
If set to true this action will be recorded in the undo stack.
Returns
AddConnection(IShape, IShape, string, bool)
Adds a new connection to the diagram connecting the given source and target shapes.
Declaration
public IConnection AddConnection(IShape source, IShape target, string connectorsPosition, bool isUndoable = false)
Parameters
source
The source or start shape of the connection.
target
The target or end shape of the connection.
connectorsPosition
The connectors position.
isUndoable
If set to true this action will be recorded in the undo stack.
Returns
AddConnection(IShape, IShape, string, string, bool)
Adds a new connection to the diagram connecting the given source and target shapes.
Declaration
public IConnection AddConnection(IShape source, IShape target, string sourceConnector, string targetConnector, bool isUndoable = false)
Parameters
source
The source.
target
The target.
sourceConnector
The source connector position.
targetConnector
The target connector position.
isUndoable
If set to true is undoable.
Returns
AddConnection(Point, Point, bool)
Adds a floating connection.
Declaration
public IConnection AddConnection(Point startPoint, Point endPoint, bool isUndoable = false)
Parameters
startPoint
The source (starting) point of the connection.
endPoint
The target (end) point of the connection.
isUndoable
True, if this action is undoable.
Returns
Returns the added connection.
AddGlidingConnection(IShape, IShape, bool)
Adds a new gliding connection to the diagram connecting the given source and target shapes.
Declaration
public IConnection AddGlidingConnection(IShape source, IShape target, bool isUndoable = false)
Parameters
source
The source or start shape of the connection.
target
The target or end shape of the connection.
isUndoable
If set to true this action will be recorded in the undo stack.
Returns
Remarks
If the shape already contains connections on the default connectors this will raise an exception since gliding connections are mutually exclusive with normal connections. Remove first the existing connections on the source and target shapes before calling this method.
AddShape(IShape, Point?, bool)
Adds the given shape to the diagram.
Declaration
public IShape AddShape(IShape shape, Point? position = null, bool isUndoable = false)
Parameters
shape
The shape to add.
position
The position at which the shape will be added on the canvas.
isUndoable
If set to true the action is undoable.
Returns
AddShape(object, Geometry, Point?, bool)
Adds a new shape to the diagram.
Declaration
public IShape AddShape(object content, Geometry geometry = null, Point? position = null, bool isUndoable = false)
Parameters
content
The content of the shape.
geometry
The geometry.
position
The position.
isUndoable
If set to true the action is undoable.
Returns
The added shape.
Remarks
The given object will be inserted as the content of a new RadDiagramShape and will internally uniquely identify the shape. Alternatively, you can instantiate a new shape and use this same AddShape method to add it to the diagram, in which case the shape rather than the content will uniquely identify it internally.
Align(Alignment, IEnumerable<IShape>)
Aligns the given shapes.
BeginBatchTransformation()
Begins a batch transformation and signals the undo-redo stack that a batch of transformation should be considered as one, i.e. a composite change.
Declaration
public DiagramLayoutState BeginBatchTransformation()
Returns
BeginInit()
Suspends layout operations during initialization of the diagram control. Prevents unnecessary updates while multiple properties are being set.
Declaration
public override void BeginInit()
Overrides
BeginPrint(RadPrintDocument, PrintEventArgs)
Called when the printing begins.
Declaration
public int BeginPrint(RadPrintDocument sender, PrintEventArgs args)
Parameters
sender
The that has initiated the printing.
args
The event args.
Returns
The number of pages.
Implements
BringForward(IEnumerable<IDiagramItem>, bool)
Brings the items forward.
Declaration
public void BringForward(IEnumerable<IDiagramItem> items, bool isUndoable = true)
Parameters
items
IEnumerable<IDiagramItem>
isUndoable
BringToFront(IEnumerable<IDiagramItem>, bool)
Brings the items to front.
Declaration
public void BringToFront(IEnumerable<IDiagramItem> items, bool isUndoable = true)
Parameters
items
IEnumerable<IDiagramItem>
isUndoable
Clear()
Clears the diagram and resets the document.
Declaration
public void Clear()
Remarks
The diagram is not saved prior to this reset. You need to handle in the application the eventual necessity to save (or request the user) the diagram before this.
CommitBatchTransformation(DiagramLayoutState, DiagramLayoutState, bool, bool, LayoutType, object)
Commits the batch transformation and ends the composite undo redo change.
Declaration
public void CommitBatchTransformation(DiagramLayoutState initialState, DiagramLayoutState finalState, bool animate = false, bool execute = true, LayoutType type = LayoutType.Sugiyama, object settings = null)
Parameters
initialState
The initial state.
finalState
The final state.
animate
If set to true the layout will be animated.
execute
Whether the undo-redo unit is only added or also executed.
type
The layout type that has been applied.
settings
The layout specific settings used for the layout.
Remarks
The animation tremendously decreases the performance.
Copy()
Copies the currently selected items of the diagram.
Declaration
public void Copy()
CreateChildItems(RadElement)
Creates and initializes the child elements of the RadDiagram control. Initializes and adds the diagram element to the control's element tree.
Declaration
protected override void CreateChildItems(RadElement parent)
Parameters
parent
The parent element that contains the child items.
Overrides
CreateDiagramElement()
Creates a new instance of the RadDiagramElement class that will be used as the main visual element of the diagram control.
Declaration
protected virtual RadDiagramElement CreateDiagramElement()
Returns
A new instance of RadDiagramElement.
Cut()
Cuts the currently selected items of the diagram.
Declaration
public void Cut()
Delete()
Deletes the currently selected items of the diagram.
Declaration
public virtual void Delete()
DeselectAll()
Deselects all shapes in the diagram.
Declaration
public void DeselectAll()
Deserialize(SerializationInfo)
Deserializes the specified info.
Declaration
public virtual void Deserialize(SerializationInfo info)
Parameters
info
The info.
EndInit()
Resumes layout operations after initialization of the diagram control. Updates the diagram element and applies any pending changes.
Declaration
public override void EndInit()
Overrides
EndPrint(RadPrintDocument, PrintEventArgs)
Called when the printing ends.
Declaration
public bool EndPrint(RadPrintDocument sender, PrintEventArgs args)
Parameters
sender
The that has initiated the printing.
args
The event args.
Returns
[false] if cancel
Implements
ExportToImage()
Exports RadDiagram to Image
Declaration
public Image ExportToImage()
Returns
The Image. Should be manually disposed.
ForceRefresh()
Refreshes ScrollBars and Background grids
Declaration
public void ForceRefresh()
GetSettingsDialog(RadPrintDocument)
Gets a print settings dialog that is specific for the printable object.
Declaration
public Form GetSettingsDialog(RadPrintDocument document)
Parameters
document
The that has initiated the printing.
Returns
The dialog.
Implements
Group(string, bool, params IGroupable[])
Groups the specified items.
Declaration
public IGroup Group(string groupName = null, bool isUndoable = false, params IGroupable[] items)
Parameters
groupName
Name of the new group.
isUndoable
If set to true the action will be recorded as undoable.
items
The groups items to ungroup.
Returns
Group(string, params IGroupable[])
Groups the specified items.
Declaration
public IGroup Group(string groupName = null, params IGroupable[] items)
Parameters
groupName
Name of the new group.
items
The groups items to ungroup.
Returns
IsInViewport(IDiagramItem)
Checks if the diagram item is in the viewport.
Declaration
public bool IsInViewport(IDiagramItem item)
Parameters
item
Returns
IsInputKey(Keys)
Determines whether the specified key is an input key or a regular key for the control. Enables arrow keys and shift+arrow key combinations to be handled by the control.
LayoutAsync(LayoutType, object)
Organizes the diagram using the specified layout asynchronously.
Declaration
public void LayoutAsync(LayoutType type = LayoutType.Sugiyama, object settings = null)
Parameters
type
The layout type to apply.
settings
The settings specific to the layout type.
Load(string)
Loads the specified serialization string.
Declaration
public void Load(string serializationValue)
Parameters
serializationValue
The serialization value.
LoadFromFile(string)
Load Diagram to XML file
OnBindingContextChanged(EventArgs)
Raises the BindingContextChanged event and updates the diagram element's binding context. Ensures that binding context changes are propagated to child elements.
OnKeyDown(KeyEventArgs)
Raises the KeyDown event and processes keyboard input for the diagram. Forwards key events to the diagram element for handling, unless a text editor is active.
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
e
A KeyEventArgs that contains the event data.
Overrides
OnMouseDown(MouseEventArgs)
Raises the MouseDown event and handles mouse down interactions for the diagram. Delegates mouse handling to the diagram element's input behavior system.
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
e
A MouseEventArgs that contains the event data.
Overrides
OnMouseMove(MouseEventArgs)
Raises the MouseMove event and handles mouse movement interactions for the diagram. Delegates mouse movement handling to the diagram element's input behavior system.
Declaration
protected override void OnMouseMove(MouseEventArgs e)
Parameters
e
A MouseEventArgs that contains the event data.
Overrides
OnMouseUp(MouseEventArgs)
Raises the MouseUp event and handles mouse release interactions for the diagram. Delegates mouse up handling to the diagram element's input behavior system.
Declaration
protected override void OnMouseUp(MouseEventArgs e)
Parameters
e
A MouseEventArgs that contains the event data.
Overrides
OnPaintBackground(PaintEventArgs)
Raises the paint background event and handles special drawing requirements. Detects changes in the clipping rectangle and triggers a redraw when necessary.
Declaration
protected override void OnPaintBackground(PaintEventArgs e)
Parameters
e
A PaintEventArgs that contains the event data.
Overrides
OnVisibleChanged(EventArgs)
Raises the VisibleChanged event and performs necessary updates when visibility changes. Refreshes the diagram when the control becomes visible.
PanToPosition(Point)
Pans the diagram to the provided position. The values are interpreted in the zoomed coordinate system. This means that panning with 100 pixel will result in visual translation with 100 pixel.
Declaration
public virtual void PanToPosition(Point newPosition)
Parameters
newPosition
The new position coordinates to pan the diagram to.
Paste()
Pastes the content of the clipboard onto the diagram.
Declaration
public virtual void Paste()
Print()
Directly prints the RadDiagram to the default printer.
Declaration
public virtual void Print()
Print(bool)
Directly prints the RadDiagram to the default printer or shows printer settings and then prints the RadDiagram.
Declaration
public virtual void Print(bool showPrinterSettings)
Parameters
showPrinterSettings
Indicates whether printer settings dialog should be shown.
Print(bool, RadPrintDocument)
Directly prints the RadDiagram to the default printer or shows printer settings and then prints the RadDiagram.
Declaration
public virtual void Print(bool showPrinterSettings, RadPrintDocument document)
Parameters
showPrinterSettings
Indicates whether printer settings dialog should be shown.
document
As instance of RadPrintDocument used to control the print process.
PrintPage(int, RadPrintDocument, PrintPageEventArgs)
Prints the page with the specified number.
Declaration
public bool PrintPage(int pageNumber, RadPrintDocument sender, PrintPageEventArgs args)
Parameters
pageNumber
The number of the current page.
sender
The that has initiated the printing.
args
The event args.
Returns
[true] if there are more pages, [false] otherwise
Implements
PrintPreview()
Shows a RadPrintPreviewDialog for editing print settings.
Declaration
public virtual void PrintPreview()
PrintPreview(RadPrintDocument)
Shows a RadPrintPreviewDialog for editing print settings.
Declaration
public virtual void PrintPreview(RadPrintDocument document)
Parameters
document
As instance of RadPrintDocument used to control the print process.
ProcessAutoSizeChanged(bool)
Overrides the base implementation of ProcessAutoSizeChanged. This method is intentionally empty as RadDiagram does not support auto-sizing.
Declaration
protected override void ProcessAutoSizeChanged(bool value)
Parameters
value
A boolean value indicating whether auto-size is enabled.
Overrides
RemoveConnection(IConnection, bool)
Removes the connection.
Declaration
public void RemoveConnection(IConnection connection, bool isUndoable = false)
Parameters
connection
The connection.
isUndoable
If set to true the action is undoable.
RemoveShape(IShape, bool)
Removes the shape.
Save()
Saves the diagram.
SaveToFile(string)
Save Diagram to XML file
SendBackward(IEnumerable<IDiagramItem>, bool)
Sends the items backward.
Declaration
public void SendBackward(IEnumerable<IDiagramItem> items, bool isUndoable = true)
Parameters
items
IEnumerable<IDiagramItem>
isUndoable
SendToBack(IEnumerable<IDiagramItem>, bool)
Sends the items to back.
Declaration
public void SendToBack(IEnumerable<IDiagramItem> items, bool isUndoable = true)
Parameters
items
IEnumerable<IDiagramItem>
isUndoable
Serialize()
Serializes this instance.
Declaration
public virtual SerializationInfo Serialize()
Returns
SetLayout(LayoutType, object)
Organizes the diagram using the specified layout.
Declaration
public void SetLayout(LayoutType type = LayoutType.Sugiyama, object settings = null)
Parameters
type
The layout type to apply.
settings
The settings specific to the layout type.
Snap(IEnumerable<IShape>)
Snaps the specified shapes.
Declaration
public void Snap(IEnumerable<IShape> shapes)
Parameters
shapes
IEnumerable<IShape>
Ungroup(bool, params IGroup[])
Ungroups the specified items.
Ungroup(params IGroup[])
Ungroups the specified items.
Declaration
public void Ungroup(params IGroup[] groups)
Parameters
groups
IGroup[]
The groups items to ungroup.
ZoomIn(double?, Point?)
Zooms in the diagram. Simulates zooming with the mouse. Performs incremental zoom taking into account previous zoom operations.
Declaration
public virtual void ZoomIn(double? factor = null, Point? targetPoint = null)
Parameters
factor
The value by which to change Zoom property. When factor is null, smaller or equal to zero the ZoomScaleFactor value will be used.
targetPoint
The center of the zoom. The point should be provided in viewport coordinates.
ZoomOut(double?, Point?)
Zooms out the diagram. Simulates zooming with the mouse. Performs incremental zoom taking into account previous zoom operations.
Declaration
public virtual void ZoomOut(double? factor = null, Point? targetPoint = null)
Parameters
factor
The value by which to change Zoom property. When factor is null, smaller or equal to zero the ZoomScaleFactor value will be used.
targetPoint
The center of the zoom. The point should be provided in viewport coordinates.
Events
AdditionalContentActivated
Occurs when AdditionContent is activated.
Declaration
public event EventHandler<AdditionalContentActivatedEventArgs> AdditionalContentActivated
Event Value
CommandExecuted
Occurs when a async command is executed.
Declaration
public event EventHandler<CommandEventArgs> CommandExecuted
Event Value
ConnectionAdded
Occurs when a connection is added.
Declaration
public event EventHandler<GenericEventArgs<IConnection>> ConnectionAdded
Event Value
ConnectionAdding
Occurs when the connection is being added.
Declaration
public event EventHandler<GenericEventArgs<IConnection>> ConnectionAdding
Event Value
ConnectionClicked
Occurs when connection is clicked.
Declaration
public event EventHandler<GenericEventArgs<IConnection>> ConnectionClicked
Event Value
ConnectionDeserialized
Occurs when a connection has been deserialized.
Declaration
public event EventHandler<SerializationEventArgs<IConnection>> ConnectionDeserialized
Event Value
Remarks
This event allows you to recover additional, application specific data from the serialization.
ConnectionManipulationCompleted
Occurs when the connection manipulation has completed.
Declaration
public event EventHandler<ManipulationEventArgs> ConnectionManipulationCompleted
Event Value
ConnectionManipulationStarted
Occurs before the connection manipulation has started.
Declaration
public event EventHandler<ManipulationEventArgs> ConnectionManipulationStarted
Event Value
ConnectionSerialized
Occurs when a connection has been serialized.
Declaration
public event EventHandler<SerializationEventArgs<IConnection>> ConnectionSerialized
Event Value
Remarks
This event allows you to add additional, application specific data to the serialization.
ConnectorActivationChanged
Occurs after a connector activation or deactivation.
Declaration
public event EventHandler<ConnectorActivationChangedEventArgs> ConnectorActivationChanged
Event Value
Deserialized
Occurs when the diagram has been deserialized.
Declaration
public event RoutedEventHandler Deserialized
Event Value
DiagramLayoutComplete
Occurs when the diagram layout has completed.
Declaration
public event EventHandler<DiagramLayoutEventArgs> DiagramLayoutComplete
Event Value
Drag
Occurs when an item is dragged.
Declaration
public event EventHandler<DragRoutedEventArgs> Drag
Event Value
GraphSourceChanged
Occurs when the graph source has changed.
GraphSourceChanging
Occurs when the graph source begins changing.
Declaration
public event EventHandler GraphSourceChanging
Event Value
ItemDataBound
Occurs after an Item is databound.
Declaration
public event DiagramItemDataBindingEventHandler ItemDataBound
Event Value
ItemsChanged
Occurs when count of the items change.
Declaration
public event EventHandler<DiagramItemsChangedEventArgs> ItemsChanged
Event Value
ItemsChanging
Occurs while the diagram items are changing.
Declaration
public event EventHandler<DiagramItemsChangingEventArgs> ItemsChanging
Event Value
MetadataDeserialized
Occurs when the diagram's metadata has been deserialized.
Declaration
public event EventHandler<SerializationInfoEventArgs> MetadataDeserialized
Event Value
Remarks
The event allows you to deserialize the additional data added, if any, using the MetadataDeserialized event handler.
MetadataSerialized
Occurs when the diagram's metadata has been serialized.
Declaration
public event EventHandler<SerializationInfoEventArgs> MetadataSerialized
Event Value
Remarks
This event allows you to add additional, application specific data to the serialization.
Pan
Occurs after the diagram is panned.
Declaration
public event EventHandler<PositionChangedRoutedEventArgs> Pan
Event Value
PositionChanged
Occurs when the position has changed.
Declaration
public event EventHandler<PositionChangedEventArgs> PositionChanged
Event Value
PreviewAdditionalContentActivated
Occurs when AdditionContent is about to be activated.
Declaration
public event EventHandler<AdditionalContentActivatedEventArgs> PreviewAdditionalContentActivated
Event Value
PreviewDrag
Occurs before an item is dragged.
Declaration
public event EventHandler<DragRoutedEventArgs> PreviewDrag
Event Value
PreviewPan
Occurs before the diagram is panned.
Declaration
public event EventHandler<PositionChangedRoutedEventArgs> PreviewPan
Event Value
PreviewResize
Occurs before an item is resized.
Declaration
public event EventHandler<ResizeRoutedEventArgs> PreviewResize
Event Value
PreviewRotate
Occurs before an item is rotated.
Declaration
public event EventHandler<RoutedEventArgs> PreviewRotate
Event Value
PreviewSelectionChanged
Occurs when the selection of the diagram starts changing.
Declaration
public event EventHandler PreviewSelectionChanged
Event Value
PreviewZoom
Occurs before the zoom has been changed.
Declaration
public event EventHandler<DiagramZoomEventArgs> PreviewZoom
Event Value
Resize
Occurs when an item is resized.
Declaration
public event EventHandler<ResizingEventArgs> Resize
Event Value
Rotate
Occurs when an item is rotated.
Declaration
public event EventHandler<RotateRoutedEventArgs> Rotate
Event Value
SelectionBoundsChanged
Declaration
public event EventHandler SelectionBoundsChanged
Event Value
SelectionChanged
Occurs when the selection of the diagram changes.
Serialized
Occurs after the diagram has been serialized.
Declaration
public event RoutedEventHandler Serialized
Event Value
ShapeClicked
Occurs when shape is clicked.
Declaration
public event EventHandler<ShapeRoutedEventArgs> ShapeClicked
Event Value
ShapeDeserialized
Occurs when a shape has been deserialized.
Declaration
public event EventHandler<SerializationEventArgs<IShape>> ShapeDeserialized
Event Value
Remarks
The event allows you to deserialize the additional data added, if any, using the ShapeSerialized event handler.
ShapeDoubleClicked
Occurs when a shape has been double-clicked.
Declaration
public event EventHandler<ShapeRoutedEventArgs> ShapeDoubleClicked
Event Value
ShapeSerialized
Occurs when a shape has been serialized.
Declaration
public event EventHandler<SerializationEventArgs<IShape>> ShapeSerialized
Event Value
Remarks
This event allows you to add additional, application specific data to the serialization.
ZoomChanged
Occurs when the zoom has been changed.
Declaration
public event EventHandler<DiagramZoomEventArgs> ZoomChanged
Event Value