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:
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 foreground color of the element.
public override Color ForeColor { get; set; }
A Color that represents the foreground color used for text and borders. The default value is determined by the current theme.
Overrides:
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.
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 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.
[Browsable(false)]
public override ElementShape Shape { get; set; }
Overrides:
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.
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 stroke of this item.
public override Brush Stroke { get; set; }
The stroke.
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.
Called by the element when constructed. Allows inheritors to build the element tree.
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.
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.
Measures the space required by the RadElement
Used by the layout system.
protected override SizeF MeasureOverride(SizeF 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:
In this method call to the Measure method of each child must be made.
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:
Called when the element has been successfully loaded. That includes loading of all its children as well.
protected override void OnLoaded()
Overrides:
Called when a property value has changed, allowing for custom response to property changes.
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
The property changed event arguments.
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()
Paints the element's background and calls the base implementation to paint child elements.
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: