skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • NEW: Design Kits for Figma
    • Online Training
    • Document Processing Library
    • Embedded Reporting for web and desktop

    Web

    Kendo UI UI for jQuery UI for Angular UI for React UI for Vue UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Test Studio Dev Edition Telerik JustMock

    CMS

    Sitefinity

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Support and Learning

    • Support and Learning Hub
    • First Steps
    • Docs
    • Demos
    • Virtual Classroom
    • Forums
    • Videos
    • Blogs
    • Accessibility
    • Submit a Ticket

    Productivity and Design Tools

    • Visual Studio Extensions
    • Visual Studio Templates
    • Embedded Reporting
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Interface IGraph

Defines the diagramming control's API.

Inherited Members
ISerializable.Serialize()
ISerializable.Deserialize(SerializationInfo)
ISupportManipulation.IsRotationEnabled
ISupportManipulation.IsResizingEnabled
ISupportManipulation.IsDraggingEnabled
ISupportManipulation.IsConnectorsManipulationEnabled
ISupportManipulation.IsManipulationAdornerVisible
ISupportManipulation.AllowDelete
ISupportManipulation.AllowCut
ISupportManipulation.AllowCopy
ISupportManipulation.AllowPaste
Namespace: Telerik.Windows.Diagrams.Core
Assembly: Telerik.Windows.Diagrams.Core.dll

Syntax

public interface IGraph : ISerializable, ISupportManipulation

Properties

Connections

Gets the connections in the current diagram.

Declaration
ConnectionCollection Connections { get; }
Property Value
ConnectionCollection

See Also
Items

Cursor

Gets or sets the current cursor.

Declaration
Cursor Cursor { get; set; }
Property Value
System.Windows.Input.Cursor

GraphSource

Gets or sets the MVVM source of the diagram.

Declaration
IGraphSource GraphSource { get; set; }
Property Value
IGraphSource

Groups

Gets the groups in the current diagram.

Declaration
IEnumerable<IGroup> Groups { get; }
Property Value
System.Collections.Generic.IEnumerable<IGroup>

IgnoreLinkDirection

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

Declaration
bool IgnoreLinkDirection { get; set; }
Property Value
System.Boolean

True if link directions are ignored; otherwise, false.

IsBackgroundSurfaceVisible

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

Declaration
bool IsBackgroundSurfaceVisible { get; set; }
Property Value
System.Boolean

True if the grid is visible; otherwise, false.

IsEditable

Gets or sets a value indicating whether editing is enabled.

Declaration
bool IsEditable { get; set; }
Property Value
System.Boolean

True if editing is enabled; otherwise, false.

Remarks

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

IsMouseCaptured

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

Declaration
bool IsMouseCaptured { get; set; }
Property Value
System.Boolean

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

IsPanEnabled

Gets or sets a value indicating whether panning is enabled.

Declaration
bool IsPanEnabled { get; set; }
Property Value
System.Boolean

True if panning is enabled; otherwise, false.

IsSnapToGridEnabled

Gets or sets a value indicating whether snapping is enabled.

Declaration
bool IsSnapToGridEnabled { get; set; }
Property Value
System.Boolean

True if snapping is enabled; otherwise, false.

See Also
SnapX
SnapY

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.

Declaration
bool IsSnapToItemsEnabled { get; set; }
Property Value
System.Boolean

IsVirtualizing

Gets a value indicating whether virtualization is switched on.

Declaration
bool IsVirtualizing { get; }
Property Value
System.Boolean

True if this instance is virtualizing; otherwise, false.

IsZoomEnabled

Gets or sets a value indicating whether zooming is enabled.

Declaration
bool IsZoomEnabled { get; set; }
Property Value
System.Boolean

True if zooming is enabled; otherwise, false.

See Also
Zoom

Items

Gets all (shapes and connections) the diagram items.

Declaration
DiagramItemCollection Items { get; }
Property Value
DiagramItemCollection

See Also
Shapes
Connections

Metadata

Gets the metadata of the diagram.

Declaration
DiagramMetadata Metadata { get; }
Property Value
DiagramMetadata

See Also
DiagramMetadata

Position

Gets or sets the panning position.

Declaration
Point Position { get; set; }
Property Value
System.Windows.Point

RectSelectionMode

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

Declaration
RectSelectionMode RectSelectionMode { get; set; }
Property Value
RectSelectionMode

SelectionMode

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.

Declaration
SelectionMode SelectionMode { get; set; }
Property Value
SelectionMode

Shapes

Gets the shapes of the current diagram.

Declaration
ShapeCollection Shapes { get; }
Property Value
ShapeCollection

See Also
Items

SnapX

Gets or sets the horizontal snap value.

Declaration
int SnapX { get; set; }
Property Value
System.Int32

See Also
IsSnapToGridEnabled

SnapY

Gets or sets the vertical snap value.

Declaration
int SnapY { get; set; }
Property Value
System.Int32

See Also
IsSnapToGridEnabled

Viewport

Gets the viewport rectangle.

