New to Telerik UI for WPFStart a free 30-day trial

The RadDiagramConnection is a special ContentControl that serves as a connection between zero, one or two shapes.

Definition

Namespace:Telerik.Windows.Controls

Assembly:Telerik.Windows.Controls.Diagrams.dll

Syntax:

C#
[Themable]
[TelerikToolboxCategory("Diagram")]
public class RadDiagramConnection : RadDiagramItem, IConnection, IDiagramItem, ISerializable, ISupportMouseOver, IPropertyChanged, IGroupable, ISupportManipulation, ISupportVirtualization, IContainerChild, ICollapsible

Inheritance: objectRadDiagramItemRadDiagramConnection

Implements: ICollapsibleIConnectionIContainerChildIDiagramItemIGroupableIPropertyChangedISerializableISupportManipulationISupportMouseOverISupportVirtualization...

Inherited Members RadDiagramItem.ZIndexPropertyRadDiagramItem.IsSelectedPropertyRadDiagramItem.PositionPropertyRadDiagramItem.IsInEditModePropertyRadDiagramItem.IsEditablePropertyRadDiagramItem.EditTemplatePropertyRadDiagramItem.StrokePropertyRadDiagramItem.StrokeThicknessPropertyRadDiagramItem.StrokeDashArrayPropertyRadDiagramItem.GroupPropertyRadDiagramItem.IsResizingEnabledPropertyRadDiagramItem.IsRotationEnabledPropertyRadDiagramItem.IsDraggingEnabledPropertyRadDiagramItem.IsConnectorsManipulationEnabledPropertyRadDiagramItem.IsManipulationAdornerVisiblePropertyRadDiagramItem.AllowDeletePropertyRadDiagramItem.AllowCutPropertyRadDiagramItem.AllowCopyPropertyRadDiagramItem.AllowPastePropertyRadDiagramItem.PreviewBeginEditEventRadDiagramItem.BeginEditEventRadDiagramItem.PreviewEndEditEventRadDiagramItem.EndEditEventRadDiagramItem.UpdateVisualStates()RadDiagramItem.Initialize(IGraphServiceLocator, IGraphInternal)RadDiagramItem.OnPropertyChanged(string)RadDiagramItem.OnIsEditableChanged(bool, bool)RadDiagramItem.OnSizeChanged(Size, Size)RadDiagramItem.OnGroupNameChanged()RadDiagramItem.OnPositionChanged(Point, Point)RadDiagramItem.IsSelectedRadDiagramItem.ParentGroupRadDiagramItem.ParentContainerRadDiagramItem.IsInEditModeRadDiagramItem.IsEditableRadDiagramItem.ZIndexRadDiagramItem.PositionRadDiagramItem.XRadDiagramItem.YRadDiagramItem.IsDynamicRadDiagramItem.IdRadDiagramItem.EditTemplateRadDiagramItem.StrokeRadDiagramItem.StrokeThicknessRadDiagramItem.StrokeDashArrayRadDiagramItem.IsRotationEnabledRadDiagramItem.IsResizingEnabledRadDiagramItem.IsDraggingEnabledRadDiagramItem.IsConnectorsManipulationEnabledRadDiagramItem.IsManipulationAdornerVisibleRadDiagramItem.AllowDeleteRadDiagramItem.AllowCutRadDiagramItem.AllowCopyRadDiagramItem.AllowPasteRadDiagramItem.IsSelectedInGroupRadDiagramItem.DiagramRadDiagramItem.ServiceLocatorRadDiagramItem.ActualSizeRadDiagramItem.IsServiceManipulationRadDiagramItem.PropertyChangedRadDiagramItem.ParentGroupChangedRadDiagramItem.PreviewBeginEditRadDiagramItem.BeginEditRadDiagramItem.PreviewEndEditRadDiagramItem.EndEdit...

Constructors

Initializes a new instance of the RadDiagramConnection class.

C#
public RadDiagramConnection()

Fields

BezierTensionProperty

DependencyProperty

Identifies the BezierTensionProperty dependency property.

C#
public static readonly DependencyProperty BezierTensionProperty

ConnectionTypeProperty

DependencyProperty

Identifies the ConnectionType dependency property.

