RadDiagramElement
Represents a diagram element that provides visual diagramming functionality with support for shapes, connections, and interactive features.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.RadDiagram.dll
Syntax:
public class RadDiagramElement : LightVisualElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider, ISupportContainerGenerator<RadDiagramItem>, IGraphInternal, IGraph, ISerializable, ISupportManipulation
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemUIItemBaseLightVisualElementRadDiagramElement...
Implements:
Inherited Members
Constructors
Initializes a new instance of the RadDiagramElement class.
public RadDiagramElement()
Fields
Identifies the ActiveTool dependency property.
public static readonly RadProperty ActiveToolProperty
Identifies the AllowCopy dependency property.
public static readonly RadProperty AllowCopyProperty
Identifies the AllowCut dependency property.
public static readonly RadProperty AllowCutProperty
Identifies the AllowDelete dependency property.
public static readonly RadProperty AllowDeleteProperty
Identifies the AllowPaste dependency property.
public static readonly RadProperty AllowPasteProperty
Identifies the AutoLayout dependency property.
public static readonly RadProperty AutoLayoutProperty
Identifies the Position dependency property.
public static readonly RadProperty ConnectionBridgeProperty
Identifies the ConnectionClicked routed event.
public static RoutedEvent ConnectionClickedEvent
Identifies the ConnectionEditTemplate dependency property.
public static readonly RadProperty ConnectionEditTemplateProperty
Identifies the ConnectionEditTemplateSelector dependency property.
public static readonly RadProperty ConnectionEditTemplateSelectorProperty
Identifies the RoundedCorners dependency property.
public static readonly RadProperty ConnectionRoundedCornersProperty
Identifies the ConnectionTemplate dependency property.
public static readonly RadProperty ConnectionTemplateProperty
Identifies the ConnectionTemplateSelector dependency property.
public static readonly RadProperty ConnectionTemplateSelectorProperty
Identifies the DisplayMemberPath dependency property.
public static readonly RadProperty DisplayMemberPathProperty
Identifies the GraphSource dependency property.
public static readonly RadProperty GraphSourceProperty
Identifies the IsAdditionalContentVisible dependency property.
public static readonly RadProperty IsAdditionalContentVisibleProperty
Identifies the IsBackgroundSurfaceVisible dependency property.
public static readonly RadProperty IsBackgroundSurfaceVisibleProperty
Identifies the IsConnectorsManipulationEnabled dependency property.
public static readonly RadProperty IsConnectorsManipulationEnabledProperty
Identifies the IsDraggingEnabled dependency property.
public static readonly RadProperty IsDraggingEnabledProperty
Identifies the IsEditable dependency property.
public static readonly RadProperty IsEditableProperty
Identifies the IsInformationAdornerVisible dependency property.
public static readonly RadProperty IsInformationAdornerVisibleProperty
Identifies the IsManipulationAdornerVisible dependency property.
public static readonly RadProperty IsManipulationAdornerVisibleProperty
Identifies the IsPanEnabled dependency property.
public static readonly RadProperty IsPanEnabledProperty
Identifies the IsResizingEnabled dependency property.
public static readonly RadProperty IsResizingEnabledProperty
Identifies the IsRotationEnabled dependency property.
public static readonly RadProperty IsRotationEnabledProperty
Identifies the IsSnapEnabled dependency property.
public static readonly RadProperty IsSnapToGridEnabledProperty
Identifies the IsSnapToItemsEnabled dependency property.
public static readonly RadProperty IsSnapToItemsEnabledProperty
Identifies the IsZoomEnabled dependency property.
public static readonly RadProperty IsZoomEnabledProperty
Identifies the Items dependency property.
public static readonly RadProperty ItemsProperty
Identifies the Position dependency property.
public static readonly RadProperty PositionProperty
Identifies the RectSelectionMode dependency property.
public static readonly RadProperty RectSelectionModeProperty
Identifies the RouteConnections dependency property.
public static readonly RadProperty RouteConnectionsProperty
Identifies the SelectedIndex dependency property.
public static readonly RadProperty SelectedIndexProperty
Identifies the SelectedItem dependency property.
public static readonly RadProperty SelectedItemProperty
Identifies the SelectionMode dependency property.
public static readonly RadProperty SelectionModeProperty
Identifies the ShapeClicked routed event.
public static RoutedEvent ShapeClickedEvent
Identifies the ShapeDoubleClicked routed event.
public static RoutedEvent ShapeDoubleClickedEvent
Identifies the ShapeEditTemplate dependency property.
public static readonly RadProperty ShapeEditTemplateProperty
Identifies the ShapeEditTemplateSelector dependency property.
public static readonly RadProperty ShapeEditTemplateSelectorProperty
Identifies the ShapeTemplate dependency property.
public static readonly RadProperty ShapeTemplateProperty
Identifies the ShapeTemplateSelector dependency property.
public static readonly RadProperty ShapeTemplateSelectorProperty
public static readonly RadProperty SnapXProperty
public static readonly RadProperty SnapYProperty
Identifies the SupportTouchGestures dependency property.
public static readonly RadProperty SupportTouchGesturesProperty
Identifies the Viewport dependency property.
public static readonly RadProperty ViewportProperty
Identifies the Zoom dependency property.
public static readonly RadProperty ZoomProperty
Properties
Gets or sets the tool which is active when interacting with the diagram elements.
public MouseTool ActiveTool { get; set; }
Gets or sets the additional content element that provides extended functionality and settings access.
public RadButtonElement AdditionalContent { get; set; }
Gets or sets a value indicating whether copying is allowed.
public bool AllowCopy { get; set; }
True if copying is allowed; otherwise, false.
Implements:
Gets or sets a value indicating whether cutting is allowed.
public bool AllowCut { get; set; }
True if cutting is allowed; otherwise, false.
Implements:
Gets or sets a value indicating whether deleting is allowed.
public bool AllowDelete { get; set; }
True if deleting is allowed; otherwise, false.
Implements:
Gets or sets a value indicating whether pasting is allowed.
public bool AllowPaste { get; set; }
True if pasting is allowed; otherwise, false.
Implements:
Gets or sets the auto layout.
public bool AutoLayout { get; set; }
Gets the background grid that provides visual grid lines for the diagram.
public BackgroundGrid BackgroundGrid { get; }
Gets the background page grid that provides page layout visualization.
public BackgroundPageGrid BackgroundPageGrid { get; }
Gets or sets the BindingContext for the object.
public override BindingContext BindingContext { get; set; }
Overrides:
Gets or sets the connection bridge type.
public BridgeType ConnectionBridge { get; set; }
Implements:
Gets or sets the connection edit template.
public DataTemplate ConnectionEditTemplate { get; set; }
The connection edit template.
Gets or sets whether the corners of the (polyline) connection are rounded.
public bool ConnectionRoundedCorners { get; set; }
Implements:
This property has only an effect when the ConnectionType is set to Polyline.
Gets the connections.
public ConnectionCollection Connections { get; }
Implements:
Gets or sets the connection template.
public DataTemplate ConnectionTemplate { get; set; }
The connection template.
Gets or sets the connection template selector.
public DataTemplateSelector ConnectionTemplateSelector { get; set; }
The connection template selector.
Gets the container generator.
public IContainerGenerator<RadDiagramItem> ContainerGenerator { get; }
Gets the graph controller that manages diagram interactions, selections, and commands.
public GraphController Controller { get; }
Gets or sets the cursor displayed when hovering over the diagram.
public Cursor Cursor { get; set; }
Implements:
public virtual DiagramDataLayer DataLayer { get; }
Implements:
Gets or sets the framework element associated with the diagram.
public FrameworkElement DiagramElement { get; set; }
Gets or sets the display member path.
public string DisplayMemberPath { get; set; }
The display member path.
Gets or sets the graph source.
public IGraphSource GraphSource { get; set; }
The graph source.
Implements:
Gets the group collection.
public IEnumerable<IGroup> Groups { get; }
Implements:
Gets the horizontal scrollbar element of the diagram.
public RadScrollBarElement HorizontalScrollbar { get; }
public ScrollBarVisibility HorizontalScrollbarVisibility { get; set; }
Gets or sets a value indicating whether the underlying graph structure is a directional graph.
public bool IgnoreLinkDirection { get; set; }
True if link directions are ignored; otherwise, false.
Implements:
Gets or sets the input behavior that handles user interactions with the diagram.
public virtual DiagramInputBehavior InputBehavior { get; set; }
Gets or sets whether the background grid is visible.
public bool IsBackgroundSurfaceVisible { get; set; }
Implements:
Gets or sets a value indicating whether manipulation on the connectors is enabled.
public bool IsConnectorsManipulationEnabled { get; set; }
True if manipulation on connectors is enabled; otherwise, false.
Implements:
Gets or sets a value indicating whether dragging is enabled.
public bool IsDraggingEnabled { get; set; }
True if dragging is enabled; otherwise, false.
Implements:
Gets or sets a value indicating whether editing is enabled.
public bool IsEditable { get; set; }
True if editing is enabled; otherwise, false.
Implements:
Gets or sets whether the information adorner is visible.
public bool IsInformationAdornerVisible { get; set; }
Gets or sets a value indicating whether the manipulation adorner is visible.
public bool IsManipulationAdornerVisible { get; set; }
True if the manipulation adorner is visible; otherwise, false.
Implements:
Gets or sets a value indicating whether the mouse is captured.
public bool IsMouseCaptured { get; set; }
True if the mouse is captured; otherwise, false.
Implements:
Gets or sets a value indicating whether panning is enabled.
public bool IsPanEnabled { get; set; }
True if panning is enabled; otherwise, false.
Implements:
Gets or sets a value indicating whether resizing is enabled.
public bool IsResizingEnabled { get; set; }
True if resizing is enabled; otherwise, false.
Implements:
Gets or sets a value indicating whether rotation is enabled.
public bool IsRotationEnabled { get; set; }
true if this rotation is enabled; otherwise, false.
Implements:
Gets or sets a value indicating whether the settings pane is enabled for the diagram.
public bool IsSettingsPaneEnabled { get; set; }
Gets or sets a value indicating whether grid snapping is enabled.
public bool IsSnapToGridEnabled { get; set; }
True if grid snapping is enabled; otherwise, false.
Implements:
Gets or sets a value indicating whether snapping of selected item(s) to the other items in the view port is enabled or not.
public bool IsSnapToItemsEnabled { get; set; }
Implements:
public bool IsUpdating { get; }
Gets or sets a value indicating whether zooming is enabled.
public bool IsZoomEnabled { get; set; }
True if zooming is enabled; otherwise, false.
Implements:
Gets or sets the item information adorner that displays additional information about selected diagram items.
public ItemInformationAdorner ItemInformationAdorner { get; set; }
Gets or sets the diagramming items.
public DiagramItemCollection Items { get; }
The items.
Implements:
Gets the diagram surface that hosts and manages all diagram items.
public DiagramSurface ItemsHost { get; }
Gets the main panel that contains all diagram visual elements and provides coordinate transformation.
public Panel MainPanel { get; }
Gets the diagram metadata.
public DiagramMetadata Metadata { get; }
Implements:
Gets or sets the position.
public Point Position { get; set; }
The position.
Implements:
Gets or sets the rectangle selection mode.
public RectSelectionMode RectSelectionMode { get; set; }
Implements:
public static List<CommandBinding> RegisteredCommands { get; set; }
public IRoutingService RoutingService { get; }
Gets or sets the index of the first item in the current selection or returns negative one (-1) if the selection is empty.
public int SelectedIndex { get; set; }
Gets or sets the first item in the current selection or returns null if the selection is empty. This is a dependency property.
public object SelectedItem { get; set; }
SelectedItems
IEnumerable<IDiagramItem>
Gets the selected items.
public IEnumerable<IDiagramItem> SelectedItems { get; }
Gets the starting selection bounds.
public Rect SelectionBounds { get; }
Gets or sets the selection mode.
public SelectionMode SelectionMode { get; set; }
Implements:
Gets the service locator.
public IServiceLocator ServiceLocator { get; }
Implements:
Gets or sets the diagram settings pane that provides configuration options for selected items.
public RadDiagramSettingsPane SettingsPane { get; set; }
Gets or sets the shape edit template.
public DataTemplate ShapeEditTemplate { get; set; }
The shape edit template.
Gets or sets the shape edit template selector.
public DataTemplateSelector ShapeEditTemplateSelector { get; set; }
The shape edit template selector.
Gets the shapes.
public ShapeCollection Shapes { get; }
Implements:
Gets or sets the shape template.
public DataTemplate ShapeTemplate { get; set; }
The shape template.
Gets or sets the shape template selector.
public DataTemplateSelector ShapeTemplateSelector { get; set; }
The shape template selector.
Gets or sets the horizontal snapping distance.
public int SnapX { get; set; }
The horizontal snapping distance.
Implements:
Gets or sets the vertical snapping distance.
public int SnapY { get; set; }
The vertical snapping distance.
Implements:
Gets the undo redo service.
public IUndoRedoService UndoRedoService { get; }
Gets the vertical scrollbar element of the diagram.
public RadScrollBarElement VerticalScrollbar { get; }
public ScrollBarVisibility VerticalScrollbarVisibility { get; set; }
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.
public double Zoom { get; set; }
Implements:
Methods
Adds a new connection to the diagram.
public IConnection AddConnection(IConnection connection, bool isUndoable = false)
The connection to be added.
isUndoableboolIf set to true this action will be recorded in the undo stack.
Implements:
Adds a new connection to the diagram connecting the given source and target shapes.
public IConnection AddConnection(IShape source, IShape target, bool isUndoable = false)
The source or start shape of the connection.
targetIShapeThe target or end shape of the connection.
isUndoableboolIf set to true this action will be recorded in the undo stack.
Implements:
Adds a new connection to the diagram connecting the given source and target shapes.
public IConnection AddConnection(IShape source, IShape target, string connectorsPosition, bool isUndoable = false)
The source or start shape of the connection.
targetIShapeThe target or end shape of the connection.
connectorsPositionstringThe connectors position.
isUndoableboolIf set to true this action will be recorded in the undo stack.
Adds a new connection to the diagram connecting the given source and target shapes.
public IConnection AddConnection(IShape source, IShape target, string sourceConnector, string targetConnector, bool isUndoable = false)
The source.
targetIShapeThe target.
sourceConnectorstringThe source connector position.
targetConnectorstringThe target connector position.
isUndoableboolIf set to true is undoable.
Adds a floating connection.
public IConnection AddConnection(Point startPoint, Point endPoint, bool isUndoable = false)
The source (starting) point of the connection.
endPointPointThe target (end) point of the connection.
isUndoableboolTrue, if this action is undoable.
Returns:Returns the added connection.
Implements:
Adds a new gliding connection to the diagram connecting the given source and target shapes.
public IConnection AddGlidingConnection(IShape source, IShape target, bool isUndoable = false)
The source or start shape of the connection.
targetIShapeThe target or end shape of the connection.
isUndoableboolIf set to true this action will be recorded in the undo stack.
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.
Adds the given shape to the diagram.
Adds a new shape to the diagram.
public IShape AddShape(object content, Geometry geometry = null, Point? position = null, bool isUndoable = false)
The content of the shape.
geometryGeometryThe geometry.
positionPoint?The position.
isUndoableboolIf set to true the action is undoable.
The added shape.
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.
Arranges the child elements of the diagram and positions scrollbars and adorners.
Zoom and pans the diagram in such a way that all items will fit into the currently visible area of the canvas.
protected void AutoFit()
Zoom and pans the diagram in such a way that all items will fit into the currently visible area of the canvas. If there are no items or the visible area is with empty size or the margin is greater than the visible area no action will be performed.
Zoom and pans the diagram asynchronously in such a way that all items will fit into the currently visible area of the canvas. If there are no items or the visible area is with empty size or the margin is greater than the visible area no action will be performed.
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.
Begins the update.
public void BeginUpdate()
Brings the items forward.
public void BringForward(IEnumerable<IDiagramItem> items, bool isUndoable = true)
Brings the provided item to the center of the view port with the requested zoom.
public bool BringIntoView(object item, double zoomLevel = 1, bool useAnimation = true)
The shape to bring to the center of the view port. If the item is null or has with invalid position/size (NaN or infinity) the operation will not be executed.
zoomLeveldoubleThe zoom level. It will be coerced according to Zoom property restriction.
useAnimationboolDetermines whether an animation will be used.
Returns:Whether the operation has bee executed successfully or not.
Brings the provided point into the top left corner of the view port with the requested zoom.
public bool BringIntoView(Point position, double zoomLevel = 1, bool useAnimation = true)
The point to bring to the top left view port corner. If the position is invalid (NaN or infinity) the operation will not be executed.
zoomLeveldoubleThe zoom level. It will be coerced according to Zoom property restriction.
useAnimationboolDetermines whether an animation will be used.
Returns:Whether the operation has bee executed successfully or not.
Makes the requested rectangle the new view port. After the rectangle is centered in the view port a zoom operation stretches the rectangle to occupy the whole view port. The zoom is coerced according to Zoom property restriction.
public bool BringIntoView(Rect newViewPort, bool useAnimation = true)
The rect to bring into view. If the rectangle is empty the operation will not be executed.
useAnimationboolDetermines whether an animation will be used.
Returns:Whether the operation has bee executed successfully or not.
Brings the items to front.
public void BringToFront(IEnumerable<IDiagramItem> items, bool isUndoable = true)
Cleans the container for item override.
protected virtual void CleanContainerForItemOverride(FrameworkElement container, object item)
The container.
itemobjectThe item.
Clears the diagram and resets the document.
public void Clear()
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.
Commits the batch transformation and ends the composite undo redo change.
public void CommitBatchTransformation(DiagramLayoutState initialState, DiagramLayoutState finalState, bool animate = false, bool execute = true, LayoutType type = LayoutType.Sugiyama, object settings = null)
The initial state.
finalStateDiagramLayoutStateThe final state.
animateboolIf set to true the layout will be animated.
Whether the undo-redo unit is only added or also executed.
typeLayoutTypeThe layout type that has been applied.
settingsobjectThe layout specific settings used for the layout.
Implements:
The animation tremendously decreases the performance.
Copies the currently selected items of the diagram.
public void Copy()
Creates the child elements that make up the diagram's visual structure including scrollbars, adorners, and diagram surface.
protected override void CreateChildElements()
Overrides:
Creates a data layer for the diagram that manages data binding and visualization.
protected virtual DiagramDataLayer CreateDiagramDataLayer()
A new instance of DiagramDataLayer for the diagram.
Creates the input behavior for the diagram that handles user interactions and input processing.
protected virtual DiagramInputBehavior CreateInputBehavior()
A new instance of DiagramInputBehavior for handling diagram interactions.
Creates a panel element for the diagram viewport.
protected virtual RadElement CreatePanel()
A new RadElement that serves as the diagram panel.
Cuts the currently selected items of the diagram.
public void Cut()
Deletes the currently selected items of the diagram.
public virtual void Delete()
Deselects all shapes in the diagram.
public void DeselectAll()
Deserializes the specified info.
public virtual void Deserialize(SerializationInfo info)
The info.
Implements:
Called when the DPI scale factor changes and adjusts the diagram zoom accordingly.
public override void DpiScaleChanged(SizeF scaleFactor)
The new DPI scale factor to apply.
Overrides:
Ends the update.
public void EndUpdate(bool performUpdate = true)
Tells the view whether an update is required or not.
Exports the Diagram into bmp.
Exports RadDiagram to Image
protected virtual void ForceUpdateLayout()
Gets the connection container for item override.
protected virtual IConnection GetConnectionContainerForItemOverride(object item)
The item.
Returns:Gets the 'container shape' container for item override.
protected virtual IContainerShape GetShapeContainerForItemOverride(IContainerItem item)
The item.
Returns:Groups the specified items.
public IGroup Group(string groupName = null, bool isUndoable = false, params IGroupable[] items)
Name of the new group.
isUndoableboolIf set to true the action will be recorded as undoable.
The groups items to ungroup.
Returns:Implements:
Groups the specified items.
public IGroup Group(string groupName = null, params IGroupable[] items)
Name of the new group.
itemsIGroupable[]The groups items to ungroup.
Returns:Implements:
Checks if the diagram item is in the viewport.
Determines whether [is item its own connection container override] [the specified item].
Organizes the diagram using the specified layout asynchronously.
public void LayoutAsync(LayoutType type = LayoutType.Sugiyama, object settings = null)
The layout type to apply.
settingsobjectThe settings specific to the layout type.
Loads the specified serialization string.
public void Load(string serializationValue)
The serialization value.
Load Diagram to XML file
Called when the bounds of the element change and handles diagram size updates.
protected override void OnBoundsChanged(RadPropertyChangedEventArgs e)
The event data that contains bounds change information.
Overrides:
Determines whether the delete command can be executed based on the current selection.
protected virtual void OnCanExecuteDeleteCommandOverride(object sender, CanExecuteRoutedEventArgs e)
The source of the event.
eCanExecuteRoutedEventArgsThe command execution event arguments.
Executes the delete command for the currently selected diagram items.
protected virtual void OnDeleteCommandExecutedOverride(object sender, ExecutedRoutedEventArgs e)
The source of the event.
eExecutedRoutedEventArgsThe command execution event arguments.
Called when the connector manipulation enabled property changes and updates diagram items accordingly.
Handles key down events for the diagram and processes diagram-specific keyboard shortcuts and commands.
protected virtual void OnKeyDownHandled(object sender, KeyEventArgs e)
The source of the event.
eKeyEventArgsThe key event arguments containing key information.
Handles key up events for the diagram.
protected virtual void OnKeyUpHandled(object sender, KeyEventArgs e)
The source of the event.
eKeyEventArgsThe key event arguments containing key information.
Called when the element is loaded and initializes the diagram layout and viewport.
protected override void OnLoaded()
Overrides:
Called when a mouse button is pressed down over the diagram.
protected override void OnMouseDown(MouseEventArgs e)
The mouse event arguments containing button and position information.
Overrides:
Called when the mouse moves over the diagram and delegates processing to the input behavior.
protected override void OnMouseMove(MouseEventArgs e)
The mouse event arguments containing position and button information.
Overrides:
Called when the mouse wheel is used to zoom the diagram.
protected override void OnMouseWheel(MouseEventArgs e)
The instance containing the event data.
Overrides:
Handles pan gesture events for touch-based diagram navigation and panning.
protected override void OnPanGesture(PanGestureEventArgs args)
The pan gesture event arguments containing gesture information.
Overrides:
protected virtual void OnShapeDoubleClicked(ShapeRoutedEventArgs e)
Handles zoom gesture events for touch-based diagram zooming.
protected override void OnZoomGesture(ZoomGestureEventArgs args)
The zoom gesture event arguments containing zoom information.
Overrides:
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.
public virtual void PanToPosition(Point newPosition)
The new position.
Pastes the content of the clipboard onto the diagram.
public virtual void Paste()
Prepares the container for item override.
protected virtual void PrepareConnectionContainerForItemOverride(FrameworkElement container, object item)
The container.
itemobjectThe item.
Prepares the container for item override.
protected virtual void PrepareShapeContainerForItemOverride(FrameworkElement container, object item)
The container.
itemobjectThe item.
Raises generic event.
protected virtual bool PublishDiagramEvent(DiagramEvent diagramEvent, object args)
Performs redo on the last undone action.
public void Redo()
Removes the connection.
public void RemoveConnection(IConnection connection, bool isUndoable = false)
The connection.
isUndoableboolIf set to true the action is undoable.
Implements:
Resets the theme settings for the diagram.
public void ResetTheme()
Brings the (0, 0) point into the top left corner of the view port with zoom equal to 1.
public void ResetViewport(bool useAnimation = true)
Determines whether an animation will be used.
Save Diagram to XML file
Selects all shapes in the diagram.
public void SelectAll()
Sends the items backward.
public void SendBackward(IEnumerable<IDiagramItem> items, bool isUndoable = true)
Sends the items to back.
public void SendToBack(IEnumerable<IDiagramItem> items, bool isUndoable = true)
Serializes this instance.
Organizes the diagram using the specified layout.
public void SetLayout(LayoutType type = LayoutType.Sugiyama, object settings = null)
The layout type to apply.
settingsobjectThe settings specific to the layout type.
Determines whether a property should be serialized based on the property descriptor.
public override bool? ShouldSerializeProperty(PropertyDescriptor property)
The property descriptor to check for serialization.
Returns:bool?
True if the property should be serialized; otherwise, false or null for default behavior.
Overrides:
Snaps the specified shapes.
public void TryExecuteCommand(RoutedUICommand routedUiCommand, string commandParameter = "")
Performs undo on the last action.
public void Undo()
Ungroups the specified items.
public void Ungroup(params IGroup[] groups)
The groups items to ungroup.
Implements:
Updates the rectangle selection.
Zooms in the diagram. Simulates zooming with the mouse. Performs incremental zoom taking into account previous zoom operations.
public void ZoomIn(double? factor = null, Point? targetPoint = null)
The value by which to change Zoom property. When factor is null, smaller or equal to zero the ZoomScaleFactor value will be used.
targetPointPoint?The center of the zoom. The point should be provided in viewport coordinates.
Zooms out the diagram. Simulates zooming with the mouse. Performs incremental zoom taking into account previous zoom operations.
public void ZoomOut(double? factor = null, Point? targetPoint = null)
The value by which to change Zoom property. When factor is null, smaller or equal to zero the ZoomScaleFactor value will be used.
targetPointPoint?The center of the zoom. The point should be provided in viewport coordinates.
Events
public event EventHandler BindingContextChanged
Occurs when a command is executed.
public event EventHandler<CommandEventArgs> CommandExecuted
Occurs when a connection is added.
public event EventHandler<GenericEventArgs<IConnection>> ConnectionAdded
Occurs when the connection is being added.
public event EventHandler<GenericEventArgs<IConnection>> ConnectionAdding
Occurs when connection is clicked.
public event EventHandler<GenericEventArgs<IConnection>> ConnectionClicked
Occurs when a connection has been deserialized.
public event EventHandler<SerializationEventArgs<IConnection>> ConnectionDeserialized
This event allows you to recover additional, application specific data from the serialization.
Occurs when the connection manipulation has completed.
public event EventHandler<ManipulationEventArgs> ConnectionManipulationCompleted
Occurs before the connection manipulation has started.
public event EventHandler<ManipulationEventArgs> ConnectionManipulationStarted
Occurs when a connection has been serialized.
public event EventHandler<SerializationEventArgs<IConnection>> ConnectionSerialized
This event allows you to add additional, application specific data to the serialization.
Occurs after a connector activation or deactivation.
public event EventHandler<ConnectorActivationChangedEventArgs> ConnectorActivationChanged
Occurs when the diagram has been deserialized.
public event RoutedEventHandler Deserialized
Occurs when the diagram layout has completed.
public event EventHandler<DiagramLayoutEventArgs> DiagramLayoutComplete
Occurs when an item is dragged.
public event EventHandler<DragRoutedEventArgs> Drag
Occurs when count of the groups change.
public event EventHandler<DiagramItemsChangedEventArgs> GroupsChanged
Occurs when count of the items change.
public event EventHandler<DiagramItemsChangedEventArgs> ItemsChanged
Occurs while the diagram items are changing.
public event EventHandler<DiagramItemsChangingEventArgs> ItemsChanging
Occurs when the diagram's metadata has been deserialized.
public event EventHandler<SerializationInfoEventArgs> MetadataDeserialized
The event allows you to deserialize the additional data added, if any, using the MetadataDeserialized event handler.
Occurs when the diagram's metadata has been serialized.
public event EventHandler<SerializationInfoEventArgs> MetadataSerialized
This event allows you to add additional, application specific data to the serialization.
Occurs after the diagram is panned.
public event EventHandler<PositionChangedRoutedEventArgs> Pan
Occurs when the position has changed.
public event EventHandler<PositionChangedEventArgs> PositionChanged
Occurs before an item is dragged.
public event EventHandler<DragRoutedEventArgs> PreviewDrag
Occurs before the diagram is panned.
public event EventHandler<PositionChangedRoutedEventArgs> PreviewPan
Occurs before an item is resized.
public event EventHandler<ResizeRoutedEventArgs> PreviewResize
Occurs before an item is rotated.
public event EventHandler<RoutedEventArgs> PreviewRotate
Occurs when the selection of the diagram starts changing.
public event EventHandler PreviewSelectionChanged
Occurs before the zoom has been changed.
public event EventHandler<DiagramZoomEventArgs> PreviewZoom
Occurs when an item is resized.
public event EventHandler<ResizingEventArgs> Resize
Occurs when an item is rotated.
public event EventHandler<RotateRoutedEventArgs> Rotate
Occurs when the selection bounds of the diagram changes.
public event EventHandler SelectionBoundsChanged
Occurs when the selection of the diagram changes.
public event EventHandler SelectionChanged
Occurs after the diagram has been serialized.
public event RoutedEventHandler Serialized
Occurs when shape is clicked.
public event EventHandler<ShapeRoutedEventArgs> ShapeClicked
Occurs when a shape has been deserialized.
public event EventHandler<SerializationEventArgs<IShape>> ShapeDeserialized
The event allows you to deserialize the additional data added, if any, using the ShapeSerialized event handler.
Occurs when a shape has been double-clicked.
public event EventHandler<ShapeRoutedEventArgs> ShapeDoubleClicked
Occurs when a shape has been serialized.
public event EventHandler<SerializationEventArgs<IShape>> ShapeSerialized
This event allows you to add additional, application specific data to the serialization.
Occurs when the zoom has been changed.
public event EventHandler<DiagramZoomEventArgs> ZoomChanged