New to Telerik UI for WPFStart a free 30-day trial

IGraph

Interface

Defines the diagramming control's API.

Definition

Properties

Gets the connections in the current diagram.

C#
ConnectionCollection Connections { get; }

Cursor

Cursor

Gets or sets the current cursor.

C#
Cursor Cursor { get; set; }

Gets or sets the MVVM source of the diagram.

C#
IGraphSource GraphSource { get; set; }

Gets the groups in the current diagram.

C#
IEnumerable<IGroup> Groups { get; }

Gets or sets a value indicating whether the underlying graph structure is a directional graph (aka digraph).

C#
bool IgnoreLinkDirection { get; set; }
Property Value:

True if link directions are ignored; otherwise, false.

Gets or sets a value indicating whether the background visual is visible.

C#
bool IsBackgroundSurfaceVisible { get; set; }
Property Value:

True if the grid is visible; otherwise, false.

Gets or sets a value indicating whether editing is enabled.

C#
bool IsEditable { get; set; }
Property Value:

True if editing is enabled; otherwise, false.

Remarks:

Note that the similar lower-level IsEditable will be overruled by this setting.

Gets or sets whether the control has currently captured the mouse pointer.

C#
bool IsMouseCaptured { get; set; }
Property Value:

True if this instance is mouse captured; otherwise, false.

Gets or sets a value indicating whether panning is enabled.

C#
bool IsPanEnabled { get; set; }
Property Value:

True if panning is enabled; otherwise, false.

Gets or sets a value indicating whether snapping is enabled.

C#
bool IsSnapToGridEnabled { get; set; }
Property Value:

True if snapping is enabled; otherwise, false.

Gets or sets a value indicating whether snapping of selected item(s) to the other items in the view port is enabled or not.

C#
bool IsSnapToItemsEnabled { get; set; }

Gets a value indicating whether virtualization is switched on.

C#
bool IsVirtualizing { get; }
Property Value:

True if this instance is virtualizing; otherwise, false.

Gets or sets a value indicating whether zooming is enabled.

C#
bool IsZoomEnabled { get; set; }
Property Value:

True if zooming is enabled; otherwise, false.

Gets all (shapes and connections) the diagram items.

C#
DiagramItemCollection Items { get; }

Gets the metadata of the diagram.

C#
DiagramMetadata Metadata { get; }

Gets or sets the panning position.

C#
Point Position { get; set; }

Gets or sets whether items are selected if they are fully or partially contained in the selection rectangle.

C#
RectSelectionMode RectSelectionMode { get; set; }

Gets or sets the selection mode, i.e. how elements are being selected in responds to the overlap of a shape's bounds and the selection rectangle.

C#
SelectionMode SelectionMode { get; set; }

Gets the shapes of the current diagram.

C#
ShapeCollection Shapes { get; }

Gets or sets the horizontal snap value.

C#
int SnapX { get; set; }

Gets or sets the vertical snap value.

C#
int SnapY { get; set; }

Gets the viewport rectangle.

C#
Rect Viewport { get; }

Gets or sets the zoom level.

C#
double Zoom { get; set; }
Remarks:

The default zoom level of 100% corresponds to a Zoom value of 1d. Values bigger than one will zoom into the diagram while values smaller than one will zoom out.

Methods

Adds a new connection to the diagram.

C#
IConnection AddConnection(IConnection connection, bool isUndoable = false)
Parameters:connectionIConnection

The connection to be added.

isUndoablebool

If set to true the addition will be recorded as undoable.

Returns:

IConnection

Adds a connection to the diagram.

C#
IConnection AddConnection(IShape source, IShape target, bool isUndoable = false)
Parameters:sourceIShape

The source shape of this connection.

targetIShape

The target shape of this connection.

isUndoablebool

If set to true the addition will be recorded as undoable.

Returns:

IConnection

Adds a floating connection to the diagram.

C#
IConnection AddConnection(Point startPoint, Point endPoint, bool isUndoable = false)
Parameters:startPointPoint

The source (starting) point of the connection.

endPointPoint

The target (end) point of the connection.

isUndoablebool

True, if this action is undoable.

Returns:

IConnection

Returns the added connection.

Remarks:

A floating connection is a connection which is not necessarily at its source or target attached to a shape.

Adds a new shape to the diagram.

C#
IShape AddShape(IShape shape, Point? position = null, bool isUndoable = false)
Parameters:shapeIShape

The shape to add.

positionPoint?

The position at which the newly created shape should be positioned.

isUndoablebool

If set to true the addition will be recorded as undoable.

Returns:

IShape

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.

C#
DiagramLayoutState BeginBatchTransformation()
Returns:

DiagramLayoutState

Commits the batch transformation and ends the composite undo redo change.

C#
void CommitBatchTransformation(DiagramLayoutState initialState, DiagramLayoutState finalState, bool animate, bool execute, LayoutType type = LayoutType.Sugiyama, object settings = null)
Parameters:initialStateDiagramLayoutState

The initial state.

finalStateDiagramLayoutState

The final state of the shapes after layout.

animatebool

If set to true the layout transition will be animated.

executebool

If true the batch will be executed, otherwise only the undo units will be added.

typeLayoutType

The layout type that has been applied.

settingsobject

The layout specific settings used for the layout.

Groups the given items in a new group with the specified name.

C#
IGroup Group(string groupName = null, bool isUndoable = false, params IGroupable[] items)
Parameters:groupNamestring

Name of the group.

isUndoablebool

If set to true the operation [is undoable].

itemsIGroupable[]

The items to be grouped.

Returns:

IGroup

Groups the given items in a new group with the specified name.

C#
IGroup Group(string groupName = null, params IGroupable[] items)
Parameters:groupNamestring

Name of the group.

itemsIGroupable[]

The items to be grouped.

Returns:

IGroup

Removes a connection from the diagram.

C#
void RemoveConnection(IConnection connection, bool isUndoable = false)
Parameters:connectionIConnection

The connection to be removed.

isUndoablebool

If set to true the addition will be recorded as undoable.

Removes a shape from the diagram.

C#
void RemoveShape(IShape shape, bool isUndoable = false)
Parameters:shapeIShape

The shape to be removed.

isUndoablebool

If set to true the addition will be recorded as undoable.

Ungroups the specified groups.

C#
void Ungroup(bool isUndoable = false, params IGroup[] groups)
Parameters:isUndoablebool

If set to true the operation [is undoable].

groupsIGroup[]

The groups.

Ungroups the specified groups.

C#
void Ungroup(params IGroup[] groups)
Parameters:groupsIGroup[]

The groups.

Extension Methods