# LinkViewModelBase

Telerik Diagramming Framework provides a list of **ViewModels** defined in the **Telerik.Windows.Controls.Diagrams.Extensions.dll**.

This article describes the **LinkViewModelBase** defined in the Diagramming Extensions.

## Overview

The **LinkViewModelBase** class is a **ViewModel** designed to serve as a base **ViewModel** for **RadDiagramConnections** in a data-bound **RadDiagram**. As the connection can start from one shape and end in another one, the **LinkViewModelBase** class is defined to expose properties that track these source and target shapes.

Essentially the **LinkViewModelBase** derives from [ItemViewModelBase](https://www.telerik.com/products/wpf/documentation/controls/raddiagram/diagramextensions-viewmodels/data-itemviewmodels) and therefore the class exposes all properties defined in the **ItemViewModelBase** class. Moreover, the **LinkViewModelBase** class inherits the [ILink<T>](http://www.telerik.com/help/wpf/t_telerik_windows_diagrams_core_ilink_1.html) interface, where **T** should derive from [NodeViewModelBase]()

LinkViewModelBase Inheritance Model
![raddiagram-data-linkviewmodel](https://www.telerik.com/products/wpf/documentation/assets/7cd92cf6ca0b015e6fc23c1aea37a41e/raddiagram-data-linkviewmodel.png)

## Constructors

| Name                                  | Description                                                                                                                                                       |
| ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| LinkViewModelBase()                   | Initializes a new instance of the LinkViewModelBase class that represents a link on the diagramming surface.                                                      |
| LinkViewModelBase(T source, T target) | Initializes a new instance of the LinkViewModelBase class that represents a link starting from the specified source node and ending at the specified target node. |

## Properties

The **LinkViewModelBase** class exposes the following properties:

Properties:

| Name          | Description                                                                                        |
| ------------- | -------------------------------------------------------------------------------------------------- |
| Source        | Gets or sets the source of the connection which should be of type deriving from NodeViewModelBase. |
| Target        | Gets or sets the target of the connection which should be of type deriving from NodeViewModelBase. |
| SourceCapType | Gets or sets the CapType of the start of the represented connection.                               |
| TargetCapType | Gets or sets the CapType of the end of the represented connection.                                 |

Inherited Properties:

| Name       | Description                                                                                    |
| ---------- | ---------------------------------------------------------------------------------------------- |
| Visibility | Gets or sets the Visibility of the represented connection. The property is of type Visibility. |
| Position   | Gets or sets the coordinates of a Point that represents the position of a connection.          |
| Content    | Gets or sets an object that represents the content of the represented connection.              |
| IsSelected | Gets or sets a Boolean value indicating whether the represented connection is selected.        |

## See Also

* [ItemViewModelBase](https://www.telerik.com/products/wpf/documentation/controls/raddiagram/diagramextensions-viewmodels/data-itemviewmodels)
* [NodeViewModelBase](https://www.telerik.com/products/wpf/documentation/controls/raddiagram/diagramextensions-viewmodels/data-nodeviewmodel)
* [ContainerNodeViewModelBase](https://www.telerik.com/products/wpf/documentation/controls/raddiagram/diagramextensions-viewmodels/data-containernodeviewmodel)
* [HierarchicalNodeViewModel](https://www.telerik.com/products/wpf/documentation/controls/raddiagram/diagramextensions-viewmodels/data-hierarchicalnodeviewmodel)
* [GraphSourceBase](https://www.telerik.com/products/wpf/documentation/controls/raddiagram/diagramextensions-viewmodels/data-graphsourcebase)
* [ObservableGraphSourceBase](https://www.telerik.com/products/wpf/documentation/controls/raddiagram/diagramextensions-viewmodels/data-observablegraphsource)
* [SerializableGraphSourceBase](https://www.telerik.com/products/wpf/documentation/controls/raddiagram/diagramextensions-viewmodels/data-serializablegraphsource)
