Version

Binding xamDiagram to Data

Topic Overview

Purpose

This topic provides an overview of the data binding scenarios supported by the xamDiagram™ control.

Required background

The following topics are prerequisites to understanding this topic:

Topic Purpose

This topic provides a conceptual overview of the xamDiagram control and its main features and capabilities.

This topic explains how to add the xamDiagram control to a WPF application.

Binding to Data Sources

Supported data sources summary

The xamDiagram control supports the following data sources:

Data Source Binding

Nodes and connections data – reference based

The data source contains two collections of objects – one representing nodes and the other representing connections.

Each of the connection objects references its start and end objects.

The xamDiagram creates a node or connection for each data source object, respectively.

Nodes and connections data – key based

The data source contains two collections of objects:

  • Objects representing Nodes

    • Consisting of a single property holding a unique identifier

  • Objects representing Connections

    • Consisting of two properties holding the identifiers of the node object representing the start and end of the connection.

For each data source object, the control creates a node or connection as applicable in the xamDiagram .

Hierarchical node data – reference based

The data source contains a collection of objects that represent nodes.

Each of these objects can have a collection of objects that are its logical children. For each object in the data source or one of the child collections, xamDiagram creates a node.

For each parent-child relationship xamDiagram creates a connection.

Hierarchical node data – key based

The data source contains a collection of objects that represent nodes.

Each of the node objects has a property that holds a unique identifier. Each of these objects can have a collection of identifiers that are its logical children. For each object in the data source, a node is created in the xamDiagram .

For each parent-child relationship xamDiagram creates a connection.

Mixed

Any combination of the above. As an example, the data source could contain a number of node objects that each has a child collection of other node objects. In addition, the data source could contain numerous connection objects as well. The resulting diagram displays all the nodes and their logical parent-child connections as well as additional connections for each of the connection objects.

Data sources summary

The xamDiagram receives data through its ItemsSource and ConnectionsSource properties, which accept any IEnumerable. In order to map the input data to nodes and connections in the diagram, three more properties are available – NodeDefinitions, ConnectionDefinitions and ConnectionPointDefinitions. Each of these is a collection of definition objects providing instructions to the diagram about what the data objects represent and how they are interconnected.

The following topics provide additional information related to this topic.

Topic Purpose

This topic provides a step by step guidance on how to bind the xamDiagram control to data where input data objects represent nodes and connections and each of the connection objects has a reference to two node objects representing its start and end nodes.

This topic provides a step by step guidance on how to bind the xamDiagram control to data where input data objects represent nodes and connections. Each of the node objects has a unique string identifier and each of the connection objects has two properties holding the identifiers of the two node objects representing its start and end nodes.

This topic provides a step by step guidance on how to bind the xamDiagram control to hierarchical node data.

This topic provides a step by step guidance on how to bind the xamDiagram control to hierarchical node data with keys.