RadDiagram
Represents the diagram control.
Definition
Namespace:Telerik.Windows.Controls
Assembly:Telerik.Windows.Controls.Diagrams.dll
Syntax:
[TelerikToolboxCategory("Diagram")]
[Themable]
public class RadDiagram : Control, ISupportContainerGenerator<RadDiagramItem>, IGraphInternal, IGraph, ISerializable, ISupportManipulation
Inheritance: objectRadDiagram
Implements:
Constructors
Initializes a new instance of the RadDiagram class.
public RadDiagram()
Fields
ActiveToolProperty
DependencyProperty
Identifies the ActiveTool dependency property.
public static readonly DependencyProperty ActiveToolProperty
AdditionalContentActivatedEvent
RoutedEvent
Identifies the AdditionalContentOpened routed event.
public static readonly RoutedEvent AdditionalContentActivatedEvent
AllowCopyProperty
DependencyProperty
Identifies the AllowCopy dependency property.
public static readonly DependencyProperty AllowCopyProperty
AllowCutProperty
DependencyProperty
Identifies the AllowCut dependency property.
public static readonly DependencyProperty AllowCutProperty
AllowDeleteProperty
DependencyProperty
Identifies the AllowDelete dependency property.
public static readonly DependencyProperty AllowDeleteProperty
AllowPasteProperty
DependencyProperty
Identifies the AllowPaste dependency property.
public static readonly DependencyProperty AllowPasteProperty
AutoLayoutProperty
DependencyProperty
Identifies the AutoLayout dependency property.
public static readonly DependencyProperty AutoLayoutProperty
CommandExecutedEvent
RoutedEvent
Identifies the CommandExecuted routed event.
public static readonly RoutedEvent CommandExecutedEvent
ConnectionBridgeProperty
DependencyProperty
Identifies the Position dependency property.
public static readonly DependencyProperty ConnectionBridgeProperty
ConnectionDeserializedEvent
RoutedEvent
Identifies the ConnectionDeserialized routed event.
public static readonly RoutedEvent ConnectionDeserializedEvent
ConnectionEditTemplateProperty
DependencyProperty
Identifies the ConnectionEditTemplate dependency property.
public static readonly DependencyProperty ConnectionEditTemplateProperty
ConnectionEditTemplateSelectorProperty
DependencyProperty
Identifies the ConnectionEditTemplateSelector dependency property.
public static readonly DependencyProperty ConnectionEditTemplateSelectorProperty
ConnectionManipulationCompletedEvent
RoutedEvent
Identifies the ConnectionManipulationCompleted routed event.
public static readonly RoutedEvent ConnectionManipulationCompletedEvent
ConnectionManipulationStartedEvent
RoutedEvent
Identifies the ConnectionManipulationStartedEvent routed event.
public static readonly RoutedEvent ConnectionManipulationStartedEvent
ConnectionRoundedCornersProperty
DependencyProperty
Identifies the RoundedCorners dependency property.
public static readonly DependencyProperty ConnectionRoundedCornersProperty
ConnectionSerializedEvent
RoutedEvent
Identifies the ConnectionSerialized routed event.
public static readonly RoutedEvent ConnectionSerializedEvent
ConnectionStyleProperty
DependencyProperty
Identifies the ConnectionStyle dependency property.
public static readonly DependencyProperty ConnectionStyleProperty
ConnectionStyleSelectorProperty
DependencyProperty
Identifies the ConnectionStyleSelector dependency property.
public static readonly DependencyProperty ConnectionStyleSelectorProperty
ConnectionTemplateProperty
DependencyProperty
Identifies the ConnectionTemplate dependency property.
public static readonly DependencyProperty ConnectionTemplateProperty
ConnectionTemplateSelectorProperty
DependencyProperty
Identifies the ConnectionTemplateSelector dependency property.
public static readonly DependencyProperty ConnectionTemplateSelectorProperty
ConnectorActivationChangedEvent
RoutedEvent
Identifies the ConnectorActivationChanged routed event.
public static readonly RoutedEvent ConnectorActivationChangedEvent
ConnectorStyleProperty
DependencyProperty
Identifies the ConnectorStyle dependency property.
public static readonly DependencyProperty ConnectorStyleProperty
ContainerShapeStyleProperty
DependencyProperty
Identifies the ContainerShapeStyle dependency property.
public static readonly DependencyProperty ContainerShapeStyleProperty
DeserializedEvent
RoutedEvent
Identifies the Deserialized routed event.
public static readonly RoutedEvent DeserializedEvent
DiagramLayoutCompletedEvent
RoutedEvent
Identifies the DiagramLayoutComplete routed event.
public static readonly RoutedEvent DiagramLayoutCompletedEvent
DisplayMemberPathProperty
DependencyProperty
Identifies the DisplayMemberPath dependency property.
public static readonly DependencyProperty DisplayMemberPathProperty
DragEvent
RoutedEvent
Identifies the DragEvent routed event.
public static readonly RoutedEvent DragEvent
GraphSourceProperty
DependencyProperty
Identifies the GraphSource dependency property.
public static readonly DependencyProperty GraphSourceProperty
GroupsChangedEvent
RoutedEvent
Identifies the ItemsChanged routed event.
public static readonly RoutedEvent GroupsChangedEvent
GroupStyleProperty
DependencyProperty
Identifies the SelectedGroupBrush dependency property.
public static readonly DependencyProperty GroupStyleProperty
IsAdditionalContentVisibleProperty
DependencyProperty
Identifies the IsAdditionalContentVisible dependency property.
public static readonly DependencyProperty IsAdditionalContentVisibleProperty
IsBackgroundSurfaceVisibleProperty
DependencyProperty
Identifies the IsBackgroundSurfaceVisible dependency property.
public static readonly DependencyProperty IsBackgroundSurfaceVisibleProperty
IsConnectorsManipulationEnabledProperty
DependencyProperty
Identifies the IsConnectorsManipulationEnabled dependency property.
public static readonly DependencyProperty IsConnectorsManipulationEnabledProperty
IsDraggingEnabledProperty
DependencyProperty
Identifies the IsDraggingEnabled dependency property.
public static readonly DependencyProperty IsDraggingEnabledProperty
IsEditableProperty
DependencyProperty
Identifies the IsEditable dependency property.
public static readonly DependencyProperty IsEditableProperty
IsInformationAdornerVisibleProperty
DependencyProperty
Identifies the IsInformationAdornerVisible dependency property.
public static readonly DependencyProperty IsInformationAdornerVisibleProperty
IsManipulationAdornerVisibleProperty
DependencyProperty
Identifies the IsManipulationAdornerVisible dependency property.
public static readonly DependencyProperty IsManipulationAdornerVisibleProperty
IsPanEnabledProperty
DependencyProperty
Identifies the IsPanEnabled dependency property.
public static readonly DependencyProperty IsPanEnabledProperty
IsResizingEnabledProperty
DependencyProperty
Identifies the IsResizingEnabled dependency property.
public static readonly DependencyProperty IsResizingEnabledProperty
IsRotationEnabledProperty
DependencyProperty
Identifies the IsRotationEnabled dependency property.
public static readonly DependencyProperty IsRotationEnabledProperty
IsSnapToGridEnabledProperty
DependencyProperty
Identifies the IsSnapEnabled dependency property.
public static readonly DependencyProperty IsSnapToGridEnabledProperty
IsSnapToItemsEnabledProperty
DependencyProperty
Identifies the IsSnapToItemsEnabled dependency property.
public static readonly DependencyProperty IsSnapToItemsEnabledProperty
IsZoomEnabledProperty
DependencyProperty
Identifies the IsZoomEnabled dependency property.
public static readonly DependencyProperty IsZoomEnabledProperty
ItemsChangedEvent
RoutedEvent
Identifies the ItemsChanged routed event.
public static readonly RoutedEvent ItemsChangedEvent
ItemsChangingEvent
RoutedEvent
Identifies the ItemsChanging routed event.
public static readonly RoutedEvent ItemsChangingEvent
ItemsProperty
DependencyProperty
Identifies the Items dependency property.
public static readonly DependencyProperty ItemsProperty
MetadataDeserializedEvent
RoutedEvent
Identifies the MetadataDeserialized routed event.
public static readonly RoutedEvent MetadataDeserializedEvent
MetadataSerializedEvent
RoutedEvent
Identifies the MetadataSerialized routed event.
public static readonly RoutedEvent MetadataSerializedEvent
PanEvent
RoutedEvent
Identifies the PreviewPan routed event.
public static readonly RoutedEvent PanEvent
PositionChangedEvent
RoutedEvent
Identifies the PositionChanged routed event.
public static readonly RoutedEvent PositionChangedEvent
PositionProperty
DependencyProperty
Identifies the Position dependency property.
public static readonly DependencyProperty PositionProperty
PreviewAdditionalContentActivatedEvent
RoutedEvent
Identifies the PreviewAdditionalContentOpened routed event.
public static readonly RoutedEvent PreviewAdditionalContentActivatedEvent
PreviewDragEvent
RoutedEvent
Identifies the PreviewDrag routed event.
public static readonly RoutedEvent PreviewDragEvent
PreviewPanEvent
RoutedEvent
Identifies the PreviewPan routed event.
public static readonly RoutedEvent PreviewPanEvent
PreviewResizeEvent
RoutedEvent
Identifies the PreviewResize routed event.
public static readonly RoutedEvent PreviewResizeEvent
PreviewRotateEvent
RoutedEvent
Identifies the PreviewRotate routed event.
public static readonly RoutedEvent PreviewRotateEvent
PreviewSelectionChangedEvent
RoutedEvent
Identifies the PreviewSelectionChanged routed event.
public static readonly RoutedEvent PreviewSelectionChangedEvent
PreviewZoomEvent
RoutedEvent
Identifies the PreviewZoom routed event.
public static readonly RoutedEvent PreviewZoomEvent
RectSelectionModeProperty
DependencyProperty
Identifies the RectSelectionMode dependency property.
public static readonly DependencyProperty RectSelectionModeProperty
ResizeEvent
RoutedEvent
Identifies the Resize routed event.
public static readonly RoutedEvent ResizeEvent
RotateEvent
RoutedEvent
Identifies the Rotate routed event.
public static readonly RoutedEvent RotateEvent
RouteConnectionsProperty
DependencyProperty
Identifies the RouteConnections dependency property.
public static readonly DependencyProperty RouteConnectionsProperty
SelectedEvent
RoutedEvent
Identifies the Selected routed event.
public static readonly RoutedEvent SelectedEvent
SelectedIndexProperty
DependencyProperty
Identifies the SelectedIndex dependency property.
public static readonly DependencyProperty SelectedIndexProperty
SelectedItemProperty
DependencyProperty
Identifies the SelectedItem dependency property.
public static readonly DependencyProperty SelectedItemProperty
SelectionChangedEvent
RoutedEvent
Identifies the SelectionChanged routed event.
public static readonly RoutedEvent SelectionChangedEvent
SelectionModeProperty
DependencyProperty
Identifies the SelectionMode dependency property.
public static readonly DependencyProperty SelectionModeProperty
SelectionRectangleStyleProperty
DependencyProperty
Identifies the SelectionRectangleStyle dependency property.
public static readonly DependencyProperty SelectionRectangleStyleProperty
SerializedEvent
RoutedEvent
Identifies the Serialized routed event.
public static readonly RoutedEvent SerializedEvent
ShapeClickedEvent
RoutedEvent
Identifies the ShapeClicked routed event.
public static readonly RoutedEvent ShapeClickedEvent
ShapeDeserializedEvent
RoutedEvent
Identifies the ShapeDeserialized routed event.
public static readonly RoutedEvent ShapeDeserializedEvent
ShapeDoubleClickedEvent
RoutedEvent
Identifies the ShapeDoubleClicked routed event.
public static readonly RoutedEvent ShapeDoubleClickedEvent
ShapeEditTemplateProperty
DependencyProperty
Identifies the ShapeEditTemplate dependency property.
public static readonly DependencyProperty ShapeEditTemplateProperty
ShapeEditTemplateSelectorProperty
DependencyProperty
Identifies the ShapeEditTemplateSelector dependency property.
public static readonly DependencyProperty ShapeEditTemplateSelectorProperty
ShapeSerializedEvent
RoutedEvent
Identifies the ShapeSerialized routed event.
public static readonly RoutedEvent ShapeSerializedEvent
ShapeStyleProperty
DependencyProperty
Identifies the ShapeStyle dependency property.
public static readonly DependencyProperty ShapeStyleProperty
ShapeStyleSelectorProperty
DependencyProperty
Identifies the ShapeStyleSelector dependency property.
public static readonly DependencyProperty ShapeStyleSelectorProperty
ShapeTemplateProperty
DependencyProperty
Identifies the ShapeTemplate dependency property.
public static readonly DependencyProperty ShapeTemplateProperty
ShapeTemplateSelectorProperty
DependencyProperty
Identifies the ShapeTemplateSelector dependency property.
public static readonly DependencyProperty ShapeTemplateSelectorProperty
SnapXProperty
DependencyProperty
Identifies the SnapX dependency property.
public static readonly DependencyProperty SnapXProperty
SnapYProperty
DependencyProperty
Identifies the SnapY dependency property.
public static readonly DependencyProperty SnapYProperty
SupportTouchGesturesProperty
DependencyProperty
Identifies the SupportTouchGestures dependency property.
public static readonly DependencyProperty SupportTouchGesturesProperty
UnselectedEvent
RoutedEvent
Identifies the Unselected routed event.
public static readonly RoutedEvent UnselectedEvent
ViewportProperty
DependencyProperty
Identifies the Viewport dependency property.
public static readonly DependencyProperty ViewportProperty
ZoomChangedEvent
RoutedEvent
Identifies the ZoomChanged routed event.
public static readonly RoutedEvent ZoomChangedEvent
ZoomProperty
DependencyProperty
Identifies the Zoom dependency property.
public static readonly DependencyProperty ZoomProperty
Properties
Gets or sets the tool which is active when interacting with the diagram elements.
public MouseTool ActiveTool { 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 or sets the connection bridge type.
public BridgeType ConnectionBridge { get; set; }
Implements:
ConnectionEditTemplate
DataTemplate
Gets or sets the connection edit template.
public DataTemplate ConnectionEditTemplate { get; set; }
The connection edit template.
ConnectionEditTemplateSelector
DataTemplateSelector
Gets or sets the connection edit template selector.
public DataTemplateSelector ConnectionEditTemplateSelector { get; set; }
The connection edit template selector.
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:
ConnectionStyle
Style
Gets or sets the connection style.
public Style ConnectionStyle { get; set; }
The connection style.
ConnectionStyleSelector
StyleSelector
Gets or sets the connection style selector.
public StyleSelector ConnectionStyleSelector { get; set; }
The connection style selector.
ConnectionTemplate
DataTemplate
Gets or sets the connection template.
public DataTemplate ConnectionTemplate { get; set; }
The connection template.
ConnectionTemplateSelector
DataTemplateSelector
Gets or sets the connection template selector.
public DataTemplateSelector ConnectionTemplateSelector { get; set; }
The connection template selector.
ConnectorStyle
Style
Gets or sets the connector style.
public Style ConnectorStyle { get; set; }
The connector style.
Gets the container generator.
public IContainerGenerator<RadDiagramItem> ContainerGenerator { get; }
ContainerShapeStyle
Style
Gets or sets the container shape style.
public Style ContainerShapeStyle { get; set; }
The container shape style.
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:
GroupStyle
Style
Gets or sets the Style for the groups adorner. It is shown when a group is selected.
public Style GroupStyle { 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 a value indicating whether the additional content visible.
public bool IsAdditionalContentVisible { get; }
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 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:
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 diagramming items.
public DiagramItemCollection Items { get; }
The items.
Implements:
Gets the diagram metadata.
public DiagramMetadata Metadata { get; }
Implements:
Position
Point
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 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; }
Gets the selected items.
public IEnumerable<object> SelectedItems { get; }
SelectionBounds
Rect
Gets the starting selection bounds.
public Rect SelectionBounds { get; }
Gets or sets the selection mode.
public SelectionMode SelectionMode { get; set; }
Implements:
Gets or sets the style of the selection rectangle.
public Style SelectionRectangleStyle { get; set; }
Gets the service locator.
public IServiceLocator ServiceLocator { get; }
Implements:
ShapeEditTemplate
DataTemplate
Gets or sets the shape edit template.
public DataTemplate ShapeEditTemplate { get; set; }
The shape edit template.
ShapeEditTemplateSelector
DataTemplateSelector
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:
ShapeStyle
Style
Gets or sets the shape style.
public Style ShapeStyle { get; set; }
The shape style.
ShapeStyleSelector
StyleSelector
Gets or sets the shape style selector.
public StyleSelector ShapeStyleSelector { get; set; }
The shape style selector.
ShapeTemplate
DataTemplate
Gets or sets the shape template.
public DataTemplate ShapeTemplate { get; set; }
The shape template.
ShapeTemplateSelector
DataTemplateSelector
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 or sets a value indicating whether the touch gestures are enabled by default.
public bool SupportTouchGestures { get; set; }
Gets the undo redo service.
public IUndoRedoService UndoRedoService { get; }
Viewport
Rect
Gets the bounds of the viewport.
public Rect Viewport { get; }
Implements:
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 a shape with image content.
Adds the given shape to the diagram.
Adds a new shape to the diagram.
public IShape AddShape(object content, ArrowShapeType type, Point? position = null, bool isUndoable = false)
The content of the shape.
typeArrowShapeTypeThe common shape type.
positionPoint?The position.
isUndoableboolIf set to true the addition will be recorded as 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.
Adds a new shape to the diagram.
public IShape AddShape(object content, CommonShapeType type, Point? position = null, bool isUndoable = false)
The content of the shape.
typeCommonShapeTypeThe common shape type.
positionPoint?The position.
isUndoableboolIf set to true the addition will be recorded as 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.
Adds a new shape to the diagram.
public IShape AddShape(object content, FlowChartShapeType type, Point? position = null, bool isUndoable = false)
The content of the shape.
typeFlowChartShapeTypeThe common shape type.
positionPoint?The position.
isUndoableboolIf set to true the addition will be recorded as 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.
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.
Aligns the given shapes.
public void Align(Alignment alignment, IEnumerable<IShape> shapes)
Zoom and pans the diagram in such a way that all items will fit into the currently visible area of the canvas.
public 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.
public void AutoFit(Thickness margin, bool useAnimation = true)
The margin to be used as whitespace border around the diagram items.
useAnimationboolDetermines whether animations should be used.
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.
public void AutoFitAsync(Thickness margin, bool useAnimation = true)
The margin to be used as whitespace border around the diagram items.
useAnimationboolDetermines whether animations should be used.
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.
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()
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:
Exports the Diagram into png or bmp.
Exports an image of the given element to stream using the specified bitmap encoder.
public void ExportToImage(Stream stream, BitmapEncoder encoder = null, Rect? enclosingBounds = null, Size returnImageSize = null, Brush backgroundBrush = null, Thickness margin = null, double dpi = 96)
The stream to write the image to.
encoderBitmapEncoderThe bitmap encoder. If none is specified the will be used.
enclosingBoundsRect?The bound of the diagram which should be exported.
returnImageSizeSizeThe size of the exported image.
backgroundBrushBrushThe background brush to use.
marginThicknessThe margin around the exported image.
dpidoubleThe quality of the image.
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.
public void Layout(LayoutType type = LayoutType.Sugiyama, object settings = null)
The layout type to apply.
settingsobjectThe settings specific to the layout type.
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.
When overridden in a derived class, is invoked whenever application code or internal processes call .
public override void OnApplyTemplate()
Called on can execute delete command.
protected virtual void OnCanExecuteDeleteCommandOverride(object sender, CanExecuteRoutedEventArgs e)
OnCreateAutomationPeer()
AutomationPeer
Creates a peer associated with this object.
protected override AutomationPeer OnCreateAutomationPeer()
AutomationPeer
An instance of the .
Called when delete command is executed.
protected virtual void OnDeleteCommandExecutedOverride(object sender, ExecutedRoutedEventArgs e)
Raises the event. This method is invoked whenever is set to true internally.
protected override void OnInitialized(EventArgs e)
The RoutedEventArgs that contains the event data.
protected virtual void OnKeyDownHandled(object sender, KeyEventArgs e)
protected virtual void OnKeyUpHandled(object sender, KeyEventArgs e)
Called before the event occurs.
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
The data for the event.
Called before the event occurs.
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
The data for the event.
Called before the event occurs.
protected override void OnMouseMove(MouseEventArgs e)
The data for the event.
Called when the mouse wheel is used to zoom the diagram.
protected override void OnMouseWheel(MouseWheelEventArgs e)
The MouseWheelEventArgs instance containing the event data.
Called when the Position property changes.
protected virtual void OnPositionChanged(Point oldPosition, Point newPosition)
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.
Print the diagram.
public bool Print(RadDiagramPrintSettings printSettings = null)
The print settings.
Returns:True when the printing is successful, False otherwise.
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.
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.
Saves the diagram.
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.
Snaps the specified shapes.
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.
protected void UpdateRectSelection(Rect bounds)
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, bool useAnimation = true)
The value by which to change Zoom property.
targetPointPoint?The center of the zoom. The point should be provided in viewport coordinates.
useAnimationboolDetermines whether animation should be used.
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, bool useAnimation = true)
The value by which to change Zoom property.
targetPointPoint?The center of the zoom. The point should be provided in viewport coordinates.
useAnimationboolDetermines whether animation should be used.
Events
Occurs when AdditionContent is activated.
public event EventHandler<AdditionalContentActivatedEventArgs> AdditionalContentActivated
Occurs when a command is executed.
public event EventHandler<CommandRoutedEventArgs> CommandExecuted
Occurs when a connection has been deserialized.
public event EventHandler<ConnectionSerializationRoutedEventArgs> ConnectionDeserialized
This event allows you to recover additional, application specific data from the serialization.
Occurs when the connection manipulation has completed.
public event EventHandler<ManipulationRoutedEventArgs> ConnectionManipulationCompleted
Occurs before the connection manipulation has started.
public event EventHandler<ManipulationRoutedEventArgs> ConnectionManipulationStarted
Occurs when a connection has been serialized.
public event EventHandler<ConnectionSerializationRoutedEventArgs> 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 RadRoutedEventHandler Deserialized
DiagramLayoutComplete
RoutedEventHandler
Occurs when the diagram layout has completed.
public event RoutedEventHandler DiagramLayoutComplete
Occurs when an item is dragged.
public event EventHandler<DragRoutedEventArgs> Drag
Occurs when the graph source has changed.
public event EventHandler GraphSourceChanged
Occurs when the graph source begins changing.
public event EventHandler GraphSourceChanging
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<DiagramSerializationRoutedEventArgs> 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<DiagramSerializationRoutedEventArgs> 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<PositionChangedRoutedEventArgs> PositionChanged
Occurs when AdditionContent is about to be activated.
public event EventHandler<AdditionalContentActivatedEventArgs> PreviewAdditionalContentActivated
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<RadRoutedEventArgs> PreviewRotate
PreviewSelectionChanged
SelectionChangedEventHandler
Occurs when the selection of the diagram starts changing.
public event SelectionChangedEventHandler PreviewSelectionChanged
Occurs before the zoom has been changed.
public event EventHandler<DiagramZoomEventArgs> PreviewZoom
Occurs when an item is resized.
public event EventHandler<ResizeRoutedEventArgs> 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
SelectionChanged
SelectionChangedEventHandler
Occurs when the selection of the diagram changes.
public event SelectionChangedEventHandler SelectionChanged
Occurs after the diagram has been serialized.
public event RadRoutedEventHandler Serialized
Occurs when shape is clicked.
public event EventHandler<ShapeRoutedEventArgs> ShapeClicked
Occurs when a shape has been deserialized.
public event EventHandler<ShapeSerializationRoutedEventArgs> 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<ShapeSerializationRoutedEventArgs> ShapeSerialized
This event allows you to add additional, application specific data to the serialization.
ViewportChanged
EventHandler<PropertyEventArgs<Rect>>
Occurs when the viewport has changed.
public event EventHandler<PropertyEventArgs<Rect>> ViewportChanged
Occurs when [children changed].
public event EventHandler VisualChildrenChanged
ZoomChanged
EventHandler<RadRoutedPropertyChangedEventArgs<double>>
Occurs when the zoom has been changed.
public event EventHandler<RadRoutedPropertyChangedEventArgs<double>> ZoomChanged