C#
public static readonly DependencyProperty ConnectionTypeProperty

EndPointProperty

DependencyProperty

Identifies the EndPoint dependency property.

C#
public static readonly DependencyProperty EndPointProperty

Identifies the IsAutoUpdateSuppressedProperty.

C#
public static readonly DependencyProperty IsAutoUpdateSuppressedProperty

RouteProperty

DependencyProperty

Identifies the RouteProperty property.

C#
public static readonly DependencyProperty RouteProperty

SourceCapSizeProperty

DependencyProperty

Identifies the SourceCapSize dependency property.

C#
public static readonly DependencyProperty SourceCapSizeProperty

SourceCapTypeProperty

DependencyProperty

Identifies the SourceCapType dependency property.

C#
public static readonly DependencyProperty SourceCapTypeProperty

Identifies the SourceConnectorPosition dependency property.

C#
public static readonly DependencyProperty SourceConnectorPositionProperty

SourceProperty

DependencyProperty

Identifies the Source dependency property.

C#
public static readonly DependencyProperty SourceProperty

StartPointProperty

DependencyProperty

Identifies the StartPoint dependency property.

C#
public static readonly DependencyProperty StartPointProperty

TargetCapSizeProperty

DependencyProperty

Identifies the TargetCapSize dependency property.

C#
public static readonly DependencyProperty TargetCapSizeProperty

TargetCapTypeProperty

DependencyProperty

Identifies the TargetCapType dependency property.

C#
public static readonly DependencyProperty TargetCapTypeProperty

Identifies the TargetConnectorPosition dependency property.

C#
public static readonly DependencyProperty TargetConnectorPositionProperty

TargetProperty

DependencyProperty

Identifies the TargetProperty dependency property.

C#
public static readonly DependencyProperty TargetProperty

UseFreeConnectorsProperty

DependencyProperty

Identifies the UseFreeConnectors property.

C#
public static readonly DependencyProperty UseFreeConnectorsProperty

Properties

The connection adorner which helps manipulating this connection.

C#
public ConnectionManipulationAdorner Adorner { get; set; }

Gets or sets the Bezier tension.

C#
public double BezierTension { get; set; }
Property Value:

A value or zero turns the Bezier connection into a straight line, a value of one and above increase the sharpness of the Bezier curve.

Implements: IConnection.BezierTension

Bounds

Rect

Gets the bounds.

C#
public override Rect Bounds { get; }
Property Value:

The bounds.

Overrides: RadDiagramItem.Bounds

Implements: IDiagramItem.Bounds

Gets the connection points of the connection.

C#
public IList<Point> ConnectionPoints { get; }

Implements: IConnection.ConnectionPoints

Remarks:

The positions are absolute coordinates with respect to the canvas.

Gets or sets the type of the connection.

C#
public ConnectionType ConnectionType { get; set; }
Property Value:

The type of the connection.

Implements: IConnection.ConnectionType

Gets or sets the position of where this connection ends.

C#
public Point EndPoint { get; set; }

Implements: IConnection.EndPoint

Geometry

Geometry

Gets the geometry of the connection.

C#
public Geometry Geometry { get; }

Implements: IConnection.Geometry

Gets or sets a value indicating whether the connection has been modified.

C#
public bool IsModified { get; set; }

Implements: IConnection.IsModified

Remarks:
  • This property is set to true as soon as you add/remove intermediate points or manually move one of the Bezier handles. This means that the automatically calculated handle positions in function of the connector will be halted. You re-enable this auto-handle calculation by re-setting this property to false.
  • If this property is true the connection won't be routed and no automatic reflexive points will be added. You can re-enable this by re-setting this property to false.

Gets the manipulation points, which are equal to the adorner's connection editing points.

C#
public IList<IConnectionEditPoint> ManipulationPoints { get; }

Implements: IConnection.ManipulationPoints

Gets or sets whether this connection will be automatically routed.

C#
public bool Route { get; set; }

Implements: IConnection.Route

Remarks:

Setting this property effects only Spline and Polyline connections.

Gets the number of segments this connection has.

C#
public int SegmentCount { get; }

Gets or sets the source.

C#
public IShape Source { get; set; }
Property Value:

