New to Telerik UI for WPF? Start a free 30-day trial

A generic base class for the link or connection in a diagram source.

Definition

Namespace:Telerik.Windows.Controls.Diagrams.Extensions.ViewModels

Assembly:Telerik.Windows.Controls.Diagrams.Extensions.dll

Type Parameters:

T

A type inheriting from NodeViewModelBase.

Syntax:

C#
public class LinkViewModelBase<T> : ItemViewModelBase, INotifyPropertyChanged, IDisposable, ILink<T>, ILink where T : NodeViewModelBase

Inheritance: objectViewModelBaseItemViewModelBaseLinkViewModelBase<T>

Implements: IDisposableILinkILink<T>INotifyPropertyChanged

Inherited Members ItemViewModelBase.VisibilityItemViewModelBase.PositionItemViewModelBase.ContentItemViewModelBase.IsSelectedViewModelBase.VerifyPropertyName(string)ViewModelBase.UpdateValue<T>(ref T, T, string)ViewModelBase.InvokeOnUIThread(Action)ViewModelBase.Dispose()ViewModelBase.RaisePropertyChanged(string)ViewModelBase.OnPropertyChanged(string)ViewModelBase.OnPropertyChanged<T>(Expression<Func<T>>)ViewModelBase.Dispose(bool)ViewModelBase.PropertyChanged...

Example:

If you want to map the Content of the link to the Content of the connection you need to add a Style like so

csharp
<Style  TargetType="telerik:RadDiagramConnection">
  <Setter Property="ContentTemplate"  >
    <Setter.Value>
      <DataTemplate>
        <TextBlock Text="{Binding Content}"/>
      </DataTemplate>
    </Setter.Value>
  </Setter>
</Style>

.

Constructors

Initializes a new instance of the LinkViewModelBase<T> class.

C#
public LinkViewModelBase()

Initializes a new instance of the LinkViewModelBase<T> class.

C#
public LinkViewModelBase(T source, T target)
Parameters:sourceT

The source.

targetT

The target.

Properties

Gets or sets the source of the connection.

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

The source.

Implements: ILink<T>.Source

Gets or sets the type of the source cap.

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

The type of the source cap.

Gets or sets the target of this connection.

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

The target.

Implements: ILink<T>.Target

Gets or sets the type of the target cap.

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

The type of the target cap.