Class
RadDiagramConnection

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:

cs-api-definition
[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

RadDiagramConnection()

Initializes a new instance of the RadDiagramConnection class.

Declaration

cs-api-definition
public RadDiagramConnection()

Fields

BezierTensionProperty

Identifies the BezierTensionProperty dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty BezierTensionProperty

Field Value

DependencyProperty

ConnectionTypeProperty

Identifies the ConnectionType dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty ConnectionTypeProperty

Field Value

DependencyProperty

EndPointProperty

Identifies the EndPoint dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty EndPointProperty

Field Value

DependencyProperty

IsAutoUpdateSuppressedProperty

Identifies the IsAutoUpdateSuppressedProperty.

Declaration

cs-api-definition
public static readonly DependencyProperty IsAutoUpdateSuppressedProperty

Field Value

DependencyProperty

RouteProperty

Identifies the RouteProperty property.

Declaration

cs-api-definition
public static readonly DependencyProperty RouteProperty

Field Value

DependencyProperty

SourceCapSizeProperty

Identifies the SourceCapSize dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty SourceCapSizeProperty

Field Value

DependencyProperty

SourceCapTypeProperty

Identifies the SourceCapType dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty SourceCapTypeProperty

Field Value

DependencyProperty

SourceConnectorPositionProperty

Identifies the SourceConnectorPosition dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty SourceConnectorPositionProperty

Field Value

DependencyProperty

SourceProperty

Identifies the Source dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty SourceProperty

Field Value

DependencyProperty

StartPointProperty

Identifies the StartPoint dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty StartPointProperty

Field Value

DependencyProperty

TargetCapSizeProperty

Identifies the TargetCapSize dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty TargetCapSizeProperty

Field Value

DependencyProperty

TargetCapTypeProperty

Identifies the TargetCapType dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty TargetCapTypeProperty

Field Value

DependencyProperty

TargetConnectorPositionProperty

Identifies the TargetConnectorPosition dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty TargetConnectorPositionProperty

Field Value

DependencyProperty

TargetProperty

Identifies the TargetProperty dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty TargetProperty

Field Value

DependencyProperty

UseFreeConnectorsProperty

Identifies the UseFreeConnectors property.

Declaration

cs-api-definition
public static readonly DependencyProperty UseFreeConnectorsProperty

Field Value

DependencyProperty

Properties

Adorner

The connection adorner which helps manipulating this connection.

Declaration

cs-api-definition
public ConnectionManipulationAdorner Adorner { get; set; }

Property Value

ConnectionManipulationAdorner

BezierTension

Gets or sets the Bezier tension.

Declaration

cs-api-definition
public double BezierTension { get; set; }

Property Value

double

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

Gets the bounds.

Declaration

cs-api-definition
public override Rect Bounds { get; }

Property Value

Rect

The bounds.

Overrides RadDiagramItem.Bounds

Implements IDiagramItem.Bounds

ConnectionPoints

Gets the connection points of the connection.

Declaration

cs-api-definition
public IList<Point> ConnectionPoints { get; }

Property Value

IList<Point>

Implements IConnection.ConnectionPoints

Remarks

The positions are absolute coordinates with respect to the canvas.

ConnectionType

Gets or sets the type of the connection.

Declaration

cs-api-definition
public ConnectionType ConnectionType { get; set; }

Property Value

ConnectionType

The type of the connection.

Implements IConnection.ConnectionType

EndPoint

Gets or sets the position of where this connection ends.

Declaration

cs-api-definition
public Point EndPoint { get; set; }

Property Value

Point

Implements IConnection.EndPoint

Geometry

Gets the geometry of the connection.

Declaration

cs-api-definition
public Geometry Geometry { get; }

Property Value

Geometry

Implements IConnection.Geometry

IsModified

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

Declaration

cs-api-definition
public bool IsModified { get; set; }

Property Value

bool

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.

ManipulationPoints

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

Declaration

cs-api-definition
public IList<IConnectionEditPoint> ManipulationPoints { get; }

Property Value

IList<IConnectionEditPoint>

Implements IConnection.ManipulationPoints

Route

Gets or sets whether this connection will be automatically routed.

Declaration

cs-api-definition
public bool Route { get; set; }

Property Value

bool

Implements IConnection.Route

Remarks

Setting this property effects only Spline and Polyline connections.

SegmentCount

Gets the number of segments this connection has.

Declaration

cs-api-definition
public int SegmentCount { get; }

Property Value

int

Source

Gets or sets the source.

Declaration

cs-api-definition
public IShape Source { get; set; }

Property Value

IShape

The source.

Implements IConnection.Source

SourceCapSize

Gets or sets the size of the source cap.

Declaration

cs-api-definition
public Size SourceCapSize { get; set; }

Property Value

Size

The size of the source cap.

Implements IConnection.SourceCapSize

SourceCapType

Gets or sets the type of the source cap.

Declaration

cs-api-definition
public CapType SourceCapType { get; set; }

Property Value

CapType

The type of the source cap.

Implements IConnection.SourceCapType

SourceConnectorPosition

Gets or sets the source connector position.

Declaration

cs-api-definition
public string SourceConnectorPosition { get; set; }

Property Value

string

The source connector position.

Implements IConnection.SourceConnectorPosition

SourceConnectorResult

Gets the source connector result.

Declaration

cs-api-definition
public IConnector SourceConnectorResult { get; }

Property Value

IConnector

Implements IConnection.SourceConnectorResult

StartPoint

Gets or sets the position of where this connection starts.

Declaration

cs-api-definition
public Point StartPoint { get; set; }

Property Value

Point

Implements IConnection.StartPoint

Target

Gets or sets the target.

Declaration

cs-api-definition
public IShape Target { get; set; }

Property Value

IShape

The target.

Implements IConnection.Target

TargetCapSize

Gets or sets the size of the target cap.

Declaration

cs-api-definition
public Size TargetCapSize { get; set; }

Property Value

Size

The size of the target cap.

Implements IConnection.TargetCapSize

TargetCapType

Gets or sets the type of the target cap.

Declaration

cs-api-definition
public CapType TargetCapType { get; set; }

Property Value

CapType

The type of the target cap.

Implements IConnection.TargetCapType

TargetConnectorPosition

Gets or sets the target connector position.

Declaration

cs-api-definition
public string TargetConnectorPosition { get; set; }

Property Value

string

The target connector position.

Implements IConnection.TargetConnectorPosition

TargetConnectorResult

Gets the target connector result.

Declaration

cs-api-definition
public IConnector TargetConnectorResult { get; }

Property Value

IConnector

Implements IConnection.TargetConnectorResult

UseFreeConnectors

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

Declaration

cs-api-definition
public bool UseFreeConnectors { get; set; }

Property Value

bool

Implements IConnection.UseFreeConnectors

Methods

AddConnectionPoint(Point)

Adds an intermediate connection point.

Declaration

cs-api-definition
public void AddConnectionPoint(Point point)

Parameters

point

Point

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

Implements IConnection.AddConnectionPoint(Point)

Attach(IConnector, IConnector)

Attaches the connection to specific source and target.

Declaration

cs-api-definition
public void Attach(IConnector source = null, IConnector target = null)

Parameters

source

IConnector

The source.

target

IConnector

The target.

Implements IConnection.Attach(IConnector, IConnector)

ConnectionTypeChanged(ConnectionType, ConnectionType)

Invoked on connection type changed.

Declaration

cs-api-definition
protected virtual void ConnectionTypeChanged(ConnectionType newValue, ConnectionType oldValue)

Parameters

newValue

ConnectionType

The new value.

oldValue

ConnectionType

The old value.

CreateGeometry(BridgeType, bool)

Creates the connection's geometry.

Declaration

cs-api-definition
protected virtual Geometry CreateGeometry(BridgeType bridgeType, bool roundedCorners)

Parameters

bridgeType

BridgeType

roundedCorners

bool

Returns

Geometry

CreateSourceCapGeometry(Point, Point, ref Point)

Creates the source cap geometry.

Declaration

cs-api-definition
[SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference", MessageId = "2#")]
protected virtual PathFigure CreateSourceCapGeometry(Point startPoint, Point endPoint, ref Point baseLineStart)

Parameters

startPoint

Point

The start point.

endPoint

Point

The end point.

baseLineStart

Point

The new start of the base line.

Returns

PathFigure

CreateTargetCapGeometry(Point, Point, ref Point)

Creates the target cap geometry.

Declaration

cs-api-definition
[SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference", MessageId = "2#")]
protected virtual PathFigure CreateTargetCapGeometry(Point startPoint, Point endPoint, ref Point baseLineEnd)

Parameters

startPoint

Point

The start point.

endPoint

Point

The end point.

baseLineEnd

Point

The new end of the base line.

Returns

PathFigure

Deserialize(SerializationInfo)

Deserializes the serialization info in this diagram entity.

Declaration

cs-api-definition
public override void Deserialize(SerializationInfo info)

Parameters

info

SerializationInfo

A SerializationInfo instance.

Overrides RadDiagramItem.Deserialize(SerializationInfo)

Implements ISerializable.Deserialize(SerializationInfo)

FetchZConnections(bool, Rect?)

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

Declaration

cs-api-definition
public IList<IConnection> FetchZConnections(bool below, Rect? bounds = null)

Parameters

below

bool

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

bounds

Rect?

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

Returns

IList<IConnection>

GetCrossings()

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

Declaration

cs-api-definition
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.

GetIsAutoUpdateSuppressed(DependencyObject)

Gets the IsUpdateNeeded.

Declaration

cs-api-definition
public static bool GetIsAutoUpdateSuppressed(DependencyObject obj)

Parameters

obj

DependencyObject

Returns

bool

InsertConnectionPoint(Point, int)

Inserts the connection point after the specific index.

Declaration

cs-api-definition
public void InsertConnectionPoint(Point point, int after)

Parameters

point

Point

The point to add.

after

int

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.

OnApplyTemplate()

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.

Declaration

cs-api-definition
public override void OnApplyTemplate()

Overrides RadDiagramItem.OnApplyTemplate()

OnCreateAutomationPeer()

Creates a peer associated with this object.

Declaration

cs-api-definition
protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer

An instance of the .

Overrides RadDiagramItem.OnCreateAutomationPeer()

OnEndPointChanged(Point, Point)

Called on end point changed.

Declaration

cs-api-definition
protected virtual void OnEndPointChanged(Point newValue, Point oldValue)

Parameters

newValue

Point

The new value.

oldValue

Point

The old value.

OnInitialized(EventArgs)

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

Declaration

cs-api-definition
protected override void OnInitialized(EventArgs e)

Parameters

e

EventArgs

OnIsConnectorsManipulationEnabledChanged(bool, bool)

Called when connectors manipulation changes.

Declaration

cs-api-definition
protected override void OnIsConnectorsManipulationEnabledChanged(bool newValue, bool oldValue)

Parameters

newValue

bool

The new value.

oldValue

bool

The old value.

Overrides RadDiagramItem.OnIsConnectorsManipulationEnabledChanged(bool, bool)

OnIsInEditModeChanged(bool, bool)

Called when IsInEditMode changes.

Declaration

cs-api-definition
protected override void OnIsInEditModeChanged(bool oldIsInEditMode, bool isInEditMode)

Parameters

oldIsInEditMode

bool

The old value of the property.

isInEditMode

bool

The current value of the property.

Overrides RadDiagramItem.OnIsInEditModeChanged(bool, bool)

OnIsSelectedChanged(bool, bool)

Called when the IsSelected property has changed.

Declaration

cs-api-definition
protected override void OnIsSelectedChanged(bool oldValue, bool newValue)

Parameters

oldValue

bool

The old value of the IsSelected property.

newValue

bool

The new value of the IsSelected property.

Overrides RadDiagramItem.OnIsSelectedChanged(bool, bool)

OnPositionCoerced(Point)

Called when [position coerced].

Declaration

cs-api-definition
protected override object OnPositionCoerced(Point position)

Parameters

position

Point

The new position.

Returns

object

Overrides RadDiagramItem.OnPositionCoerced(Point)

OnRouteChanged(bool, bool)

Called when route changed property change.

Declaration

cs-api-definition
protected virtual void OnRouteChanged(bool newValue, bool oldValue)

Parameters

newValue

bool

The new value.

oldValue

bool

The old value.

OnSourceChanged()

Called when the source of the RadDiagramConnection is changed.

Declaration

cs-api-definition
protected virtual void OnSourceChanged()

OnSourceConnectorPositionChanged(string, string)

Called when on source connector position changed.

Declaration

cs-api-definition
protected virtual void OnSourceConnectorPositionChanged(string newPosition, string oldPosition)

Parameters

newPosition

string

The new position.

oldPosition

string

The old position.

OnStartPointChanged(Point, Point)

Called on start point changed.

Declaration

cs-api-definition
protected virtual void OnStartPointChanged(Point newValue, Point oldValue)

Parameters

newValue

Point

The new value.

oldValue

Point

The old value.

OnStrokeThicknessChanged()

Invoked when the StrokeThickness property has changed.

Declaration

cs-api-definition
protected override void OnStrokeThicknessChanged()

Overrides RadDiagramItem.OnStrokeThicknessChanged()

OnTargetChanged()

Called when the target of the RadDiagramConnection is changed.

Declaration

cs-api-definition
protected virtual void OnTargetChanged()

OnTargetConnectorPositionChanged(string, string)

Called when on target connector position changed.

Declaration

cs-api-definition
protected virtual void OnTargetConnectorPositionChanged(string newPosition, string oldPosition)

Parameters

newPosition

string

The new position.

oldPosition

string

The old position.

OnZIndexChanged(int, int)

Called when the ZIndex changes.

Declaration

cs-api-definition
protected override void OnZIndexChanged(int newValue, int oldValue)

Parameters

newValue

int

The new value.

oldValue

int

The old value.

Overrides RadDiagramItem.OnZIndexChanged(int, int)

PositionEditElementOverride()

When overridden, positions the editing element for the RadDiagramConnection.

Declaration

cs-api-definition
protected virtual void PositionEditElementOverride()

RefreshIsSelectedInGroup()

Refreshes the is selected in group property.

Declaration

cs-api-definition
protected override void RefreshIsSelectedInGroup()

Overrides RadDiagramItem.RefreshIsSelectedInGroup()

Serialize()

Serializes this instance.

Declaration

cs-api-definition
public override SerializationInfo Serialize()

Returns

SerializationInfo

Overrides RadDiagramItem.Serialize()

Implements ISerializable.Serialize()

SetBezierHandles(Point, Point)

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

Declaration

cs-api-definition
public void SetBezierHandles(Point startHandle, Point endHandle)

Parameters

startHandle

Point

The start handle position.

endHandle

Point

The end handle position.

Exceptions

Exception

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

SetIsAutoUpdateSuppressed(DependencyObject, bool)

Sets the IsUpdateNeeded.

Declaration

cs-api-definition
public static void SetIsAutoUpdateSuppressed(DependencyObject obj, bool value)

Parameters

obj

DependencyObject

value

bool

Update(bool)

Updates this instance.

Declaration

cs-api-definition
protected virtual void Update(bool isManipulating = false)

Parameters

isManipulating

bool

UpdateDeferredGeometry(Point, Point, Point[])

Updates the deferred geometry.

Declaration

cs-api-definition
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords")]
protected virtual void UpdateDeferredGeometry(Point start, Point end, Point[] points)

Parameters

start

Point

The start point of the connection.

end

Point

The end point of the connection.

points

Point[]

The intermediate connection points.

UpdateGeometryOverride()

When overridden, provides the geometry for the connection.

Declaration

cs-api-definition
protected virtual void UpdateGeometryOverride()

Remarks

This is called whenever the connection is redrawn.

Events

ManipulationPointActivated

Occurs when a manipulation point of the RadDiagramConnection is activated.

Declaration

cs-api-definition
public event EventHandler<ManipulationPointActivatedEventArgs<IConnectionEditPoint>> ManipulationPointActivated

Event Value

EventHandler<ManipulationPointActivatedEventArgs<IConnectionEditPoint>>

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