The source.

Implements: IConnection.Source

Gets or sets the size of the source cap.

C#
public Size SourceCapSize { get; set; }
Property Value:

The size of the source cap.

Implements: IConnection.SourceCapSize

Gets or sets the type of the source cap.

C#
public CapType SourceCapType { get; set; }
Property Value:

The type of the source cap.

Implements: IConnection.SourceCapType

Gets or sets the source connector position.

C#
public string SourceConnectorPosition { get; set; }
Property Value:

The source connector position.

Implements: IConnection.SourceConnectorPosition

Gets the source connector result.

C#
public IConnector SourceConnectorResult { get; }

Implements: IConnection.SourceConnectorResult

Gets or sets the position of where this connection starts.

C#
public Point StartPoint { get; set; }

Implements: IConnection.StartPoint

Gets or sets the target.

C#
public IShape Target { get; set; }
Property Value:

The target.

Implements: IConnection.Target

Gets or sets the size of the target cap.

C#
public Size TargetCapSize { get; set; }
Property Value:

The size of the target cap.

Implements: IConnection.TargetCapSize

Gets or sets the type of the target cap.

C#
public CapType TargetCapType { get; set; }
Property Value:

The type of the target cap.

Implements: IConnection.TargetCapType

Gets or sets the target connector position.

C#
public string TargetConnectorPosition { get; set; }
Property Value:

The target connector position.

Implements: IConnection.TargetConnectorPosition

Gets the target connector result.

C#
public IConnector TargetConnectorResult { get; }

Implements: IConnection.TargetConnectorResult

Gets or sets whether this connection will choose free connectors when attaching to shape with Source or TargetConnectorPosition Auto.

C#
public bool UseFreeConnectors { get; set; }

Implements: IConnection.UseFreeConnectors

Methods

Adds an intermediate connection point.

C#
public void AddConnectionPoint(Point point)
Parameters:pointPoint

The (absolute canvas) position at which the new connection point should be added.

Implements: IConnection.AddConnectionPoint(Point)

Attaches the connection to specific source and target.

C#
public void Attach(IConnector source = null, IConnector target = null)
Parameters:sourceIConnector

The source.

targetIConnector

The target.

Implements: IConnection.Attach(IConnector, IConnector)

Invoked on connection type changed.

C#
protected virtual void ConnectionTypeChanged(ConnectionType newValue, ConnectionType oldValue)
Parameters:newValueConnectionType

The new value.

oldValueConnectionType

The old value.

Creates the connection's geometry.

C#
protected virtual Geometry CreateGeometry(BridgeType bridgeType, bool roundedCorners)
Parameters:bridgeTypeBridgeTyperoundedCornersboolReturns:

Geometry

Creates the source cap geometry.

C#
protected virtual PathFigure CreateSourceCapGeometry(Point startPoint, Point endPoint, ref Point baseLineStart)
Parameters:startPointPoint

The start point.

endPointPoint

The end point.

baseLineStartPoint

The new start of the base line.

Returns:

PathFigure

Creates the target cap geometry.

C#
protected virtual PathFigure CreateTargetCapGeometry(Point startPoint, Point endPoint, ref Point baseLineEnd)
Parameters:startPointPoint

The start point.

endPointPoint

The end point.

baseLineEndPoint

The new end of the base line.

Returns:

PathFigure

Deserializes the serialization info in this diagram entity.

C#
public override void Deserialize(SerializationInfo info)
Parameters:infoSerializationInfo

A SerializationInfo instance.

Overrides: RadDiagramItem.Deserialize(SerializationInfo)

Implements: ISerializable.Deserialize(SerializationInfo)

Returns all connections below or above the current connection that intersect with the given bounds.

C#
public IList<IConnection> FetchZConnections(bool below, Rect? bounds = null)
Parameters:belowbool

If set to true the connections below current one will be returned, otherwise the ones above.

boundsRect?

The bounds. If null the connection's Bounds are used.

Returns:

IList<IConnection>

Returns the information related to the crossing of this connection with other connections.

C#
public CrossingsData GetCrossings()
Returns:

CrossingsData

Implements: IConnection.GetCrossings()

