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