Declaration
Rect Viewport { get; }
Property Value
System.Windows.Rect

Zoom

Gets or sets the zoom level.

Declaration
double Zoom { get; set; }
Property Value
System.Double

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.

See Also
MinimumZoom
MaximumZoom

Methods

AddConnection(Point, Point, Boolean)

Adds a floating connection to the diagram.

Declaration
IConnection AddConnection(Point startPoint, Point endPoint, bool isUndoable = false)
Parameters
System.Windows.Point startPoint

The source (starting) point of the connection.

System.Windows.Point endPoint

The target (end) point of the connection.

System.Boolean isUndoable

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.

AddConnection(IConnection, Boolean)

Adds a new connection to the diagram.

Declaration
IConnection AddConnection(IConnection connection, bool isUndoable = false)
Parameters
IConnection connection

The connection to be added.

System.Boolean isUndoable

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

Returns
IConnection

AddConnection(IShape, IShape, Boolean)

Adds a connection to the diagram.

Declaration
IConnection AddConnection(IShape source, IShape target, bool isUndoable = false)
Parameters
IShape source

The source shape of this connection.

IShape target

The target shape of this connection.

System.Boolean isUndoable

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

Returns
IConnection

AddShape(IShape, Nullable<Point>, Boolean)

Adds a new shape to the diagram.

Declaration
IShape AddShape(IShape shape, Nullable<Point> position = null, bool isUndoable = false)
Parameters
IShape shape

The shape to add.

System.Nullable<System.Windows.Point> position

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

System.Boolean isUndoable

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

Returns
IShape

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
DiagramLayoutState BeginBatchTransformation()
Returns
DiagramLayoutState

See Also
CommitBatchTransformation(DiagramLayoutState, DiagramLayoutState, Boolean, Boolean, LayoutType, Object)

CommitBatchTransformation(DiagramLayoutState, DiagramLayoutState, Boolean, Boolean, LayoutType, Object)

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

Declaration
void CommitBatchTransformation(DiagramLayoutState initialState, DiagramLayoutState finalState, bool animate, bool execute, LayoutType type, object settings = null)
Parameters
DiagramLayoutState initialState

The initial state.

DiagramLayoutState finalState

The final state of the shapes after layout.

System.Boolean animate

If set to true the layout transition will be animated.

System.Boolean execute

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

LayoutType type

The layout type that has been applied.

System.Object settings

The layout specific settings used for the layout.

See Also
BeginBatchTransformation()

Group(String, Boolean, IGroupable[])

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

Declaration
IGroup Group(string groupName = null, bool isUndoable = false, params IGroupable[] items)
Parameters
System.String groupName

Name of the group.

System.Boolean isUndoable

If set to true the operation [is undoable].

IGroupable[] items

The items to be grouped.

Returns
IGroup

Group(String, IGroupable[])

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

Declaration
IGroup Group(string groupName = null, params IGroupable[] items)
Parameters
System.String groupName

Name of the group.

IGroupable[] items

The items to be grouped.

Returns
IGroup

RemoveConnection(IConnection, Boolean)

Removes a connection from the diagram.

Declaration
void RemoveConnection(IConnection connection, bool isUndoable = false)
Parameters
IConnection connection

The connection to be removed.

System.Boolean isUndoable

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

RemoveShape(IShape, Boolean)

Removes a shape from the diagram.

Declaration
void RemoveShape(IShape shape, bool isUndoable = false)
Parameters
IShape shape

The shape to be removed.

System.Boolean isUndoable

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

Ungroup(Boolean, IGroup[])

Ungroups the specified groups.

Declaration
void Ungroup(bool isUndoable = false, params IGroup[] groups)
Parameters
System.Boolean isUndoable

If set to true the operation [is undoable].

IGroup[] groups

The groups.

Ungroup(IGroup[])

Ungroups the specified groups.

Declaration
void Ungroup(params IGroup[] groups)
Parameters
IGroup[] groups

The groups.

Extension Methods

CollectionExtensions.ToEnumerable<T>(T)
IGraphExtensions.CalculateEnclosingBounds(IGraph, Boolean, Boolean)
IGraphExtensions.DiagramItems(IGraph)
IGraphExtensions.GetConnectionsInSubGraph(IGraph, IEnumerable<IShape>)
IGraphExtensions.GetConnectionsForShape(IGraph, IShape)
IGraphExtensions.GetConnectionsForShapeRecursively(IGraph, IShape)
IGraphExtensions.GetIncomingConnectionsForShape(IGraph, IShape)
IGraphExtensions.GetOutgoingConnectionsForShape(IGraph, IShape)
EnumerableExtensions.ToEnumerable<T>(T)

See Also

IGraphInternal
Getting Started
  • Install Now
  • Demos
  • SDK Samples Browser
  • Sample Applications
Support Resources
  • Code Library
  • Knowledge Base
  • MVVM Support
  • Videos
  • GitHub SDK Repository
Community
  • Forums
  • Blogs
  • XAML Feedback Portal
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.