Remarks:
  • The positions in the returned data are local coordinates with respect to the bounding rectangle of this connection.
  • The returned data contains a collection of points for each segment. This collection starts with the startpoint of the segment and ends with the endpoint of the segment. If there is a gap or crossing then for each gap a pair of points will denote the begin/end of the gap. So, each segment collection has always at least two points.

Gets the IsUpdateNeeded.

C#
public static bool GetIsAutoUpdateSuppressed(DependencyObject obj)
Parameters:objDependencyObjectReturns:

bool

Inserts the connection point after the specific index.

C#
public void InsertConnectionPoint(Point point, int after)
Parameters:pointPoint

The point to add.

afterint

The index after which it will be positioned.

Implements: IConnection.InsertConnectionPoint(Point, int)

Remarks:

The zero-position corresponds to the source points, the first position is the first intermediate point and the last index is the target point.

When overridden in a derived class, is invoked whenever application code or internal processes (such as a rebuilding layout pass) call . In simplest terms, this means the method is called just before a UI element displays in an application. For more information, see Remarks.

C#
public override void OnApplyTemplate()

Overrides: RadDiagramItem.OnApplyTemplate()

Creates a peer associated with this object.

C#
protected override AutomationPeer OnCreateAutomationPeer()
Returns:

AutomationPeer

An instance of the .

Overrides: RadDiagramItem.OnCreateAutomationPeer()

Called on end point changed.

C#
protected virtual void OnEndPointChanged(Point newValue, Point oldValue)
Parameters:newValuePoint

The new value.

oldValuePoint

The old value.

This virtual method in called when IsInitialized is set to true and it raises an Initialized event.

C#
protected override void OnInitialized(EventArgs e)
Parameters:eEventArgs

Called when connectors manipulation changes.

C#
protected override void OnIsConnectorsManipulationEnabledChanged(bool newValue, bool oldValue)
Parameters:newValuebool

The new value.

oldValuebool

The old value.

Overrides: RadDiagramItem.OnIsConnectorsManipulationEnabledChanged(bool, bool)

Called when IsInEditMode changes.

C#
protected override void OnIsInEditModeChanged(bool oldIsInEditMode, bool isInEditMode)
Parameters:oldIsInEditModebool

The old value of the property.

isInEditModebool

The current value of the property.

Overrides: RadDiagramItem.OnIsInEditModeChanged(bool, bool)

Called when the IsSelected property has changed.

C#
protected override void OnIsSelectedChanged(bool oldValue, bool newValue)
Parameters:oldValuebool

The old value of the IsSelected property.

newValuebool

The new value of the IsSelected property.

Overrides: RadDiagramItem.OnIsSelectedChanged(bool, bool)

Called when [position coerced].

C#
protected override object OnPositionCoerced(Point position)
Parameters:positionPoint

The new position.

Returns:

object

Overrides: RadDiagramItem.OnPositionCoerced(Point)

Called when route changed property change.

C#
protected virtual void OnRouteChanged(bool newValue, bool oldValue)
Parameters:newValuebool

The new value.

oldValuebool

The old value.

Called when the source of the RadDiagramConnection is changed.

C#
protected virtual void OnSourceChanged()

Called when on source connector position changed.

C#
protected virtual void OnSourceConnectorPositionChanged(string newPosition, string oldPosition)
Parameters:newPositionstring

The new position.

oldPositionstring

The old position.

Called on start point changed.

C#
protected virtual void OnStartPointChanged(Point newValue, Point oldValue)
Parameters:newValuePoint

The new value.

oldValuePoint

The old value.

Invoked when the StrokeThickness property has changed.

C#
protected override void OnStrokeThicknessChanged()

Overrides: RadDiagramItem.OnStrokeThicknessChanged()

Called when the target of the RadDiagramConnection is changed.

C#
protected virtual void OnTargetChanged()

Called when on target connector position changed.

C#
protected virtual void OnTargetConnectorPositionChanged(string newPosition, string oldPosition)
Parameters:newPositionstring

The new position.

oldPositionstring

The old position.

Called when the ZIndex changes.

C#
protected override void OnZIndexChanged(int newValue, int oldValue)
Parameters:newValueint

The new value.

oldValueint

