Version

xamDiagram Configuration Overview

xamDiagram Configuration Overview

xamDiagram configuration summary

The xamDiagram configuration aspects are divided into the following categories:

  • Diagram configuration

  • Items configuration – the configurations applicable to both nodes and connections

  • Nodes configuration

  • Connections configuration

  • User interactions configuration

xamDiagram configuration summary chart

The following table explains briefly the configurable aspects of the xamDiagram control and maps them to the properties that configure them. Further details are available after the table.

Configurable aspect Details Properties

The positioning of the nodes.

Which part of the diagram is visible.

Layout

If the position is not specified individually for each of the nodes a global layout algorithm can be used to layout the nodes. You can either use one of the provided layouts (force directed graph layout, tree layout, grid layout) or implement your own.

Visible portion

The xamDiagram control exposes a set of properties for obtaining which is the currently visible part. The xamDiagram uses a concept of three rectangles whose position and size determine the currently visible part. The XamDiagram class exposes each of these rectangles as a property.

The ViewportRect denotes the currently available space in the control. Margins, paddings of the control set aside, and the ViewportRect have exactly the same size as the xamDiagram .

The WorldRect denotes the area in which there are diagram nodes and connections, that is the rectangle representing the union of all the bounds rectangles of the diagram items.

The WindowRect determines what part of the WorldRect to display in the ViewportRect.

xamDiagram Items Configuration Overview

xamDiagram items configuration summary chart

The following table explains briefly the configurable aspects of the diagram items (nodes and connections) of the xamDiagram control and maps them to the properties that configure them. Further details are available after the table.

Configurable aspect Details Properties

The Look- and-Feel related configuration aspects of diagram nodes and connections.

The template used for presenting and editing the diagram items’ content.

Look-and-feel

The xamDiagram items expose a number of properties enabling customization of their look-and-feel.

Template

Diagram items have two templates that can be applied to their content – display template and edit template. The display template defines the presentation of the content and the edit template is the template applied when editing the item’s content.

xamDiagram Nodes Configuration Overview

xamDiagram nodes configuration summary chart

The following table explains briefly the configurable aspects of the diagram nodes and maps them to the properties that configure them. Further details are available after the table.

Configurable aspect Details Properties

The position and size of diagram nodes.

The shape of diagram nodes

The connection points where connections associated with a node can start and end.

Position and size

