GraphController
Main MVC controller. The view type is based on an interface in function of platform independence.
Definition
Namespace:Telerik.Windows.Diagrams.Core
Assembly:Telerik.Windows.Diagrams.Core.dll
Syntax:
public sealed class GraphController : IControllerService, ISerializable
Inheritance: objectGraphController
Implements:
Constructors
Initializes a new instance of the GraphController class.
public GraphController(IGraphInternal graph, IContainerGeneratorInternal containerGenerator)
The graph internal.
containerGeneratorIContainerGeneratorInternalThe container generator.
Properties
Gets the service locator.
public ServiceLocator ServiceLocator { get; }
Methods
Activates the tool.
Adds the connection.
public void AddConnection(IConnection connection, bool isUndoable = true)
The connection.
isUndoableboolIf set to true [is undoable].
Aligns the shapes to the most left/top/right/bottom edge defined by the selection bounds.
public void AlignShapes(Alignment alignment, IEnumerable<IShape> shapes)
Determines whether alignment should be calculated towards left/top/right/bottom edge.
shapesIEnumerable<IShape>The shapes.
Brings the selected items forward.
public void BringForward(IEnumerable<IDiagramItem> items, bool isUndoable = true)
Brings the selected items to front.
public void BringToFront(IEnumerable<IDiagramItem> items, bool isUndoable = true)
Changes the tool.
Clears the diagram and resets the document.
public void Clear(bool isItemsCollectionChanging = false)
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.
Clears the connections.
public void ClearConnections()
Clears the shapes.
public void ClearShapes()
Cuts the items.
Deletes the items.
public void DeleteItems(IEnumerable<IDiagramItem> itemsToDelete, bool isUndoable)
The items to delete.
isUndoableboolIf set to true [is undoable].
Deselects a specific item.
Deserializes the specified info.
public void Deserialize(SerializationInfo info)
The info.
Implements:
Forces the realization.
public void ForceRealization()
Groups the selected shapes.
public IGroup Group(string name = null, bool isUndoable = false, params IGroupable[] items)
The name.
isUndoableboolIf set to true the operation [is undoable].
The items.
Returns:Checks if the diagram item is in the viewport.
Organizes the diagram using the specified layout.
public void Layout(LayoutType type = LayoutType.Sugiyama, object settings = null)
The layout type to apply.
settingsobjectThe settings specific to the layout type.
Loads the serialized diagram.
public void Load(string serializationValue)
A string supposedly containing some XML representing a serialized diagram.
Merges the items in the diagram.
public IEnumerable<IDiagramItem> MergeItems(IEnumerable<IDiagramItem> items, string originId, bool usePosition = false, Point position = null, Size size = null)
The items.
originIdstringThe origin id.
usePositionboolIf set to true the given position will be used.
The position.
sizeSizeThe size.
Returns:Handles the mouse double click event.
Called when the left mouse button is down.
Called when the mouse moves.
Called when the mouse left button is up.
Nudges (i.e. a small amount of translation) the selected items with the specified amount.
public void Nudge(Point amount)
The amount defined as a point (vector).
This is an undoable action and plugs into the same mechanism as the DraggingTool.
Called when graph source changes.
Called when Items collection changes.
public void OnItemsChanged(NotifyCollectionChangedEventArgs e)
The NotifyCollectionChangedEventArgs instance containing the event data.
Called when the bounds have changed.
public void OnViewportChanged()
Pastes a diagram, serialized in the clipboard.
Removes the connection.
public void RemoveConnection(IConnection connection, bool isUndoable = false)
The connection.
isUndoableboolIf set to true [is undoable].
Returns the serialized diagram as an XML-string.
Selects a specific item.
public void SelectItem(IDiagramItem selectedItem, bool addToExistingSelection = false)
Sends selected items backward.
public void SendBackward(IEnumerable<IDiagramItem> itemsToSend, bool isUndoable = true)
Sends selected items to back.
public void SendToBack(IEnumerable<IDiagramItem> itemsToSend, bool isUndoable = true)
Serializes this instance.
Snaps the items based on the snap value. The action is enclosed in a undoable command and supports undo/redo.