Version

Features Overview (xamDiagram)

Topic Overview

Purpose

This topic explains in detail the main features of the xamDiagram™ control.

Required background

The following topic is a prerequisites to understanding this topic:

Topic Purpose

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

xamDiagram Features

xamDiagram features summary

The xamDiagram provides a number of features delivering the functionality required of a diagramming tool. It supports MVVM friendly data binding and commanding along with available multiple navigation modes. Users can select, move, resize and edit diagram items and their visual aspects. Undo/redo functionality built on top of the Infragistics® Undo Redo Framework is available. Additionally, a navigation pane and a toolbox control are provided.

xamDiagram features summary chart

The following table summarizes the main features of the xamDiagram control. Details about each feature are further available in this help content.

Feature Description

A flexible data binding mechanism is available to suit most data models.

Panning and zooming can both be accomplished through code and user interactions.

Supports selection of one or more items and can be modified by either code or user interactions.

Diagram nodes can be moved and resized. Connections’ start and end points can be moved. Allows for editing of the content (label text) of both nodes and connection.

The xamDiagram has built-in commands for all fitting interactions.

The xamDiagram supports undo/redo for all user actions and property changes done in code.

A context options pane is available for modifying the appearance of the selected nodes and connections.

The xamDiagram integrates the xamOverviewPlusDetailsPane control to display an overview of the diagram.

The xamDiagram control provides a toolbox control with the most popular shapes that can be dragged to the diagram surface.

Diagram nodes allow specifying custom shapes.

Both the nodes and connections in the xamDiagram support custom templates for visualizing or editing their content.

The xamDiagram is built for high performance and to be able to handle thousands of items. One of the techniques used is virtualizing the items that are not currently in view.

Data binding

The xamDiagram supports the following data binding schemes:

  • Nodes only – the data objects contain the information about how they are interconnected. Each data object is represented as a node in the diagram. Connections are automatically displayed for the logical connections defined through the data objects.

  • Nodes and Connections – two types of data objects are provided – one representing nodes and the other connections. The node objects do not contain information about how they are interconnected. For each of the data objects a node or a connection is displayed in the diagram.

  • Mixed – a combination of the previous two where node data objects contain the information about how they are interconnected, but additional connection data objects can be specified as well.

Navigation

Users can navigate and zoom in and out the diagram with the mouse or the keyboard. All aspects of the navigation and zooming can be controlled through code as well.

Selection

By default, the xamDiagram allows users to select one or more nodes and connections by either clicking them or by selecting a rectangular area on the diagram surface. Programmatically, selection can be controlled through the SelectedItems and SelectedDataItems (when using data binding) properties of the XamDiagram or through the IsSelected property of the DiagramItem class (the base class for DiagramNode and DiagramConnection).

The following screenshot shows selected items in the xamDiagram :

xamDiagram Features Overview 1.png

Items interactions

With the selection of one or more than one item, all items can be moved simultaneously as a group by the user. Programmatically the position of nodes can be changed by their Position property. For connections, achieve this by setting their StartNode/ StartNodeKey or EndNode/ EndNodeKey properties to the string identifiers of nodes or by setting the StartPosition and EndPosition properties, to draw a connection between two specific points.

Selecting a single node allows users to resize it. Both proportional and free resizing are supported. When a single connection is selected, users can change its start and end points to either point to other nodes or to any place on the diagram.

The following screenshot demonstrates a node being resized.

xamDiagram Features Overview 2.png

When a diagram item is selected its content can be modified by the users by either double click or by pressing F2.

The following screenshot demonstrates a connection in edit mode.

xamDiagram Features Overview 3.png

Commanding support

In complance with WPF standards, the xamDiagram exposes commands that can be used in the views. Where appropriate, these are bound to the respective ApplicationCommands members. Below is a list of the commands exposed by the xamDiagram :

  • SelectAll

  • Copy

  • Paste

  • Cut

  • Delete

  • Edit

  • Undo

  • Redo

  • ShowOptionsPane

  • CloseOptionsPane

  • BringForward

  • BringToFront

  • SendBackward

  • SendToBack

Undo/Redo

The xamDiagram keeps its own undo/redo stack in order to provide support for restoring the state of its items made either by user interactions or code. The undo/redo functionality uses the Infragistics Undo Redo Framework allowing easy integration into any existing application using the undo/redo framework. Disable the undo/redo functionality if not needed.

Context options pane

Selecting a single or multiple items displays a settings button for opening the context options pane. Using the options in the pane, users can customize the appearance of both nodes and connections. Some of the available customization aspects are opacity, colors for stroke and fill, thickness and dash types for the lines, font and font styling. For connections, the line type can be changed (straight or right-angle) and different start/end caps can be selected.

The following screenshot demonstrates the stroke color being edited for the selected connection and node.

xamDiagram Features Overview 4.png

Navigation pane

The xamDiagram uses the xamOverviewPlusDetailsPane control to display an overview of the diagram and to provide quick navigation options.

The following screenshot demonstrates the enabled navigation pane in a diagram.

xamDiagram Features Overview 5.png

Toolbox with predefined shapes

The xamDiagram provides a helper toolbox control which can be used together with the diagram to provide a better diagram authoring experience. The toolbox contains multiple predefined shapes that can be dragged onto the diagram; moreover, it can also be easily extended to provide custom shapes.

The following screenshot demonstrates an ellipse node being dropped from the toolbox to an empty diagram.

xamDiagram Features Overview 6.png

Custom node shapes

The xamDiagram provides a number of pre-defined shapes for the nodes. If the desired shape is not available as a pre-defined shape, a custom shape can be set to the Geometry property.

The following screenshot demonstrates some of the predefined shapes.

xamDiagram Features Overview 7.png

Custom item templates

Any custom data template can be specified for displaying the diagram nodes’ and connections’ content. A separate template can be applied for editing.

The following screenshot demonstrates a node and connection with applied custom content template.

xamDiagram Features Overview 8.png

Virtualization

In order to support large amounts of data and keep performance high, the xamDiagram virtualizes items that are not currently in view and removes them from the visual tree; thus, improving performance.

Related Topics

The following topic provides additional information related to this topic.

Topic Purpose

This topic provides an overview of the visual elements of the xamDiagram control.