InterfaceIGraph
Defines the diagramming control's API.
Definition
Namespace:Telerik.Windows.Diagrams.Core
Assembly:Telerik.Windows.Diagrams.Core.dll
Syntax:
public interface IGraph : ISerializable, ISupportManipulation
Inherited Members
Properties
Connections
Gets the connections in the current diagram.
Declaration
ConnectionCollection Connections { get; }
Property Value
Cursor
Gets or sets the current cursor.
Declaration
Cursor Cursor { get; set; }
Property Value
Cursor
GraphSource
Gets or sets the MVVM source of the diagram.
Groups
Gets the groups in the current diagram.
Declaration
IEnumerable<IGroup> Groups { get; }
Property Value
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
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
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
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
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
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
True if 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.
IsVirtualizing
Gets a value indicating whether virtualization is switched on.
Declaration
bool IsVirtualizing { get; }
Property Value
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
True if zooming is enabled; otherwise, false.
Items
Gets all (shapes and connections) the diagram items.
Declaration
DiagramItemCollection Items { get; }
Property Value
Metadata
Gets the metadata of the diagram.
Position
Gets or sets the panning position.
Declaration
Point Position { get; set; }
Property Value
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
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
Shapes
Gets the shapes of the current diagram.
SnapX
Gets or sets the horizontal snap value.
SnapY
Gets or sets the vertical snap value.
Viewport
Gets the viewport rectangle.
Declaration
Rect Viewport { get; }
Property Value
Rect
Methods
AddConnection(IConnection, bool)
Adds a new connection to the diagram.
Declaration
IConnection AddConnection(IConnection connection, bool isUndoable = false)
Parameters
connection
The connection to be added.
isUndoable
If set to true the addition will be recorded as undoable.
Returns
AddConnection(IShape, IShape, bool)
Adds a connection to the diagram.
Declaration
IConnection AddConnection(IShape source, IShape target, bool isUndoable = false)
Parameters
source
The source shape of this connection.
target
The target shape of this connection.
isUndoable
If set to true the addition will be recorded as undoable.
Returns
AddConnection(Point, Point, bool)
Adds a floating connection to the diagram.
Declaration
IConnection AddConnection(Point startPoint, Point endPoint, bool isUndoable = false)
Parameters
startPoint
Point
The source (starting) point of the connection.
endPoint
Point
The target (end) point of the connection.
isUndoable
True, if this action is undoable.
Returns
Returns the added connection.
Remarks
A floating connection is a connection which is not necessarily at its source or target attached to a shape.
AddShape(IShape, Point?, bool)
Adds a new shape to the diagram.
Declaration
IShape AddShape(IShape shape, Point? position = null, bool isUndoable = false)
Parameters
shape
The shape to add.
position
Point?
The position at which the newly created shape should be positioned.
isUndoable
If set to true the addition will be recorded as undoable.
Returns
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
CommitBatchTransformation(DiagramLayoutState, DiagramLayoutState, bool, bool, 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 = LayoutType.Sugiyama, object settings = null)
Parameters
initialState
The initial state.
finalState
The final state of the shapes after layout.
animate
If set to true the layout transition will be animated.
execute
If true the batch will be executed, otherwise only the undo units will be added.
type
The layout type that has been applied.
settings
The layout specific settings used for the layout.
Group(string, bool, params 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
groupName
Name of the group.
isUndoable
If set to true the operation [is undoable].
items
The items to be grouped.
Returns
Group(string, params IGroupable[])
Groups the given items in a new group with the specified name.
Declaration
IGroup Group(string groupName = null, params IGroupable[] items)
Parameters
groupName
Name of the group.
items
The items to be grouped.
Returns
RemoveConnection(IConnection, bool)
Removes a connection from the diagram.
Declaration
void RemoveConnection(IConnection connection, bool isUndoable = false)
Parameters
connection
The connection to be removed.
isUndoable
If set to true the addition will be recorded as undoable.
RemoveShape(IShape, bool)
Removes a shape from the diagram.
Ungroup(bool, params IGroup[])
Ungroups the specified groups.
Ungroup(params IGroup[])
Ungroups the specified groups.
Declaration
void Ungroup(params IGroup[] groups)
Parameters
groups
IGroup[]
The groups.