The old value.

Overrides: RadDiagramItem.OnZIndexChanged(int, int)

When overridden, positions the editing element for the RadDiagramConnection.

C#
protected virtual void PositionEditElementOverride()

Refreshes the is selected in group property.

C#
protected override void RefreshIsSelectedInGroup()

Overrides: RadDiagramItem.RefreshIsSelectedInGroup()

Serializes this instance.

C#
public override SerializationInfo Serialize()
Returns:

SerializationInfo

Overrides: RadDiagramItem.Serialize()

Implements: ISerializable.Serialize()

Sets the Bezier handle positions. The coordinates are absolute coordinates with respect to the diagramming surface.

C#
public void SetBezierHandles(Point startHandle, Point endHandle)
Parameters:startHandlePoint

The start handle position.

endHandlePoint

The end handle position.

Exceptions:

Exception

The connection is not a Bezier connection and has no handles.

Sets the IsUpdateNeeded.

C#
public static void SetIsAutoUpdateSuppressed(DependencyObject obj, bool value)
Parameters:objDependencyObjectvaluebool

Updates this instance.

C#
protected virtual void Update(bool isManipulating = false)
Parameters:isManipulatingbool

Updates the deferred geometry.

C#
protected virtual void UpdateDeferredGeometry(Point start, Point end, Point[] points)
Parameters:startPoint

The start point of the connection.

endPoint

The end point of the connection.

pointsPoint[]

The intermediate connection points.

When overridden, provides the geometry for the connection.

C#
protected virtual void UpdateGeometryOverride()
Remarks:

This is called whenever the connection is redrawn.

Events

Occurs when a manipulation point of the RadDiagramConnection is activated.

C#
public event EventHandler<ManipulationPointActivatedEventArgs<IConnectionEditPoint>> ManipulationPointActivated

Implements: IConnection.ManipulationPointActivated

In this article
DefinitionConstructorsRadDiagramConnection()FieldsBezierTensionPropertyConnectionTypePropertyEndPointPropertyIsAutoUpdateSuppressedPropertyRoutePropertySourceCapSizePropertySourceCapTypePropertySourceConnectorPositionPropertySourcePropertyStartPointPropertyTargetCapSizePropertyTargetCapTypePropertyTargetConnectorPositionPropertyTargetPropertyUseFreeConnectorsPropertyPropertiesAdornerBezierTensionBoundsConnectionPointsConnectionTypeEndPointGeometryIsModifiedManipulationPointsRouteSegmentCountSourceSourceCapSizeSourceCapTypeSourceConnectorPositionSourceConnectorResultStartPointTargetTargetCapSizeTargetCapTypeTargetConnectorPositionTargetConnectorResultUseFreeConnectorsMethodsAddConnectionPoint(Point)Attach(IConnector, IConnector)ConnectionTypeChanged(ConnectionType, ConnectionType)CreateGeometry(BridgeType, bool)CreateSourceCapGeometry(Point, Point, ref Point)CreateTargetCapGeometry(Point, Point, ref Point)Deserialize(SerializationInfo)FetchZConnections(bool, Rect?)GetCrossings()GetIsAutoUpdateSuppressed(DependencyObject)InsertConnectionPoint(Point, int)OnApplyTemplate()OnCreateAutomationPeer()OnEndPointChanged(Point, Point)OnInitialized(EventArgs)OnIsConnectorsManipulationEnabledChanged(bool, bool)OnIsInEditModeChanged(bool, bool)OnIsSelectedChanged(bool, bool)OnPositionCoerced(Point)OnRouteChanged(bool, bool)OnSourceChanged()OnSourceConnectorPositionChanged(string, string)OnStartPointChanged(Point, Point)OnStrokeThicknessChanged()OnTargetChanged()OnTargetConnectorPositionChanged(string, string)OnZIndexChanged(int, int)PositionEditElementOverride()RefreshIsSelectedInGroup()Serialize()SetBezierHandles(Point, Point)SetIsAutoUpdateSuppressed(DependencyObject, bool)Update(bool)UpdateDeferredGeometry(Point, Point, Point[])UpdateGeometryOverride()EventsManipulationPointActivated
Not finding the help you need?
Contact Support