The nodes of xamDiagram can be positioned either individually at any location on the diagram’s surface or by applying a layout algorithm (setting available through the Layout property. (For information about the latter approach, refer to the Configuring the Layout topic.)

By default, if no explicit overriding has been applied, a newly created node is displayed at the point of origin of the coordinate system (0, 0).

The size of a diagram node can be controlled explicitly by setting its width and height. There is a default size which depends on its shape. (For reference on default sizes, see Nodes Default Sizes.)

Shape

The xamDiagram provides a number of pre-defined shapes for the nodes. (See the General Overview topic for details.) A pre-defined shape is selected through the ShapeType property. This property accepts as a value the respective node shapes available as ShapeType enumeration. If the desired shape is not available as a pre-defined shape, a custom shape can be set to the Geometry property.

Connection points

Connection points are the points on a node where diagram connections can start/end. A connection point for a node is specified by a name and coordinates.

Each connection point is represented by a DiagramConnectionPoint object exposing Name and Position properties.

When using one of the predefined shape types set through the DiagramNode.ShapeType property, the node’s ConnectionPoints collection is pre-populated with a few points according to the node type. For custom node shapes, no connection points are added by default.

xamDiagram Connections Configuration Overview

xamDiagram connections configuration summary chart

The following table explains briefly the configurable aspects of the diagram connections and maps them to the properties that configure them. Further details are available after the table.

Start and end

There are two possible methods for configuring the start and end points of diagram connections in the xamDiagram control:

  • Relative – by specifying the nodes to connect to – the start and the end node, respectively. This approach requires associating the connection with a start and end node; in this case, the start and end points of the connection are controlled by these nodes (When the node is relocated, the connection adjusts automatically.).

  • Absolute – by specifying the coordinates of the connection’s start and end points on the diagram space.

A mixed approach, i.e. specifying a node at one of the ends of the connection and coordinates for the other end, is allowed, too.

Connection caps

The caps of a diagram connection are the shapes that indicate its start and end. By default the start of a connection has no cap and its end is a filled arrow cap.

The xamDiagram provides a number of pre-defined shapes for the caps. (See the Visual Elements Overview ( xamDiagram ) topic for details.) A pre-defined cap is selected through the StartCapType/ EndCapType properties. These properties accept as a value the respective cap shapes available as a DiagramConnectionCapType enumeration. When using one of the pre-defined cap types, you can additionally specify the cap size through the StartCapSize/ EndCapSize properties.

If you need entirely custom caps, a custom Style with target type of DiagramConnectionCapPresenter can be set to the StartCapStyle/ EndCapStyle properties. In this, style any custom ControlTemplate can be specified for achieving the desired look.

xamDiagram User Interactions Configuration Overview

xamDiagram user interactions configuration summary chart

The following table explains briefly the configurable aspects of the diagram nodes and maps them to the properties that configure them. Further details are available after the table.

Configurable aspect Details Properties

The xamDiagram provides a number of built-in commands.

The xamDiagram provides a context menu for editing properties of items.

The way users can interact with the xamDiagram via the mouse.

The xamDiagram provides an navigation pane of the whole diagram.

The xamDiagram provides functionality for selecting items.

The keyboard shortcuts used for interacting with the xamDiagram .

The xamDiagram provides an additional toolbox control for drag-and-dropping items.

The xamDiagram provides undo/redo functionality

Commands

The xamDiagram control supports a set of commands which can represent an action performed on diagram items or an interaction with the UI of the control or have some impact on its undo/redo operations history. The commands can be invoked using keyboard shortcuts, interactions with other controls, etc..

Most of the commands are associated to keyboard keys and key combinations according to the existing computing interface standards (like using Ctrl+C for copy, etc.). You can however change the keyboard shortcuts (or key combinations) by overriding them programmatically. (For details, see Configuring Keyboards Shortcuts).

Context menu

The diagram items of the xamDiagram control can be configured using the context menu functionality of the control. It is represented by an options pane which is opened upon diagram item’s (or items’) selection through a mouse click on the gear-like icon which then appears. By default, the context menu is disabled on the diagram.

Mouse interaction and tool

The xamDiagram provides a number of ways to interact with the xamDiagram using the mouse. These are configured by two properties – Tool and DefaultDragInteraction. The Tool setting determines what happens when performing a click and drag in the xamDiagram surface. The following tools are available:

  • Pointer

  • Connector

The default is Pointer. It allows a number of interactions controlled by the DefaultDragInteraction setting. The supported interactions are:

  • None

  • Zoom

  • Pan

  • Select (default)

The Connector tool allows drawing a connection by dragging over the diagram surface.

Navigation pane

The xamDiagram control has the capability to display a reduced-size overview of its full content in a separate pane positioned inside the diagram space, by default at its bottom-right corner.

Selection

The xamDiagram control provides functionality enabling the programmatic select of diagram items located on its space. There are several types of selection functionality available - single, multiple, and none, which all can be configured through a property setting. By default, multiple diagram items selection is enabled.

Keyboard shortcuts

The xamDiagram exposes a set of keyboard shortcuts associated with its commands. For a listing of all shortcuts refer to General Overview. The predefined shortcuts can be changed or removed and new ones can be defined.

Toolbox

The xamDiagram control provides functionality, which allows for drag-drop diagram items from a predefined set of shapes, directly on the diagram surface. This functionality is represented by the xamDiagramToolbox™ control. By default, it has two preconfigured shape categories: Basic Shapes and Connections which contain all currently supported diagram node types, including a node representing a label, and the two types of diagram connections.

Undo/redo

The xamDiagram control provides support for undo/redo functionality by maintaining operation’s history and executing undo/redo operations.

The Infragistics Undo/Redo Framework provides the undo/redo functionality in Ultimate UI for WPF.

Related Topics

The following topics provide additional information related to this topic.

Topic Purpose

The topics in this group explain the various configurations applicable to xamDiagram nodes.

The topics in this group explain the various configurations applicable to xamDiagram connections.

The topics in this group explain the various configurations applicable to user interactions in the xamDiagram .