ClassRadDiagramConnection
The RadDiagramConnection is a special ContentControl that serves as a connection between zero, one or two shapes.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.RadDiagram.dll
Syntax:
public class RadDiagramConnection : RadDiagramItem, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IStylableNode, ISupportDrop, IConnection, IDiagramItem, ISerializable, ISupportMouseOver, IPropertyChanged, IGroupable, ISupportManipulation, ISupportVirtualization, IContainerChild, ICollapsible
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementUIElementFrameworkElementRadDiagramItemRadDiagramConnection
Implements:
Inherited Members
Constructors
RadDiagramConnection()
Initializes a new instance of the RadDiagramConnection class.
Declaration
public RadDiagramConnection()
Fields
BezierTensionProperty
Identifies the BezierTensionProperty dependency property.
Declaration
public static readonly RadProperty BezierTensionProperty
Field Value
ConnectionTypeProperty
Identifies the ConnectionType dependency property.
Declaration
public static readonly RadProperty ConnectionTypeProperty
Field Value
ConnectorCenterPointProperty
Identifies the ConnectorCenterPoint.
Declaration
public static readonly RadProperty ConnectorCenterPointProperty
Field Value
EndPointProperty
Identifies the EndPoint dependency property.
Declaration
public static readonly RadProperty EndPointProperty
Field Value
IsAutoUpdateSuppressedProperty
Identifies the IsAutoUpdateSuppressedProperty.
Declaration
public static readonly RadProperty IsAutoUpdateSuppressedProperty
Field Value
RouteProperty
Identifies the RouteProperty property.
Declaration
public static readonly RadProperty RouteProperty
Field Value
SourceCapSizeProperty
Identifies the SourceCapSize dependency property.
Declaration
public static readonly RadProperty SourceCapSizeProperty
Field Value
SourceCapTypeProperty
Identifies the SourceCapType dependency property.
Declaration
public static readonly RadProperty SourceCapTypeProperty
Field Value
SourceConnectorPositionProperty
Identifies the SourceConnectorPosition dependency property.
Declaration
public static readonly RadProperty SourceConnectorPositionProperty
Field Value
SourceProperty
Identifies the Source dependency property.
Declaration
public static readonly RadProperty SourceProperty
Field Value
StartPointProperty
Identifies the StartPoint dependency property.
Declaration
public static readonly RadProperty StartPointProperty
Field Value
TargetCapSizeProperty
Identifies the TargetCapSize dependency property.
Declaration
public static readonly RadProperty TargetCapSizeProperty
Field Value
TargetCapTypeProperty
Identifies the TargetCapType dependency property.
Declaration
public static readonly RadProperty TargetCapTypeProperty
Field Value
TargetConnectorPositionProperty
Identifies the TargetConnectorPosition dependency property.
Declaration
public static readonly RadProperty TargetConnectorPositionProperty
Field Value
TargetProperty
Identifies the TargetProperty dependency property.
Declaration
public static readonly RadProperty TargetProperty
Field Value
UseFreeConnectorsProperty
Identifies the UseFreeConnectors property.
Declaration
public static readonly RadProperty UseFreeConnectorsProperty
Field Value
Properties
Adorner
The connection adorner which helps manipulating this connection.
Declaration
public ConnectionManipulationAdorner Adorner { get; set; }
Property Value
BezierTension
Gets or sets the Bezier tension.
Declaration
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
Bounds
Gets the bounds.
Declaration
public override Rect Bounds { get; }
Property Value
The bounds.
Overrides
Implements
ConnectionPoints
Gets the connection points of the connection.
Declaration
[Browsable(false)]
public IList<Point> ConnectionPoints { get; }
Property Value
IList<Point>
Implements
Remarks
The positions are absolute coordinates with respect to the canvas.
ConnectionType
Gets or sets the type of the connection.
Declaration
public ConnectionType ConnectionType { get; set; }
Property Value
The type of the connection.
Implements
EndPoint
Gets or sets the position of where this connection ends.
ForeColor
Gets or sets the foreground color of the element.
Declaration
public override Color ForeColor { get; set; }
Property Value
A Color that represents the foreground color used for text and borders. The default value is determined by the current theme.
Overrides
Remarks
This property is inheritable through the element tree, allowing child elements to inherit the foreground color from their parents unless explicitly overridden. The foreground color affects text rendering and border appearance.
Geometry
Gets the geometry of the connection.
IsModified
Gets or sets a value indicating whether the connection has been modified.
Declaration
public bool IsModified { get; set; }
Property Value
Implements
Remarks
- This property is set to
trueas 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 tofalse. - If this property is
truethe connection won't be routed and no automatic reflexive points will be added. You can re-enable this by re-setting this property tofalse.
ManipulationPoints
Gets the manipulation points, which are equal to the adorner's connection editing points.
Declaration
[Browsable(false)]
public IList<IConnectionEditPoint> ManipulationPoints { get; }
Property Value
IList<IConnectionEditPoint>
Implements
Route
Gets or sets whether this connection will be automatically routed.
SegmentCount
Gets the number of segments this connection has.
Shape
Gets or sets an instance of the Shape object of an element. The shape of the element is both responsible for clipping the element's children and for providing its' border(s) with custom shape.
Declaration
[Browsable(false)]
public override ElementShape Shape { get; set; }
Property Value
Overrides
Remarks
Value of null (or Nothing in VisualBasic.Net) indicates that element has rectangular (or no) shape. Shape is an object that defines the bounding graphics path of an element. Graphics clip is always applied when an element has shape. Shape is considered when painting the border element, and when hit-testing an element. Some predefined shapes are available, like RoundRectShape or EllipseShape. CustomShape offers a way to specify element's shape with a sequence of points and curves using code or the design time ElementShapeEditor UITypeEditor.
Source
Gets or sets the source.
Declaration
[Browsable(false)]
public IShape Source { get; set; }
Property Value
The source.
Implements
SourceCapSize
Gets or sets the size of the source cap.
Declaration
public SizeF SourceCapSize { get; set; }
Property Value
The size of the source cap.
Implements
SourceCapType
Gets or sets the type of the source cap.
Declaration
[Browsable(true)]
public CapType SourceCapType { get; set; }
Property Value
The type of the source cap.
Implements
SourceConnectorPosition
Gets or sets the source connector position.
Declaration
public string SourceConnectorPosition { get; set; }
Property Value
The source connector position.
Implements
SourceConnectorResult
Gets the source connector result.
Declaration
public IConnector SourceConnectorResult { get; }
Property Value
Implements
StartPoint
Gets or sets the position of where this connection starts.
Stroke
Gets or sets the stroke of this item.
Declaration
public override Brush Stroke { get; set; }
Property Value
The stroke.
Overrides
Target
Gets or sets the target.
Declaration
[Browsable(false)]
public IShape Target { get; set; }
Property Value
The target.
Implements
TargetCapSize
Gets or sets the size of the target cap.
Declaration
public SizeF TargetCapSize { get; set; }
Property Value
The size of the target cap.
Implements
TargetCapType
Gets or sets the type of the target cap.
Declaration
[Browsable(true)]
public CapType TargetCapType { get; set; }
Property Value
The type of the target cap.
Implements
TargetConnectorPosition
Gets or sets the target connector position.
Declaration
public string TargetConnectorPosition { get; set; }
Property Value
The target connector position.
Implements
TargetConnectorResult
Gets the target connector result.
Declaration
public IConnector TargetConnectorResult { get; }
Property Value
Implements
UseFreeConnectors
Gets or sets whether this connection will choose free connectors when attaching to shape with Source or TargetConnectorPosition Auto.
Declaration
public bool UseFreeConnectors { get; set; }
Property Value
Implements
Methods
AddConnectionPoint(Point)
Adds an intermediate connection point.
Declaration
public void AddConnectionPoint(Point point)
Parameters
point
The (absolute canvas) position at which the new connection point should be added.
Implements
Attach(IConnector, IConnector)
Attaches the connection to specific source and target.
Declaration
public void Attach(IConnector source = null, IConnector target = null)
Parameters
source
The source.
target
The target.
Implements
ConnectionTypeChanged(ConnectionType, ConnectionType)
Invoked on connection type changed.
Declaration
protected virtual void ConnectionTypeChanged(ConnectionType newValue, ConnectionType oldValue)
Parameters
newValue
The new value.
oldValue
The old value.
CreateChildElements()
Called by the element when constructed. Allows inheritors to build the element tree.
Declaration
protected override void CreateChildElements()
Overrides
CreateGeometry(BridgeType, bool)
Creates the connection's geometry.
Declaration
protected virtual Geometry CreateGeometry(BridgeType bridgeType, bool roundedCorners)
Parameters
bridgeType
roundedCorners
Returns
CreateSourceCapGeometry(Point, Point, ref Point)
Creates the source cap geometry.
Declaration
protected virtual PathFigure CreateSourceCapGeometry(Point startPoint, Point endPoint, ref Point baseLineStart)
Parameters
startPoint
The start point.
endPoint
The end point.
baseLineStart
The new start of the base line.
Returns
CreateTargetCapGeometry(Point, Point, ref Point)
Creates the target cap geometry.
Declaration
protected virtual PathFigure CreateTargetCapGeometry(Point startPoint, Point endPoint, ref Point baseLineEnd)
Parameters
startPoint
The start point.
endPoint
The end point.
baseLineEnd
The new end of the base line.
Returns
Deserialize(SerializationInfo)
Deserializes the serialization info in this diagram entity.
Declaration
public override void Deserialize(SerializationInfo info)
Parameters
info
A SerializationInfo instance.
Overrides
Implements
FetchZConnections(bool, Rect?)
Returns all connections below or above the current connection that intersect with the given bounds.
Declaration
public IList<IConnection> FetchZConnections(bool below, Rect? bounds = null)
Parameters
below
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>
GetConnectorCenterPoint(RadObject)
Sets the ConnectorCenterPoint.
GetCrossings()
Returns the information related to the crossing of this connection with other connections.
Declaration
public CrossingsData GetCrossings()
Returns
Implements
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(RadObject)
Gets the IsUpdateNeeded.
HitTest(Point)
Performs hit testing on the element to determine if the specified point lies within its bounds.
InsertConnectionPoint(Point, int)
Inserts the connection point after the specific index.
Declaration
public void InsertConnectionPoint(Point point, int after)
Parameters
point
The point to add.
after
The index after which it will be positioned.
Implements
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.
MeasureOverride(SizeF)
Measures the space required by the RadElement
Used by the layout system.
Declaration
protected override SizeF MeasureOverride(SizeF availableSize)
Parameters
availableSize
The size that is available to the RadElement. The available size can be infinity (to take the full size of the element)
Returns
The minimum size required by the element to be completely visible. Cannot be infinity.
Overrides
Remarks
In this method call to the Measure method of each child must be made.
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
public override void OnApplyTemplate()
Overrides
OnEndPointChanged(Point, Point)
Called on end point changed.
OnIsConnectorsManipulationEnabledChanged(bool, bool)
Called when connectors manipulation changes.
OnIsInEditModeChanged(bool, bool)
Called when IsInEditMode changes.
OnIsSelectedChanged(bool, bool)
Called when the IsSelected property has changed.
OnLoaded()
Called when the element has been successfully loaded. That includes loading of all its children as well.
Declaration
protected override void OnLoaded()
Overrides
OnPositionCoerced(Point)
Called when [position coerced].
OnPropertyChanged(RadPropertyChangedEventArgs)
Called when a property value has changed, allowing for custom response to property changes.
Declaration
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Parameters
e
The property changed event arguments.
Overrides
OnRouteChanged(bool, bool)
Called when route changed property change.
OnSourceChanged()
Called when the source of the RadDiagramConnection is changed.
Declaration
protected virtual void OnSourceChanged()
OnSourceConnectorPositionChanged(string, string)
Called when on source connector position changed.
OnStartPointChanged(Point, Point)
Called on start point changed.
OnStrokeThicknessChanged()
Invoked when the StrokeThickness property has changed.
Declaration
protected override void OnStrokeThicknessChanged()
Overrides
OnTargetChanged()
Called when the target of the RadDiagramConnection is changed.
Declaration
protected virtual void OnTargetChanged()
OnTargetConnectorPositionChanged(string, string)
Called when on target connector position changed.
OnZIndexChanged(int, int)
Called when the ZIndex changes.
PaintElement(IGraphics, float, SizeF)
Paints the element's background and calls the base implementation to paint child elements.
Declaration
protected override void PaintElement(IGraphics graphics, float angle, SizeF scale)
Parameters
graphics
The graphics object used for painting.
angle
The rotation angle to apply during painting.
scale
The scale factor to apply during painting.
Overrides
PositionEditElementOverride()
When overridden, positions the editing element for the RadDiagramConnection.
Declaration
protected virtual void PositionEditElementOverride()
RefreshIsSelectedInGroup()
Refreshes the is selected in group property.
Declaration
protected override void RefreshIsSelectedInGroup()
Overrides
Serialize()
Serializes this instance.
Declaration
public override SerializationInfo Serialize()
Returns
Overrides
Implements
SetBezierHandles(Point, Point)
Sets the Bezier handle positions. The coordinates are absolute coordinates with respect to the diagramming surface.
SetConnectorCenterPoint(RadObject, Point)
Sets the ConnectorCenterPoint.
SetIsAutoUpdateSuppressed(RadObject, bool)
Sets the IsUpdateNeeded.
Update(bool)
Updates this instance.
Declaration
protected virtual void Update(bool isManipulating = false)
Parameters
isManipulating
UpdateDeferredGeometry(Point, Point, Point[])
Updates the deferred geometry.
UpdateGeometryOverride()
When overridden, provides the geometry for the connection.
Declaration
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
public event EventHandler<ManipulationPointActivatedEventArgs<IConnectionEditPoint>> ManipulationPointActivated
Event Value
EventHandler<ManipulationPointActivatedEventArgs<IConnectionEditPoint>>
Implements