RadDiagramConnection
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
Initializes a new instance of the RadDiagramConnection class.
public RadDiagramConnection()
Fields
Identifies the BezierTensionProperty dependency property.
public static readonly RadProperty BezierTensionProperty
Identifies the ConnectionType dependency property.
public static readonly RadProperty ConnectionTypeProperty
Identifies the ConnectorCenterPoint.
public static readonly RadProperty ConnectorCenterPointProperty
Identifies the EndPoint dependency property.
public static readonly RadProperty EndPointProperty
Identifies the IsAutoUpdateSuppressedProperty.
public static readonly RadProperty IsAutoUpdateSuppressedProperty
Identifies the RouteProperty property.
public static readonly RadProperty RouteProperty
Identifies the SourceCapSize dependency property.
public static readonly RadProperty SourceCapSizeProperty
Identifies the SourceCapType dependency property.
public static readonly RadProperty SourceCapTypeProperty
Identifies the SourceConnectorPosition dependency property.
public static readonly RadProperty SourceConnectorPositionProperty
Identifies the Source dependency property.
public static readonly RadProperty SourceProperty
Identifies the StartPoint dependency property.
public static readonly RadProperty StartPointProperty
Identifies the TargetCapSize dependency property.
public static readonly RadProperty TargetCapSizeProperty
Identifies the TargetCapType dependency property.
public static readonly RadProperty TargetCapTypeProperty
Identifies the TargetConnectorPosition dependency property.
public static readonly RadProperty TargetConnectorPositionProperty
Identifies the TargetProperty dependency property.
public static readonly RadProperty TargetProperty
Identifies the UseFreeConnectors property.
public static readonly RadProperty UseFreeConnectorsProperty
Properties
The connection adorner which helps manipulating this connection.
public ConnectionManipulationAdorner Adorner { get; set; }
Gets or sets the Bezier tension.
public double BezierTension { get; set; }
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:
Gets the bounds.
public override Rect Bounds { get; }
The bounds.
Overrides:
Implements:
Gets the bounds of the connection path without applying the item's transform.
public Rect BoundsWithoutTransform { get; }
ConnectionPoints
IList<Point>
Gets the connection points of the connection.
[Browsable(false)]
public IList<Point> ConnectionPoints { get; }
Implements:
The positions are absolute coordinates with respect to the canvas.
Gets or sets the type of the connection.
public ConnectionType ConnectionType { get; set; }
The type of the connection.
Implements:
Gets or sets the position of where this connection ends.
public Point EndPoint { get; set; }
Implements:
Gets or sets the connection stroke color. Setting it replaces the stroke with a solid brush of this color.
public override Color ForeColor { get; set; }
Overrides:
Gets the geometry of the connection.
public Geometry Geometry { get; }
Implements:
Gets or sets a value indicating whether the connection has been modified.
public bool IsModified { get; set; }
Implements:
- 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.
Gets the manipulation points, which are equal to the adorner's connection editing points.
[Browsable(false)]
public IList<IConnectionEditPoint> ManipulationPoints { get; }
Implements:
Gets the number of segments this connection has.
public int SegmentCount { get; }
Gets or sets the custom shape used to paint the element's border and perform hit testing.
[Browsable(false)]
public override ElementShape Shape { get; set; }
Overrides:
A null value leaves the element rectangular. The shape defines the geometry used by the border and hit-testing paths. The root element applies the shape to the hosted control's region only when ApplyShapeToControl is enabled. Use a predefined shape such as RoundRectShape or EllipseShape, or define a custom path with CustomShape.
Gets or sets the source.
[Browsable(false)]
public IShape Source { get; set; }
The source.
Implements:
Gets or sets the size of the source cap.
public SizeF SourceCapSize { get; set; }
The size of the source cap.
Implements:
Gets or sets the type of the source cap.
[Browsable(true)]
public CapType SourceCapType { get; set; }
The type of the source cap.
Implements:
Gets or sets the source connector position.
public string SourceConnectorPosition { get; set; }
The source connector position.
Implements:
Gets the source connector result.
public IConnector SourceConnectorResult { get; }
Implements:
Gets or sets the position of where this connection starts.
public Point StartPoint { get; set; }
Implements:
Gets or sets the brush used to draw the connection. The setter synchronizes ForeColor and supports only SolidBrush.
public override Brush Stroke { get; set; }
Overrides:
Gets or sets the target.
[Browsable(false)]
public IShape Target { get; set; }
The target.
Implements:
Gets or sets the size of the target cap.
public SizeF TargetCapSize { get; set; }
The size of the target cap.
Implements:
Gets or sets the type of the target cap.
[Browsable(true)]
public CapType TargetCapType { get; set; }
The type of the target cap.
Implements:
Gets or sets the target connector position.
public string TargetConnectorPosition { get; set; }
The target connector position.
Implements:
Gets the target connector result.
public IConnector TargetConnectorResult { get; }
Implements:
Gets or sets whether this connection will choose free connectors when attaching to shape with Source or TargetConnectorPosition Auto.
public bool UseFreeConnectors { get; set; }
Implements:
Methods
Adds an intermediate connection point.
public void AddConnectionPoint(Point point)
The (absolute canvas) position at which the new connection point should be added.
Implements:
Attaches the connection to specific source and target.
public void Attach(IConnector source = null, IConnector target = null)
The source.
targetIConnectorThe target.
Implements:
Invoked on connection type changed.
protected virtual void ConnectionTypeChanged(ConnectionType newValue, ConnectionType oldValue)
The new value.
oldValueConnectionTypeThe old value.
Creates the connection's child elements and sets centered content alignment and a stroke thickness of 2.
protected override void CreateChildElements()
Overrides:
Creates the connection's geometry.
protected virtual Geometry CreateGeometry(BridgeType bridgeType, bool roundedCorners)
Deserializes the serialization info in this diagram entity.
public override void Deserialize(SerializationInfo info)
A SerializationInfo instance.
Overrides:
Implements:
Returns all connections below or above the current connection that intersect with the given bounds.
public IList<IConnection> FetchZConnections(bool below, Rect? bounds = null)
If set to true the connections below current one will be returned, otherwise the ones above.
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.
public CrossingsData GetCrossings()
Implements:
- 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.
Tests the connection path's four-pixel outline and, when present, the transformed label bounds.
Inserts the connection point after the specific index.
public void InsertConnectionPoint(Point point, int after)
The point to add.
afterintThe index after which it will be positioned.
Implements:
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.
public override void OnApplyTemplate()
Overrides:
Reapplies the connection template after the element is loaded so its visual path elements are initialized.
protected override void OnLoaded()
Overrides:
Updates cached label layout when text or font changes and synchronizes changed properties to the bound item.
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Details of the property change.
Overrides:
Called when the source of the RadDiagramConnection is changed.
protected virtual void OnSourceChanged()
Invoked when the StrokeThickness property has changed.
protected override void OnStrokeThicknessChanged()
Overrides:
Called when the target of the RadDiagramConnection is changed.
protected virtual void OnTargetChanged()
When overridden, positions the editing element for the RadDiagramConnection.
protected virtual void PositionEditElementOverride()
Refreshes the is selected in group property.
protected override void RefreshIsSelectedInGroup()
Overrides:
Serializes this instance.
Sets the Bezier handle positions. The coordinates are absolute coordinates with respect to the diagramming surface.
Updates this instance.
When overridden, provides the geometry for the connection.
protected virtual void UpdateGeometryOverride()
This is called whenever the connection is redrawn.
Events
Occurs when a manipulation point of the RadDiagramConnection is activated.
public event EventHandler<ManipulationPointActivatedEventArgs<IConnectionEditPoint>> ManipulationPointActivated
Implements: