# MindFusionDoc Documentation Map
This is a unified documentation resource optimized for LLMs. The high-level guides, architectural overviews, and tutorials are inlined directly below in Section 1. All class references are merged into single files per class/struct and linked in Section 2.
# Section 1: High-Level Guides and Overviews
## Untitled Topic -1
## Introduction
This documentation is currently being ported from WPF to Avalonia. Some sections may still reference WPF types or APIs. Where this occurs, please use the corresponding Avalonia equivalent when following the examples. The documentation is being updated progressively.
AvaloniaDiagram is a general-purpose software component that can be used to display various types of diagrams and charts, in many different formats. It is implemented as an Avalonia control and can be easily integrated into any application targeting the Avalonia UI platform. By providing your software with ready to use capabilities for visualizing and editing relational data, AvaloniaDiagram saves you from hundreds of hours of coding and debugging efforts.
AvaloniaDiagram can give graphical representation to:
- Workflow processes
- Class relationships
- Graphs and networks
- Entity-relationship / database diagrams
- IVR systems
- Industrial automation processes
- Genealogy trees
- Algorithms and flowcharts
- Organizational charts
- XML documents
- Classification hierarchies
- And much more
AvaloniaDiagram provides intuitive user-interaction model for creating or editing diagrams. In addition, its programmatic interface places at your disposal many useful functions, ranging from printing and XML serialization to path-finding and automatic layout algorithms.
## General Information
### The AvaloniaDiagram Component
- Redistribution is royalty free
- Assembly is strong-named
- Can be purchased with source code
- Is written in C#
- Implements the Document/View architecture
### User Interaction
- Several user interaction modes
- Free-form drawing
- Free-form selection mode
- Scrolling and zooming
- Copy and paste to/from Windows clipboard
- Panning
- Automatic scrolling while dragging items with the mouse
- Magnification
- Alignment to grid
- Node alignment guides
- Multiple selection
- Tool-tips
- Docking points can be defined for nodes
- Undo / redo support
- Resize multiple nodes simultaneously
- Rotate and flip shapes
- Multi-touch gestures
### Programming
- Programmatic access to the diagram elements
- Extension methods for fluent API
- Numerous properties for customizing appearance and behavior
- Numerous utility methods
- Path finding and cycle detection
- Rich event set
### Store and Retrieve Diagrams into/from
- Files on disk
- .NET streams
- ASCII strings
- XML documents
- JSON strings
### Output
- To the screen by using Windows Presentation Foundation
- Printing and print preview
- To a browser using HTML image maps
- Display graphs in 3D
### Import and Export
- Import Visio 2003 XML (VDX) Drawings
- Import Visio 2013 XML (VSDX) Drawings
- Import OpenOffice Draw (ODG) files
- Import Scalable Vector Graphics (SVG) files
- Export bitmap images
- Export Portable Document Format (PDF) files
- Export Scalable Vector Graphics (SVG) files
- Export Visio 2003 XML (VDX) Drawings
- Export Visio 2013 XML (VSDX) Drawings
- Export Excel Open XML Format (XLSX) files
- Export Windows MetaFile (WMF) images
- Export Drawing Exchange Format (DXF) files
### Diagram Elements
- Use any Avalonia Control as a diagram node
- More than 100 predefined node shapes
- Display SVG drawings in nodes
- Ability to define custom shapes and shape libraries
- Templatable diagram nodes
- Rotation of shapes at arbitrary angles
- Container nodes
- Tables with unlimited number of rows and columns
- Table cells can span several columns and rows
- Free-form outlines drawn by users
- Display hierarchical data in TreeView nodes
- Display shapes from Visio stencil files
- Assign diagram items to layers
- Sections of table rows can be expanded or collapsed
- Links can comprise multiple segments
- Link segments can be straight lines or curves
- Display multiple labels per link
- Support for custom node and link types
### Automatic Layout
- Non-blocking methods
- Spring-Embedder graph layout
- Directional tree layout
- Horizontal/vertical binary tree layout
- Radial tree layout
- Fractal tree layout
- Layered graph layout
- Grid layout
- Simulated Annealing graph layout
- One-way graph layout
- Orthogonal graph layout
- Circular graph layout
- Orthogonal link router
- Source code flowchart layout
- Decision flowchart layout
- Process diagrams layout
- Tree map layout
- Swimlane diagrams layout
- Topological graph layout
- Cascading graph layout
- Hierarchical graph layout
- Triangular graph layout
- Multi-level graph layout
- Automatic link routing
### Appearance
- Nodes can display images and text
- Multiple text labels per item
- Various text alignment styles
- Text can be laid out in polygonal areas
- Glass visual effects
- Styled HTML-like text formatting
- Customizable fonts and colors
- Custom painting of nodes
- Shadows
- User-assigned mouse cursors
- Z-order
- Rich choice of pen and brush styles
- Transparent nodes
- Invisible nodes
- A background swimlane grid
### Behavior
- Lock diagram elements
- Read-only mode supported
- Tables can be scrolled
- Collapse and expand hierarchy branches
- In-place text editing
- Dynamic positioning of links relative to connected nodes
### Link Diagram Items
- Nodes to nodes
- Table rows to table rows
- Nodes to table rows
- Unconnected links
### Hierarchical Grouping
- Attaching nodes to other nodes
- Attaching nodes to link control points
- Attaching nodes to link segments
### Auxiliary Controls
- Overview control
- Ruler control
- VirtualizingDiagram control
- NodeListView control
- ShapeListBox control
- LayerListView control
- TabbedDiagramView control
- Zoom control
- Shape designer control
## Getting Started
The following topics describe how to integrate the Diagramming for Avalonia API into your project, and create an instance of the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md) control.
## Add Diagram Assemblies
You can add diagram library's .NET assemblies to your project either from the (#add-nuget-package) repository, or from (#add-local-assemblies) installed distribution.
## Add Nuget Package
In order to integrate Diagramming for Avalonia into your Visual Studio project, select Manage Nuget Packages from Project menu:
Open the Browse tab, and enter MindFusion.Diagramming.Avalonia in the search field. Select the MindFusion.Diagramming.Avalonia package and click Install. If you plan to use other MindFusion components along with the diagram (such as calendar, spreadsheet, report), select MindFusion.Pack.Avalonia instead:
Once the package is installed, you should be able to add controls from the library to your UI ((Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md), NodeListView, (Markdown/T_MindFusion_Diagramming_Avalonia_Overview.md), etc).
## Add Local Assemblies
If you have installed Diagramming for Avalonia distribution locally and your project targets .NET 4, you should be able to see controls from the API in Visual Studio toolbox and can start using them by dragging to Xaml UI. If targeting CoreCLR (.NET 5+), locally installed assemblies do not show in the toolbox at this time, and you must add references to them manually in order to use the diagramming API. To do so, select the Add Project Reference command from Project menu:
In Reference Manager, select the Browse tab and click the Browse button. Navigate to the Diagramming for Avalonia install location, select assemblies for respective .NET version and click Add:
Once assembly references have been added, you should be able to add controls from the library to your UI ((Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md), NodeListView, (Markdown/T_MindFusion_Diagramming_Avalonia_Overview.md), etc).
## Create DiagramView Instance
After following one of the previous topics, you should be able to create a (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md) instance in your Xaml UI.
### Add a DiagramView using Xaml markup
Add an xmlns attribute to the root Xaml object and set its value to "using:MindFusion.Diagramming.Avalonia", which lets you create objects from the Diagramming namespace in Xaml.
- Add a DiagramView element, and set its Name attribute to a variable name that lets you access the instance from code-behind.
- Optionally add a nested Diagram element, and set its Name attribute to a variable name that lets you access the instance from code-behind. If this step is omitted, you can later access the diagram model object through the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#diagram) property of (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md).
```xaml
```
### Add a DiagramView from toolbox
If you have installed the library locally and targeting .NET 4, you should be able to add (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md) control from the Visual Studio toolbox:
Open the Visual Studio toolbox.
- Select and drag the DiagramView icon to your Xaml window, and drop it into a panel. That creates a (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md) component.
- Set the view's Name attribute to a variable name that lets you access the instance from code-behind.
- Optionally drag a Diagram to the DiagramView, and set its Name attribute to a variable name that lets you access the instance from code-behind. If this step is omitted, you can later access the default diagram model object through the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#diagram) property of (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md).
### Customize behavior and appearance
Now you can set properties of the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md) and (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) by specifying attribute values in Xaml markup, or using the Visual Studio 'Properties' window.- Choose a value for the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#behavior) property, which defines how the control interprets user input. The default value (Markdown/T_MindFusion_Diagramming_Avalonia_Behavior.md) specifies that users can draw shape nodes and connect them with links. Another value - (Markdown/T_MindFusion_Diagramming_Avalonia_Behavior.md) - allows drawing tables and relations. (Markdown/T_MindFusion_Diagramming_Avalonia_Behavior.md) prevents users from drawing new items, but allows them to modify existing ones.
- Customize the appearance of your diagram by setting properties from the 'Appearance' category. Properties from the diagram's 'Defaults' category specify initial values for the properties of diagram elements. Browse the other sections of this help file to learn more about the functionality provided by the AvaloniaDiagram's classes, methods and properties.
## User Interaction
Most likely an application would use AvaloniaDiagram to enable users to interactively create diagrams, flowcharts and other kinds of presentation documents. A user composes or edits a diagram by drawing its elements on the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md) canvas area. With the help of a mouse or touch screen, users draw shapes, tables and links, possibly connecting them in complex hierarchies, graphs, trees or other structures they might need.
## Creating New Items
New items can be created by drawing them with the mouse. While a user drags the mouse, the view of the control is updated to show what the new item would look like at the pointer location. If the operation cannot be completed at the current mouse position, the cursor changes to a crossed out circle. When the user releases the button, the item is created. The control does not let users create very tiny nodes which would be hard to select and modify. By default links can be drawn only between nodes, unless the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#allowunconnectedlinks) property is enabled. Users can cancel item creation by pressing the right mouse button while drawing.
## Modifying Items
A user modifies an item by dragging its manipulation handles. The (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#modificationstart) property specifies when these handles appear. The first option, (Markdown/T_MindFusion_Diagramming_Avalonia_ModificationStart.md), makes the handles appear when the mouse hovers over an item; modification of the item can start immediately by pointing it and dragging a handle. The second option is (Markdown/T_MindFusion_Diagramming_Avalonia_ModificationStart.md): in order to be modified, an item should first be selected. Manipulation handles appear around the item to indicate that now it can be moved or resized. Number and functionality of those handles depend on the item type and the value of the corresponding (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#handlesstyle) property. What the user sees while moving or resizing items can be customized further by setting the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#modificationeffect) property.
## Modifying a Node
Usually nodes have nine adjustment handles. The one at the center can be used to move the node. When dragged, each corner handle resizes the node by moving the two edges adjacent to the corresponding corner. The edge handles placed at the center of each side can be used to resize a node either horizontally or vertically. Shape nodes can be rotated using an additional round handle drawn above them. Each handle can be enabled or disabled by setting or clearing the respective bit in (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#enabledhandles).## Modifying a Link
Variety and behavior of link adjustment handles depend on the link's (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#shape) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#segmentcount). Control-points stay at both ends of each segment that constitutes a link. AvaloniaDiagram supports three types of link shapes. The following sections discuss how to modify links of each type.
- The first type called (Markdown/T_MindFusion_Diagramming_Avalonia_LinkStyle.md) defines links which consist of a series of straight segments drawn between control points. There are no restrictions as to the number of segments. Dragging a control-point modifies each segment adjacent to the point. If the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#allowsplitlinks) property is enabled, users are allowed to insert new control points or to remove existing ones. Inserting a control point is done by pressing the left mouse button over a segment and dragging. The new point appears at the mouse location and splits the pointed segment in two.
- If link's (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#shape) is set to (Markdown/T_MindFusion_Diagramming_Avalonia_LinkStyle.md), each segment has 4 manipulation handles that define a curve. Each curve goes through the end-points, which are shaped as circles. Bend of the curve is defined by the middle two points shaped as rectangles. If a user drags an end-point modification handle, the adjacent control points will be moved with same translation vector as that of the end-point. If a bend control point is dragged, the symmetric control point of the neighboring curve is also moved to ensure the two stay on the same line with the end-point and on the same distance from it.
- (Markdown/T_MindFusion_Diagramming_Avalonia_LinkStyle.md) links consist of straight horizontal and vertical segments, each one orthogonal to its neighbors. If a control-point is dragged, the segments adjacent to it are moved and resized preserving their orthogonal orientation to each other. If the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#allowsplitlinks) property is enabled, users are allowed to insert new control points to (Markdown/T_MindFusion_Diagramming_Avalonia_LinkStyle.md) links or remove existing ones. The orientation of the link segments can be changed if (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#cascadeorientation) is set to (Markdown/T_MindFusion_Diagramming_Avalonia_Orientation.md).
## Modifying a Table
Table modification handles are drawn as dotted lines over its borders. Dragging table's caption areas moves it. Dragging any table's side or corner resizes it.
## Selecting Items
Multiple items are selected by dragging while CTRL key is down. Selection can also be toggled with CTRL + clicking an item. A rectangle appears around selected items, allowing a user to move all of them at once.
## Scrolling and Panning
The (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md) control displays scrollbars when diagram's (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#bounds) is larger than the current viewport. The scrollbars let the user scroll the diagram's drawing area. Pressing the left mouse button and dragging while the ALT key is down scrolls the diagram too.
## Interpreting Users Actions
Mouse operations can be interpreted in different ways depending on the value of the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#behavior) property. It defines whether for example dragging the mouse creates a node or selects existing items. Check the property description for more information on the built-in input modes.
You can also create a custom mouse input controller by deriving from the (Markdown/T_MindFusion_Diagramming_Avalonia_Behaviors_BehaviorBase.md) class and setting the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#custombehavior) property of (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md). A custom controller could implement only the higher-level (Markdown/T_MindFusion_Diagramming_Avalonia_Behaviors_BehaviorBase.md#startdraw) method to specify what kind of operation should start when the user begins to drag the mouse, or the CreateNode method to create an instance of a custom node class. Alternatively, override the lower-level (Markdown/T_MindFusion_Diagramming_Avalonia_Behaviors_BehaviorBase.md#onmousedown), (Markdown/T_MindFusion_Diagramming_Avalonia_Behaviors_BehaviorBase.md#onmousemove) and (Markdown/T_MindFusion_Diagramming_Avalonia_Behaviors_BehaviorBase.md#onmouseup) methods to completely overhaul user interaction.
## Licensing
There are no separate trial builds of MindFusion assemblies. When you purchase a component you can find the license key for this component listed on the Keys & Downloads page at the customer's portal. Assign this license key to the LicenseKey property to disable the component's evaluation mode and stop displaying trial messages. If your application contains more than one MindFusion component, you could call MindFusion.Licensing.LicenseManager.AddLicense(key) method from application start-up code to specify the key once instead of setting it per each control.
## Programming Interface Overview
## Document-View Architecture
MindFusion.Diagramming implements the Model-View-Controller (MVC) architectural pattern. The MVC design pattern as applied to MindFusion.Diagramming separates the diagram data (model) from its representation to the user (view) and controlling it by the user (controller).
### Single Diagram Canvas
The (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) class represents the diagram data model and provides operations to process the data. It exposes properties and methods for adding new diagram elements, finding and accessing existing elements, or removing them.
The (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md) class presents the relevant data from the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) class by adding (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md) presenters to the Avalonia visual tree. When the diagram is changed, the view automatically redraws the affected part of the viewport to reflect the changes. Multiple views can display the same diagram, set by their (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#diagram) property. Each view can have a different zoom level and scroll position.
The (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md) class also integrates the Controller part of the MVC, represented mostly by the view's (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#behavior) property. That property specifies how GUI actions to manipulate the data should be interpreted.
### Multiple Diagram Pages
The (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramDocument.md) class represents a collection of diagram pages or sheets, represented by (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramPage.md) objects. Document's pages are stored in its (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramDocument.md#pages) collection. The (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramDocument.md#savetoxml) method of (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramDocument.md) saves all pages in a single file, and respectively the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramDocument.md#loadfromxml) method loads all pages from the file.
(Markdown/T_MindFusion_Diagramming_Avalonia_DiagramPage.md) is derived from (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) and only adds a few properties, so any code that processes (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) objects will work with (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramPage.md) objects too. A diagram document forwards each event raised by its pages, giving you a chance to use the same handler for events raised by different pages. If a page should implement distinct user interaction or validation logic, it is also possible to attach handlers to the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) events inherited by (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramPage.md).
A single (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramPage.md) could be assigned to the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#diagram) property of (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md), and that lets you create your own user interface for presenting a list of pages to the user and selecting a current page.
The library includes a (Markdown/T_MindFusion_Diagramming_Avalonia_TabbedDiagramView.md) that presents all pages of a document in a tabbed user interface where each tab corresponds to a page. The page displayed in the active tab is exposed by the (Markdown/T_MindFusion_Diagramming_Avalonia_TabbedDiagramView.md#currentpage) property of (Markdown/T_MindFusion_Diagramming_Avalonia_TabbedDiagramView.md). The active page can be changed interactively by activating its associated tab. New pages can be added and removed to / from the document through buttons in the tab strip and the pages can be rearranged by dragging their associated tabs with the mouse.
## User Interface Components
The following controls from the library can be added to a XAML view to enable users to create and display diagrams:
### DiagramView
(Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md) renders the contents of a (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) and allows users to create new items or modify existing ones using a mouse or other pointing devices. The (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#behavior) property defines how the control interprets user actions. Additional properties control scrolling and zooming of the view.### TabbedDiagramView
(Markdown/T_MindFusion_Diagramming_Avalonia_TabbedDiagramView.md) displays multi-page (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramDocument.md)s. Each (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramPage.md) is displayed in its own tab. Apart from base (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md) members, the control includes properties for customizing the tab strip, and to specify whether users are allowed add or remove pages.
### Palette
The (Markdown/T_MindFusion_Diagramming_Avalonia_Palette.md) control represents a tool palette that displays (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md) objects grouped into categories. It implements Accordion user interface that displays (Markdown/T_MindFusion_Diagramming_Avalonia_ItemListView.md) components as its child panels, and category icon, title and collapse/expand button in pane headers. Each child (Markdown/T_MindFusion_Diagramming_Avalonia_ItemListView.md) displays the items added to its corresponding category. Call the (Markdown/T_MindFusion_Diagramming_Avalonia_Palette.md#addcategory) method to define a category and create its respective accordion pane. Call (Markdown/T_MindFusion_Diagramming_Avalonia_Palette.md#additem) to add an item to specified category. The control can also be populated by setting (Markdown/T_MindFusion_Diagramming_Avalonia_Palette.md#itemssource) to a list of (Markdown/T_MindFusion_Diagramming_Avalonia_PaletteCategory.md) objects. Palette provides same behavior and appearance properties as the (Markdown/T_MindFusion_Diagramming_Avalonia_ItemListView.md) class.### ItemListView
(Markdown/T_MindFusion_Diagramming_Avalonia_ItemListView.md) represents a tool palette that contains uncategorized list of diagram items. Items can be added or removed using the Items property of base ListView. Drag-and-drop operations from (Markdown/T_MindFusion_Diagramming_Avalonia_ItemListView.md) to (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md) create a copy of the dragged item, and set its size to (Markdown/T_MindFusion_Diagramming_Avalonia_ItemListView.md#newinstancesize).### Overview
(Markdown/T_MindFusion_Diagramming_Avalonia_Overview.md) provides a scaled-down view of a target (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md), helping users work with larger diagrams. A tracker rectangle shows current viewport of the main (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md), and by dragging it users can change the scroll position. It can also be resized to zoom the target view.### ZoomControl
ZoomControl lets users change the zoom level of a target (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md) by dragging a slider. It also includes arrow buttons for scrolling the view.### Ruler
The (Markdown/T_MindFusion_Diagramming_Avalonia_Ruler.md) control displays horizontal and vertical scales that let users measure and align diagram nodes.
## Diagram Structure
The following topics are contained within this topic:
(#standard-item-types)
Information about the standard AvaloniaDiagram item types, such as (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md), (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md).
(#custom-item-types)
Information on how to implement and use custom item types.
(#using-avalonia-controls-as-nodes)
Information on how to host Avalonia controls in AvaloniaDiagram diagrams.
(#creating-and-deleting-items)
Information on how to create and delete items both interactively and programmaticaly.
(#accessing-items)
Information about how to access the diagram items, how to get the selected items and how to find particular items in the diagram according to a specifiec criteria.
(#attaching-and-grouping-items)
Information about the use of the (Markdown/T_MindFusion_Diagramming_Avalonia_Group.md) class in orde to create hierarchies of dependent objects in AvaloniaDiagram.
(#layers)
Information about how to organize items in layers and how to use the (Markdown/T_MindFusion_Diagramming_Avalonia_LayerListView.md) control.
(#collapsing-and-expanding-tree-branches)
Information on how to enable expanding diagram nodes.
(#multiple-diagram-pages)
Information about the multi-page (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramDocument.md) class and the (Markdown/T_MindFusion_Diagramming_Avalonia_TabbedDiagramView.md) control.
## Standard Item Types
Diagram elements in AvaloniaDiagram are represented by instances of the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md) classes. Combined and linked together, they can form complex data structures such as process or entity-relationship diagrams, class hierarchies, networks and graphs. Each of their rich features can be customized through numerous methods and properties. AvaloniaDiagram also offers intuitive user interface for drawing and editing diagram items interactively.
### Shape Nodes
Shape nodes can represent geometric shapes, flowchart elements, icons in network diagrams, and so on. They can display both graphics and text in different fonts, sizes and colors. There are more than 100 predefined node shapes (you can preview them here) and apart from them, AvaloniaDiagram offers an easy way to define custom shapes. Shape nodes can be rotated, either interactively using the round selection handle drawn above them, or programmatically using the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#rotationangle) property. (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md) appearance can be customized further using several types of custom painting. The first type gives you full control over the painting. With the second one your painting code is performed additionally to the basic painting. The third one performs standard drawing of nodes and custom drawing of their shadows.
### SVG Nodes
The (Markdown/T_MindFusion_Diagramming_Avalonia_SvgNode.md) class represents nodes that display SVG drawings, in addition to the rendering provided by the base (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md) class. A node's SVG drawing is rendered after its associated bitmap (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md#image). Set the (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md#transparent) property of base type to hide the node's (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md#shape) geometry and draw only SVG graphics. The SVG drawing that should be shown inside an (Markdown/T_MindFusion_Diagramming_Avalonia_SvgNode.md) is specified through the node's (Markdown/T_MindFusion_Diagramming_Avalonia_SvgNode.md#content) property. SVG graphics are loaded and associated with the node through an SvgContent object, which should be initialized and then assigned to this property.
### Templated Nodes
The (Markdown/T_MindFusion_Diagramming_Avalonia_TemplatedNode.md) class represents nodes whose appearance is set through Xaml data templates. This class is useful mostly as a base type of custom nodes, as shown in (#tutorial-3-create-a-custom-node-type) 3 and 4. However it is not abstract and can be used directly if the text -related properties defined in (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md) are sufficient for your purposes. The appearance of such nodes can be set through their (Markdown/T_MindFusion_Diagramming_Avalonia_TemplatedNode.md#template) property or the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#nodetemplate) property of the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) class.
### Table Nodes
Tables can be used to represent table schemas in database diagrams or classes in class-hierarchies. A table contains cells arranged in a grid, and every cell can display text and/or image. Cells can span several rows and columns as set in the (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode+Cell.md#rowspan) and (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode+Cell.md#columnspan) properties. Cells, columns and rows can be customized in various ways - there are properties available for setting their extents, style, image and text alignment. Tables' dimensions can be programmatically changed; inserting, appending or deleting rows and columns can be done in a very comprehensive, intuitive way whenever you might need it. Tables can also display background images and graphics. The file formats supported are BMP, GIF, JPEG, ICO and WMF (the same applies for shape nodes).
### Container Nodes
A (Markdown/T_MindFusion_Diagramming_Avalonia_ContainerNode.md) can contain other diagram nodes. When a container is moved, the contained nodes move too. Containers can be folded to hide the contained nodes, and unfolded back to show them again. Nodes inside a container can be linked to nodes both inside and outside of it. When a container is folded, the links connected to contained nodes point to the container outlines. Containers can be nested within each other to unlimited depth.
### Free-form Nodes
A (Markdown/T_MindFusion_Diagramming_Avalonia_FreeFormNode.md) collects all points from users' mouse or touch input and displays them as node's outline. To let users draw free-form nodes interactively, set (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#behavior) to (Markdown/T_MindFusion_Diagramming_Avalonia_Behavior.md). Use the (Markdown/T_MindFusion_Diagramming_Avalonia_FreeFormNode.md#points) property of (Markdown/T_MindFusion_Diagramming_Avalonia_FreeFormNode.md) to get or set outline points programmatically. If the (Markdown/T_MindFusion_Diagramming_Avalonia_FreeFormNode.md#closed) property is set, the node is drawn as a closed shape and its interior filled, or otherwise the node is drawn as a poly-line. If the distance between first and last points drawn by user is shorter than (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#autoclosedistance), the node gets closed automatically. ### TreeView Nodes
The (Markdown/T_MindFusion_Diagramming_Avalonia_TreeViewNode.md) class represents nodes that can display hierarchical data. The root items displayed in the node can be accessed through the (Markdown/T_MindFusion_Diagramming_Avalonia_TreeViewNode.md#rootitems) property. New items can be added to and removed from the returned collection. The root items can have child items on their own and so on. For more information, refer to the (Markdown/T_MindFusion_Diagramming_Avalonia_TreeViewItem.md) class.### Links
Links are used to represent various types of connections and relations in diagrams. AvaloniaDiagram offers three basic link types:
- (Markdown/T_MindFusion_Diagramming_Avalonia_LinkStyle.md) links composed of straight-line segments;
- (Markdown/T_MindFusion_Diagramming_Avalonia_LinkStyle.md) links composed of Bézier or spline segments;
- (Markdown/T_MindFusion_Diagramming_Avalonia_LinkStyle.md) links composed of horizontal and vertical segments, alternating their orientation so that every segment is orthogonal to its neighbor.
A link can be connected to a node at each of the link's ends. It is also possible to have unconnected links - having one or both of their ends not connected to nodes. Some customizable link's properties are: arrowheads, (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#shape), color, text, pen width and style, modification behavior and number of segments.
## Custom Item Types
You can create your own item types by deriving the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md) classes or their successors such as (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md), (Markdown/T_MindFusion_Diagramming_Avalonia_ContainerNode.md) and so on. You can add custom data fields to the diagram items, and implement custom visualization and interaction functionality.
### Serialization
If you add custom fields to your item class, you will probably want their values saved when saving diagram files, and restored when loading files. To enable this, override the SaveTo and LoadFrom methods of the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md) class, and you can use BinaryWriter and BinaryReader objects to implement binary serialization. For XML serialization, you must implement the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#savetoxml) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#loadfromxml) methods.### Clipboard operations
You must implement the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#clone) method in order to enable (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#copytoclipboard) and (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#pastefromclipboard) to work with your custom item type, If (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#clone) is not implemented, you will get an instance of the base class created for the pasted item, and this could lead to an exception when the base class deserialization code tries to load the item state from a data stream created by the derived class. If your class has any custom fields, it must also implement the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#savetoxml) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#loadfromxml) methods for proper serialization.### Rendering
If you need to provide custom rendering for your items, override the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#draw) method. In this way, you can render your item on a DrawingContext surface.
### User interaction
To enable drawing of items from a custom class, set the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#behavior) property of the diagram view to Custom, and set the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#customnodetype) or (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#customlinktype) property to the Type object that corresponds to your class. If you need to change how items handle user interaction while they are being initially created, implement the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#startcreate), (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#updatecreate) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#completecreate) methods. In order to change how items respond to user interaction while they are being modified, implement the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#startmodify), (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#updatemodify) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#completemodify) methods.
## Using Avalonia controls as nodes
The (Markdown/T_MindFusion_Diagramming_Avalonia_ControlNode.md) class lets you use any Avalonia Control as a diagram node. This allows you to use ready-made or custom Avalonia controls to display or edit the entities represented in your application's diagrams. The controls hosted in AvaloniaDiagram nodes might be interactive and with embedded user interface. For example you might utilize calendars, grids, rich-text controls or html-pages as entity editors or viewers. You might also create your own custom control and integrate it seamlessly with AvaloniaDiagram; as a result you can get as advanced entity-relationship diagram editor as your application needs.
(Markdown/T_MindFusion_Diagramming_Avalonia_ControlNode.md) allows user-defined or standard UI controls to be hosted as nodes in the MindFusion.Diagramming API across various platforms. In the Avalonia version, however, it is retained primarily for compatibility and as a migration aid. For Avalonia applications, we recommend using (Markdown/T_MindFusion_Diagramming_Avalonia_TemplatedNode.md) instead and applying custom UI through data templates.
### Creating Controls Interactively
To let the user draw Control objects with the mouse, set (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#behavior) to Custom. The type of controls to be created in the host nodes is specified by the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#customnodetype) property of (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md). If the following code executes, each node drawn by users would host a GridView instance, and nodes could be connected by drawing links between them:
```csharp
// Draw datagrid nodes and allow connecting them with links
diagramView.Behavior = Behavior.Custom;
// Default type of hosted controls is GridView
diagram.CustomNodeType = typeof(GridView);
```
```
' Draw datagrid nodes and allow connecting them with links
diagramView.Behavior = Behavior.Custom
' Default type of hosted controls is GridView
diagram.CustomNodeType = GetType(GridView)
```
### Adding an Avalonia Control Programmatically
To display a WPF UIElement-derived object in the diagram programmatically, add an instance of the class to the diagram's (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#nodes) collection. This automatically creates a (Markdown/T_MindFusion_Diagramming_Avalonia_ControlNode.md) for the UIElement object. You can as well instantiate the (Markdown/T_MindFusion_Diagramming_Avalonia_ControlNode.md) explicitly and add it to (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#nodes). To get the (Markdown/T_MindFusion_Diagramming_Avalonia_ControlNode.md) associated with an UIElement, use the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#getdiagramitem) attached property.
## Creating and Deleting Items
### Creating Items Programmatically
In order to add a new node or link to a diagram, create an instance of the item class by using the new operator and add it to the diagram's (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#nodes) or (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#links) collection. This works the same way for adding both items from your custom class or ones from the AvaloniaDiagram predefined types.
There are several shortcut methods provided for creating instances of the predefined node and link types. The methods are members of the diagram's (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#factory) object:
- The (Markdown/T_MindFusion_Diagramming_Avalonia_Factory.md#createshapenode) method creates a (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md) at the specified position.
- The (Markdown/T_MindFusion_Diagramming_Avalonia_Factory.md#createtablenode) method creates a (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md) at a specified position. Tables have a method that connects them with other tables called (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md#addrelation).
- The (Markdown/T_MindFusion_Diagramming_Avalonia_Factory.md#createcontainernode) method creates a (Markdown/T_MindFusion_Diagramming_Avalonia_ContainerNode.md) at the specified position.
- There are several overloads of the (Markdown/T_MindFusion_Diagramming_Avalonia_Factory.md#creatediagramlink) method that allow connecting two nodes of the same type or of different types.
### Drawing New Items
Users can draw diagram elements with the mouse. The (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#behavior) property specifies what type of elements should be created when a user starts drawing. When a user starts drawing, an item is created and an initialization event is raised to let you customize the item appearance before showing it on the screen. The initialization events include ones such as InitializeNode, InitializeLink, and so on. While items are being drawn, the control raises validation events such as (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#nodecreating) to let you validate the operation and prevent creating items at a specific location. When the user releases the mouse button, the item is added to the collection that contains items from the same type (for example (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#nodes)) and an event is raised, for example (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#nodecreated).
### Deleting Items
Call the (Markdown/CC_T_MindFusion_Diagramming_Avalonia_ItemCollectionBase_0.md#remove) method of the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#nodes) or (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#links) collection to delete an item from the diagram. The (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#clearall) method clears diagram contents by deleting all items. A shortcut for removing a link between two tables is provided by the (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md#breakrelation) method.
By default, deleting a node also removes its links. Set the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#autodeletelinks) property to false to prevent that, and disconnect the links instead.
## Accessing Items
One of the most common tasks when using the component is iterating over all items in the diagram document or navigating through the connections between items - from a node to the incoming or outgoing links, or from a link to its origin and destination nodes. To enumerate items of a diagram use the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#items), (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#links) or (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#nodes) collections. The nodes that a link connects are referenced by the link's (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#destination) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#origin) properties. To access the links that are connected to a node, use its (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#incominglinks) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#outgoinglinks) collections. The first collection contains references to all links pointing to the node, the second - to the links that start from it. Links can connect to rows of a table; to find such links use table's (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md#rows) collection and the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#incominglinks) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#outgoinglinks) collections. A shortcut for accessing the other end of a relation in entity-relationship diagrams is provided by the (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode+Row.md#relatedonetomany) and (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode+Row.md#relatedmanytoone) properties of the (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode+Row.md) class.
### Selected Items
If only one item is selected, it is considered the active item and can be accessed with the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#activeitem) property. The type of this property is (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md); you can get the actual type of the selected item through .NET reflection. Multiple items can be selected when clicking or dragging with the CTRL key pressed at the same time. Multiple-selection is represented by the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#selection) property of the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) class. The (Markdown/T_MindFusion_Diagramming_Avalonia_Selection.md) object provides collections to access the selected (Markdown/T_MindFusion_Diagramming_Avalonia_Selection.md#links) and (Markdown/T_MindFusion_Diagramming_Avalonia_Selection.md#nodes).
### Finding Items
You can search for diagram items by their Tag or (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#id) using the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#findlink), (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#findnode), (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#findlinkbyid) and (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#findnodebyid) methods. Tag and id objects are compared by calling the (Markdown/T_MindFusion_Diagramming_Avalonia_Shape.md#equals) method of the System.Object class. Thus if the tags are of value type, they are compared by value (that is bitwise equality). If they are of reference type their (Markdown/T_MindFusion_Diagramming_Avalonia_Shape.md#equals) method is used. If there are more items with the same tag, the first one will be returned. If no item with the specified tag exists, a null reference (Nothing in Visual Basic) will be returned. Groups can also be searched by tag using (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#findgroup).
### Relationship Queries
The (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#query) method traverses the graph by following node/link connections and group's parent/child relationships to find items in specific relation to the current one. The method receives a string argument consisting of selectors and optional predicates. The query is executed in several steps. In each step the result set is constructed from the previous result set by following the relationship specified by the current selector. If a predicate is specified after the selector identifier, the result set is filtered to include only items for which the predicate evaluates to true.
## Attaching and Grouping Items
AvaloniaDiagram allows attaching a node to another diagram element, establishing a subordinate - master relationship between the two items. The easiest way to attach nodes is to call the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#attachto) method. When a master element is moved or resized, any subordinated node follows it, so that the initial distance between the two items stays constant. This happens both when a user moves the master item around, and when the item position is changed using a method or a property.
Recent versions of the API include (Markdown/T_MindFusion_Diagramming_Avalonia_NodeLabel.md) and (Markdown/T_MindFusion_Diagramming_Avalonia_LinkLabel.md) classes, which address several of the scenarios described below. We recommend using these classes when appropriate, as they offer a more lightweight and easily configurable alternative to attached nodes.
### Possible Uses
- Attach a (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md#transparent) shape node to another item and set its (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#text), so that the shape node acts as an additional label assigned to the main item.
- Attach a shape node to another item and set the node's (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md#image), so it acts as an additional icon displayed inside or near the main item.
- Attach a shape node or a table to another item and handle the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#nodeclicked) or similar events to perform some action on the main item. This makes the subordinated node act as a button or another type of UI element attached to the main item. For more complex UI requirements, use an attached (Markdown/T_MindFusion_Diagramming_Avalonia_ControlNode.md) and handle the events raised by the control it hosts.
- In all previous cases, the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#locked) property can be set for attached nodes, which are used only as decorations embellishing the main item. That prevents users from selecting, modifying or drawing links to the subordinates.
- Attach child elements in a tree branch to the branch root, so that when a user moves a tree node, the node's children moves simultaneously with it. Modifying an item in such hierarchical group makes the modification pervade through all dependant subordinated items.
### Hierarchical Grouping
A unit of attached items is represented by an instance of the (Markdown/T_MindFusion_Diagramming_Avalonia_Group.md) class. To create a group, instantiate a (Markdown/T_MindFusion_Diagramming_Avalonia_Group.md) object and add it to the diagram's (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#groups) collection, or call the (Markdown/T_MindFusion_Diagramming_Avalonia_Factory.md#creategroup) method passing the master object as argument. Attach items to the group using the various Group methods. The (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#attachto) method of nodes is a shortcut to creating a group and attaching an item to it.
Every member of a group can be the master item of another group, that is an item can be subordinate in one group and meanwhile be another group's master. AvaloniaDiagram doesn't impose any limits to the depth and width of group hierarchies built that way. However, it is not possible to put an item as a subordinate in more than one groups because the hierarchy relations would become ambiguous.
### Unions
It is possible to create such groups, that if any item in the hierarchy is modified, all other items are updated too. This can be done by putting the items in circular chain of dependencies - that is item1 is attached to item2, item2 to item3 ... itemN to item1. If any of these items is modified, the change will propagate through the chain until it reaches its originator.
### Attaching Items to a Group
Links cannot be attached to groups but can be master items of groups. If a group's master item is a link, nodes can be attached to the control points or segments of the link. See the (Markdown/T_MindFusion_Diagramming_Avalonia_Group.md#attachtolinkpoint) and (Markdown/T_MindFusion_Diagramming_Avalonia_Group.md#attachtolinksegment) methods for details. If the master item is a node, other nodes can be attached to any of its corners, or to an area specified as percent of master-node's bounding rectangle. Check (Markdown/T_MindFusion_Diagramming_Avalonia_Group.md#attachtocorner) and (Markdown/T_MindFusion_Diagramming_Avalonia_Group.md#attachproportional) for details. A shortcut to creating (Markdown/T_MindFusion_Diagramming_Avalonia_Group.md) instance and calling the appropriate (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#attachto)* methods is provided by the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#attachto) method of the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md) class.
### Accessing Group Items
Group members can be accessed using the (Markdown/T_MindFusion_Diagramming_Avalonia_Group.md#mainitem) property and the (Markdown/T_MindFusion_Diagramming_Avalonia_Group.md#attachednodes) collection. To get the groups in which an item participates, use its (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#mastergroup) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#subordinategroup) properties.
### Destroying Groups
If a user deletes the master item of a group, the group is destroyed automatically and the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#groupdestroyed) event is raised. If (Markdown/T_MindFusion_Diagramming_Avalonia_Group.md#autodeleteitems) is enabled, subordinated items in the group are deleted too. If (Markdown/T_MindFusion_Diagramming_Avalonia_Group.md#autodeleteitems) is disabled, subordinated items are just detached from their master and remain intact. Groups can be destroyed programmatically by removing them from the diagram's (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#groups) collection.
## Layers
### Layers
Items can be assigned to layers, and layers can be hidden, locked or moved up/down in the Z order as a group. (Markdown/T_MindFusion_Diagramming_Avalonia_Layer.md) objects provide (Markdown/T_MindFusion_Diagramming_Avalonia_Layer.md#visible), (Markdown/T_MindFusion_Diagramming_Avalonia_Layer.md#locked) and (Markdown/T_MindFusion_Diagramming_Avalonia_Layer.md#zindex) properties, which will affect all items in the respective layer. Layers also expose a (Markdown/T_MindFusion_Diagramming_Avalonia_Layer.md#title) property shown in the (Markdown/T_MindFusion_Diagramming_Avalonia_LayerListView.md) control. Newly drawn items are added to the layer specified via (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#activelayer).
Set the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#layerindex) property of items to associate them with layers in the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#layers) collection. If (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#layerindex) has the default value of -1, the item is not associated with any layer and its visibility depends only on the item's own (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#visible) property.
### Layer list control
The (Markdown/T_MindFusion_Diagramming_Avalonia_LayerListView.md) control provides user interface for working with (Markdown/T_MindFusion_Diagramming_Avalonia_Layer.md) objects. The control presents a list of the specified (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md)'s layers, showing their title and an overview image of the objects in each layer, and also allows editing of layer's (Markdown/T_MindFusion_Diagramming_Avalonia_Layer.md#visible) and (Markdown/T_MindFusion_Diagramming_Avalonia_Layer.md#locked) properties and choosing the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md)'s currently active layer. New layers can be added to the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) by clicking the + button and removed by clicking the - button.
## Collapsing and Expanding Tree Branches
If a diagram represents a tree structure, the tree branch starting from a node can be collapsed or expanded again in order to hide or display hierarchy details. Use the nodes' (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#collapse) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#expand) methods to do this programmatically. To determine whether a subtree is expanded or collapsed, check its root's (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#expanded) property.
### Displaying Expand/Collapse Button
If the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#expandable) property of a node is set to true, there is a [±] button displayed beside the node to allow users to collapse or expand the tree branch starting there. The button location can be customized by the diagram's (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#expandbuttonposition) property. By default, pressing that button calls automatically the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#collapse) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#expand) methods and raises the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#treeexpanded) or (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#treecollapsed) events.
### Defining Tree Direction
A node can be connected to other nodes through outgoing and incoming links. Setting the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#expandonincoming) property specifies which items connected to a node will be regarded as its descendants. If (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#expandonincoming) is false (default value) then each node will be regarded as a parent of its outgoing links and the items attached to them. If (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#expandonincoming) is set to true, the node's incoming links define its children. So that property specifies the direction of parent-children relationship between diagram items and respectively the overall direction in which collapsing / expanding is done.
### Expanding a Branch Recursively
Use the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#recursiveexpand) property to specify whether the whole tree branch starting from a node will be shown when expanding, or only the first level of descendants. A related property is the (Markdown/T_MindFusion_Diagramming_Avalonia_Group.md#expandable) property of the (Markdown/T_MindFusion_Diagramming_Avalonia_Group.md) class, which specifies whether expanding and collapsing propagate through group members.
### HtmlBuilder Support
The (Markdown/T_MindFusion_Diagramming_Avalonia_HtmlBuilder.md) class can generate map areas for the [±] buttons displayed beside (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#expandable) nodes. To enable that, assign an URL to the (Markdown/T_MindFusion_Diagramming_Avalonia_HtmlBuilder.md#expandbtnhyperlink) property. That URL can contain some format specifiers, which are automatically replaced with the values of nodes' Tag or (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#zindex) properties. On the server side, you can identify the node whose [±] button is clicked.
### Custom Expand/Collapse Functionality
By using the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#expandbuttonaction) property, you can override the standard functionality of the [±] button. Set this property to (Markdown/T_MindFusion_Diagramming_Avalonia_ExpandButtonAction.md) and handle the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#expandbuttonclicked) event if you need to implement your own expand/collapse logic.
## Multiple Diagram Pages
The (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramDocument.md) class represents a collection of diagram pages or sheets, represented by (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramPage.md) objects. New pages can be added to the document and existing pages can be removed and reordered via the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramDocument.md#pages) collection. The (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramDocument.md#savetoxml) methods of (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramDocument.md) save all pages in a single file, and respectively the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramDocument.md#loadfromxml) methods load all pages from the file. (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramDocument.md) can also load files created by the serialization methods of (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md), and will show them in a single page. Note that the opposite is not true: (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) cannot load directly a (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramDocument.md) file.
(Markdown/T_MindFusion_Diagramming_Avalonia_DiagramPage.md) is derived from (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) and only adds a (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramPage.md#title) property, so any code that processes (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) objects will work with (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramPage.md) objects too. A diagram document forwards each event raised by its pages, giving you a chance to use the same handler for events raised by different pages. If a page should implement distinct user interaction or validation logic, it is also possible to attach handlers to the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) events inherited by (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramPage.md).
A (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramDocument.md) can be exported to PDF and Visio, and imported from Visio using the new overloads available in the PdfExporter, VisioExporter and VisioImporter classes respectively. Other export classes do not support multi-page export at this time, but still can be used to export individual pages via their Export(Diagram) method.
A single (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramPage.md) could be assigned to the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#diagram) property of (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md), and that lets you create your own user interface for presenting a list of pages to the user and selecting a current page. The package also includes a (Markdown/T_MindFusion_Diagramming_Avalonia_TabbedDiagramView.md) that presents all pages of a document in a tabbed user interface where each tab corresponds to a page. The page displayed in the active tab is exposed by the (Markdown/T_MindFusion_Diagramming_Avalonia_TabbedDiagramView.md#currentpage) property of (Markdown/T_MindFusion_Diagramming_Avalonia_TabbedDiagramView.md). The active page can be changed interactively by activating its associated tab. New pages can be added and removed to/from the document through buttons in the tab tray and the pages can be rearranged by dragging their associated tabs with the mouse.
## User Interaction
The following topics are contained within this topic:
(#controlling-user-interaction)
Information on how to control user interactions with the control through diagram behavior, node constraints and event handling.
(#handling-events)
Information about some more notable events in AvaloniaDiagram.
(#single-and-multiple-selection)
Provides information on how to select items, how to modify the selection appearance and behavior and how to access the items that are already selected.
(#automatic-alignment)
Information about the built-in tools for automatic item alignment during interactions.
(#clipboard-operations)
Information on how to use the Windows clipboard with AvaloniaDiagram.
(#scrolling-and-zooming)
Controlling scrolling and zooming in diagram views.
(#tool-tips)
Information on how to enable tooltips for individual items and for the entire diagram.
(#in-place-editing-the-contents-of-items)
Information about the standard in-place item editing and how it can be extended.
## Controlling User Interaction
There are several ways to control user actions on the diagram as a whole, or on individual items in the diagram.
### Disabling Interaction
By setting the Enabled property of (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) to false, you can make the diagram contents non-modifiable at all. Thus it will function as nothing more than a static image you can use to present some data to the user. The diagram can still be modified programmatically though.
### Specify How User Actions are Interpreted
The (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#behavior) property provides several predefined sets of rules specifying how user input with the mouse/keyboard is interpreted. If (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#behavior) is set to (Markdown/T_MindFusion_Diagramming_Avalonia_Behavior.md), mouse dragging started from an unoccupied point of the document is processed as a (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md) creation request and dragging over a node creates a link. Note that such behavior leads to some extra work when creating overlaying nodes - users need to draw the second node on an empty area and move it over the first one afterwards. If you want to avoid that, use the (Markdown/T_MindFusion_Diagramming_Avalonia_Behavior.md) behavior. If (Markdown/T_MindFusion_Diagramming_Avalonia_Behavior.md) is set, dragging the mouse over an empty area creates a table and dragging over a table creates a link. Behavior options also include (Markdown/T_MindFusion_Diagramming_Avalonia_Behavior.md), (Markdown/T_MindFusion_Diagramming_Avalonia_Behavior.md) and (Markdown/T_MindFusion_Diagramming_Avalonia_Behavior.md).
### Setting Diagram Bounds
Document size can be get or set with the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#bounds) property. By default, users are able to move items outside the diagram bounds. To prevent this, enable the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#restrictitemstobounds) property. It provides three options to restrict item positions. They might not be restricted at all. The most restrictive option is to keep items entirely inside the document area. Another option allows items to be partially outside the document area but having at least a small visible part inside.
### Item Constraints
Constraints upon how users are allowed to modify a node are set through the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#constraints) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#enabledhandles) properties. The former can be used to constrain the move direction, node size and aspect ratio. The latter enables or disables specific manipulation handles of a node. That allows making the node non-moveable, non-resizable, or resizable only horizontally/vertically.
Items can be locked by the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#locked) properties. Locked items are excluded from selection and users cannot select, move or modify them.
### Control How Links Connect to Nodes
The (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#allowincominglinks) property of the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md) class specifies whether incoming links can be drawn to a node. The (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#allowoutgoinglinks) property enables drawing of outgoing links to a node.
Anchor points define where link's ends are placed when a user attaches a link to a node. A pattern of anchor points can be assigned to a node by setting the node's (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#anchorpattern). The (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#snaptoanchor) property specifies whether link ends are aligned to anchor points when creating or modifying links.
Once a link is created, a user can still move its end points to different positions, unless (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#linkendsmovable) is set to false. This can also be controlled on a per-link basis by the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#allowmoveend) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#allowmovestart) properties. You can dynamically validate moving of links' end points using the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#linkmodifying) event.
The (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#allowselfloops) property enables or disables drawing of reflexive links. They are allowed by default, but can be disabled if you consider them meaningless for the application. (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#allowlinksrepeat) controls if two nodes can be connected more than once in the same direction.
### In-place Text Editing
The text of nodes and tables can be edited in-place by double-clicking the respective items. To enable the feature set the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#allowinplaceedit) property to true. For tables, both captions and cells can be edited in this way. Handle the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#celltextediting) event to enable/disable in-place editing per cell. Depending on the type of item being edited, one of these events can be fired when editing completes: (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#nodetextedited), (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#celltextedited). In-place editing mode is exited when users click outside the text entry control. Pressing ENTER or ESC exits in-place editing mode if respectively (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#inplaceeditacceptonenter) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#inplaceeditcancelonesc) are enabled.
### Validation Events
When users try to create, delete or select an item, one of the following events is raised. To ban the action, set corresponding event bool argument to false:
| **Event
** | **Description
**
| (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#nodecreating)
| Raised while a user draws a new node.
| (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#linkcreating)
| Raised while a user draws a new link.
| (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#nodeselecting)
| Raised when the user is trying to select a node.
| (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#linkselecting)
| Raised when the user is trying to select a link.
| (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#nodedeleting)
| Raised when the user is trying to delete a node.
| (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#linkdeleting)
| Raised when the user is trying to delete a link.
| (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#nodemodifying)
| Raised while a user modifies an existing node.
| (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#linkmodifying)
| Raised while a user modifies an existing link.
For more events that can be fired by user actions, please, consult the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#diagrambase-events) section of the documentation.
### Interaction Properties
- Setting the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#selectaftercreate) property to true automatically selects each newly created item, so users can immediately modify it.
- (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#allowselfloops) property of (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) specifies whether users can draw reflexive / self-loop links.
- (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#allowunconnectedlinks) property specifies whether users can create links without connecting them to nodes (e.g. for simple line or curve graphics in a drawing).
- (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#allowlinksrepeat) specifies whether user can draw a second link between same pair of nodes.
- (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#delkeyaction) specifies how the control handles the Delete key.
- The (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#modifierkeyactions) property allows assigning different functions to the CTRL, ALT and SHIFT keys.
- (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#middlebuttonactions) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#rightbuttonactions) allow mapping interaction types to mouse buttons.
- (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#allowincominglinks) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#allowoutgoinglinks) properties of (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md) specify if a node accepts respective types of links.
- Setting the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#locked) property of a (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#diagramitem-properties) prevents users from interacting with it altogether.
### Multi-touch Support
The control handles touch events to implement multi-touch interactions, such as zooming, node rotation or simultaneous drawing of multiple diagram items:
- If (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#multitouchzoom) property is enabled (default), the view can be zoomed or panned using two-touch pinch / flick gestures.
- If (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#multitouchmodify) property is enabled (default), diagram nodes can be moved, scaled and rotated using two-touch pinch / flick gestures.
- If (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#multitouchzoom) property is disabled, each touch draws diagram items corresponding to current (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#behavior).
- If (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#multitouchmodify) property is disabled, each touch started from a node draws a diagram link.
- Latter modes can be used for collaborative whiteboarding / classroom scenarios.
Built-in multi-touch can be disabled altogether by setting (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#enablemultitouch) to false, e.g. if you need to handle touch events yourself or through a third-party gesture library.
## Handling Events
Most events are raised only in response to users actions. If you need to execute the same code after user actions and API calls, move the common code to a method and invoke the method both in the respective event handler and after the API method or property setter call. A notable exception is the *Deleted set of events, which are also raised when items are deleted programmatically, because in some circumstances deleting an item could delete other items related to it.
When a user starts drawing a new item with the mouse, the control raises an initialization event to let you set the appearance properties of the item. That is, for a node, the control raises (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#initializenode).
While the user is holding down the mouse button and drawing, a validation event is raised to let you cancel the item creation (for example, (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#nodecreating)). If the action is not cancelled, a creation event is raised to let your application know about the new item (for example, (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#nodecreated)). There are events raised when users modify items, for example, (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#nodemodifying) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#nodemodified). Call the CancelDrag method to cancel the item modification or creation from the *Modifying or *Creating events raised for nodes or links.
When a user presses the DEL key, there is a validation event raised to let you confirm deleting an item (for example, (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#nodedeleting)), and if not cancelled, there is an item-deleted event raised (for example, (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#nodedeleted)).
There are many other events related to various activities a user could carry out on the diagram. The full set of events can be found here:
(Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#diagrambase-events)
## Single and Multiple Selection
### Selecting and Modifying Items
In order to move or modify a diagram element, users drag its adjustment handles. Adjustment handles appear around an item when it is selected. Each handle can be dragged to perform specific transformation on the item. The appearance and behavior of modification handles can be altered by the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#handlesstyle) property. Depending on the value assigned to (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#modificationstart), those handles can also appear automatically when the mouse pointer hovers over an item.
### Active Item
If only one diagram item is selected, it is considered the 'active' item. One of the items in a multiple-selection is also regarded as active; it is usually the one selected last. The active item has white modification handles drawn around it, while other items in multiple-selection have gray handles. The active item is probably the one users are most interested in while editing a diagram, and your program can update its state and user-interface according to that. Access to the active item is provided by the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#activeitem) property of the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) class.
### Multiple-Selection
Selection of diagram items in AvaloniaDiagram is represented by an instance of the (Markdown/T_MindFusion_Diagramming_Avalonia_Selection.md) class. This class provides methods to programmatically select or deselect items and properties that specify how the selection looks and behaves. A property of the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) class, also called (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#selection), exposes the items selected within the current document. Multiple items can be selected, thus moved at the same time. To programmatically add items to or remove them from the multiple-selection invoke one of the (Markdown/T_MindFusion_Diagramming_Avalonia_Selection.md#additem), (Markdown/T_MindFusion_Diagramming_Avalonia_Selection.md#toggle) and (Markdown/T_MindFusion_Diagramming_Avalonia_Selection.md#removeitem) methods. The (Markdown/T_MindFusion_Diagramming_Avalonia_Selection.md#clear) method deselected all items and the (Markdown/T_MindFusion_Diagramming_Avalonia_Selection.md#change) method selects a single item, deselecting all others. Setting (Markdown/T_MindFusion_Diagramming_Avalonia_Selection.md#allowmultipleselection) to false disables multiple-selection.
### Drawing a Selection Lasso
To select multiple items, users must draw a selection lasso or rectangle with the left mouse button while holding down the CTRL key. In order to enable free-form lasso mode, set (Markdown/T_MindFusion_Diagramming_Avalonia_Selection.md#freeformmode) to true. The (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#middlebuttonactions) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#rightbuttonactions) properties let you enable drawing the selection lasso using the middle or right mouse button.
### Custom Lasso Tools
If you set the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#behavior) property of (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md) to (Markdown/T_MindFusion_Diagramming_Avalonia_Behavior.md), the control lets users draw selection lasso without changing actual (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#selection). You could use that in conjunction with (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#initializelasso) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#lassodrawn) events to implement custom tools or selection logic, such as:
- Opening a custom context menu or UI panel styled for bulk operations.
- Creating a visual screenshot / export of only the selected region.
- Implementing custom selection logic or filters (e.g. select nodes of a specific type, or select only links).
- Bookmarking the selected area (adding it to (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#bookmarks)).
### Appearance
The visual style of multiple-selection is defined by the (Markdown/T_MindFusion_Diagramming_Avalonia_Selection.md#style) property of the (Markdown/T_MindFusion_Diagramming_Avalonia_Selection.md) class. For example, selection might be painted as a dashed rectangle or a semi-transparent filled rectangle. Colors of the selection rectangle can be changed by setting the selection's Pen and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#brush) properties. Another property related to selection visualization is the diagram's (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#selectionontop), which specifies whether selected items must be painted according to their z-order position or on top of the non-selected items.
### Enumerating Items
The (Markdown/T_MindFusion_Diagramming_Avalonia_Selection.md) class exposes the selected items as .NET collections. The (Markdown/T_MindFusion_Diagramming_Avalonia_Selection.md#items) collection references all selected items, getting them as (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md) instances. The (Markdown/T_MindFusion_Diagramming_Avalonia_Selection.md#nodes) and (Markdown/T_MindFusion_Diagramming_Avalonia_Selection.md#links) collections keep references to the selected items of specific classes. Alternatively you might enumerate all items in the diagram and check their (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#selected) property.
### Automatic Selection
Setting the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#selectaftercreate) property to true automatically selects each newly created item, so users can modify it immediately.
## Automatic Alignment
The following features help the user align items interactively.
### Alignment Grid
Items are aligned to a grid when (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#aligntogrid) is enabled. More information is available in the (#alignment-grid) topic.
### Align nodes to nodes
If (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#autoalignnodes) is enabled, the node currently being drawn or resized is aligned to another node so that a pair of their vertical or horizontal sides become collinear. To specify the maximal distance at which nodes are aligned, set the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#autoaligndistance) property. The pair of aligned nodes is indicated visually by drawing an alignment guide using the pen assigned to (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#alignmentguidepen).
### Snap links to nearby nodes
The currently drawn or modified link can automatically snap to the nearest border point of the nearest node when (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#autosnaplinks) is set. The maximal distance at which links will connect to a nearby node is set via (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#autosnapdistance).
## Clipboard Operations
A single diagram item or a selection of items can be copied or cut to the system clipboard. This is done programmatically using the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#copytoclipboard) and (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#cuttoclipboard) methods. To paste the clipboard contents into the current diagram call (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#pastefromclipboard).
AvaloniaDiagram does not provide keyboard interface to clipboard operations. You might assign the standard CTRL+C, CTRL+X and CTRL+V shortcuts to menu items and handle them by calling the respective methods.
## Scrolling and Zooming
In order to enable scrolling, you must place the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) control inside a ScrollViewer, (Markdown/T_MindFusion_Diagramming_Avalonia_Ruler.md) or a (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md).
### Automatic Scrolling
The (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#autoscroll) property controls automatic scrolling. If it is enabled and the user drags an adjustment handle near the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md) edges while manipulating an item, the control will scroll the viewport towards the mouse position. The (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#scrollzonesize) property defines the size of the area near the view borders that triggers automatic scrolling.
### Diagram Size
The diagram size is set through the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#bounds) property. Its value is a Rect instance that specifies the origin of the diagram coordinate system and the diagram size.
### Programmatic Scrolling
In order to scroll a (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md) programmatically, you can call its (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#scrollto) method or set (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#scrollx) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#scrolly) properties. The latter can also be used to access the current scroll position in case you need it. The (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#bringintoview) method scrolls the viewport to ensure that a specific diagram item can be seen in the view.
### Scrolling Nodes
The contents of nodes such as (Markdown/T_MindFusion_Diagramming_Avalonia_ContainerNode.md), (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md) and (Markdown/T_MindFusion_Diagramming_Avalonia_TreeViewNode.md) can be scrolled too. Set a container's (Markdown/T_MindFusion_Diagramming_Avalonia_ContainerNode.md#scrollable) property to allow scrolling, with (Markdown/T_MindFusion_Diagramming_Avalonia_ContainerNode.md#autogrow) disabled to let the container's contents overflow. If a table's (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md#scrollable) property is set to true, there are up/down scroll buttons displayed in the table's caption area. By clicking these buttons users can scroll the rows of the table. Scrolling can also be done programmatically using the (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md#currentscrollrow) property.
### Zooming
Zooming is controlled by the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#zoomfactor) property, (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#zoomin) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#zoomout) methods. The zoom factor is expressed as a percentage, 100% meaning no zoom. Higher than 100% makes the diagram items look closer / bigger on the screen (zooming in). Less than 100% makes items look further / smaller on screen (zooming out). The (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#zoomin) method increases zoom factor by 10%. Respectively the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#zoomout) method decreases zoom factor again by 10%. To zoom and scroll the view to fit the diagram contents to the control's client area, call (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#zoomtofit). To zoom and scroll the view so it fits a specified rectangular document area to the control's client area, call (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#zoomtorect).
### Lasso zoom tool
The control supports several ways to zoom using lasso tool:
- Set the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#behavior) property to (Markdown/T_MindFusion_Diagramming_Avalonia_Behavior.md) to always draw zoom lasso.
- Set the (Markdown/T_MindFusion_Diagramming_Avalonia_ModifierKeyAction.md) flag for one of the keys in (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#modifierkeyactions) to let users draw zoom-lasso with respective modifier key pressed and the left mouse button.
- Assign (Markdown/T_MindFusion_Diagramming_Avalonia_MouseButtonActions.md) value to (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#rightbuttonactions) or (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#middlebuttonactions) property to zoom using respective mouse button.
### Zoom control
The ZoomControl class lets user change interactively the current zoom level and scroll position of a (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md). To set it up, add a element to the Xaml file (possibly placing it on top of the diagram using e.g. grid layout), and set the control's Target property to that diagram. Set the ZoomStep and ScrollStep properties to specify the amount added to diagram's zoom level or scroll position by ZoomControl's buttons. You can customize the control's appearance by setting properties such as Fill, Stroke, CornerRadius and TickPosition. For an example, see the Samples\C#\Controls sample project from distribution.### Magnifying
The (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) provides an option for zooming in (or out) portions of the diagram through the Magnifier tool. The magnifier tool can be permanently activated by setting (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#magnifierenabled) to true. Alternatively, on-demand magnification through the right mouse button or by pressing a modifier key can be enabled be setting the appropriate value to the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#rightbuttonactions) or (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#modifierkeyactions) properties respectively.
The magnification factor can be specified through the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#magnifierfactor) property. The size of the tool can be set through the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#magnifierwidth) and (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#magnifierheight) properties.
### Panning
The diagram view can be panned by holding ALT while dragging the mouse with the left button down. Another modifier key can be used for panning by setting (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#modifierkeyactions). The (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#middlebuttonactions) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#rightbuttonactions) properties let you use the middle or right mouse button to start panning. AvaloniaDiagram displays the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#pancursor) while panning.
## Tool-Tips
Tool-tips are short text messages displayed when the mouse pointer hovers over a diagram item for a while. To enable tool-tips, set the ShowToolTips property to true. The delay before a tool-tip appears is set by the ToolTipDelay property.
Tool-tips can be defined for each diagram element and for the whole document. If the mouse pointer stands still and it points to an item, then the ToolTip of the item is displayed. The ToolTip of the diagram appears if there is no item under the cursor or if there is an item but there isn't any tool-tip text defined for it. The anchor points assigned to nodes also provide a (Markdown/T_MindFusion_Diagramming_Avalonia_AnchorPoint.md#tooltip) property.
Tool-tip's text is also used as a value of the ALT attribute of image map areas corresponding to items; see (Markdown/T_MindFusion_Diagramming_Avalonia_HtmlBuilder.md) for more information.
## In-place Editing the Contents of Items
### Standard in-place editing
To enable in-place editing of text of diagram items, set the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#allowinplaceedit) property to true. It lets users edit the text of a diagram element by double-clicking it. In-place editing mode can be accepted and exited by clicking anywhere outside the text-field.
The following properties can be edited in place:
- (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#text), which contains the main text of shapes and links, as well captions of table and container nodes.
- (Markdown/T_MindFusion_Diagramming_Avalonia_TreeViewItem.md#label) and (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode+Cell.md#plaintext).
- The (Markdown/T_MindFusion_Diagramming_Avalonia_TextPresenter.md#text) of supplementary (Markdown/T_MindFusion_Diagramming_Avalonia_LinkLabel.md) and (Markdown/T_MindFusion_Diagramming_Avalonia_NodeLabel.md) objects that can be displayed along with items.
If you want to change the way of accepting / rejecting changes, the following (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) properties allow using the ENTER and ESC keys to perform that: (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#inplaceeditacceptonenter) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#inplaceeditcancelonesc). When (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#inplaceeditacceptonenter) is set to true, pressing the ENTER key causes accepting changes and exiting inplace-edit mode. If (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#inplaceeditacceptonenter) is set to false, pressing ENTER inserts a new line in the text while in inplace-edit mode. If (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#inplaceeditcancelonesc) is set to true, pressing the ESC key performs rejecting changes and exiting inplace-edit mode.
If you want to enable/disable in-place editing of a specific table's cell, handle the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#celltextediting) event. To enable/disable in-place editing of nodes, handle the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#nodetextediting) event. For a (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md) object, the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#linktextediting) event is raised while in-place editing. These validation events let you prevent users from editing the text in the particular object if it is necessary.
When in-place editing of a node is completed, the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#nodetextedited) event is raised. For a table's cell, handle the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#celltextedited) event. (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#linktextedited) event is raised when in-place editing of a (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md) object completes.
By default, AvaloniaDiagram creates a TextBox control to let users edit item's text. The (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#enterinplaceeditmode) event allows customizing the properties of that control, or attaching event handlers to it. (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#inplaceeditfont) specifies the font of the in-place edited text box.
When leaving inplace-edit mode, the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#leaveinplaceeditmode) event is raised. This event is raised in all cases of closing the inplace-edit control, for example, when the user accepts or cancels the changes made to an item's text, or when the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#endedit) method is called.
To enter in-place editing mode programmatically and let users edit an item's text inline, call the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#beginedit) method of (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md). The (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#endedit) method exits inplace edit mode.
### In-place editing of custom items
The (Markdown/T_MindFusion_Diagramming_Avalonia_InplaceEditable.md) interface allows implementing the standard in-place editing for custom defined items. By means of the methods of this interface, you can specify the position of the inplace-edit textbox control and copy the entered text to a property of the edited item. (Markdown/T_MindFusion_Diagramming_Avalonia_InplaceEditable.md#geteditrect) returns the destination rectangle of the in-place edit box. (Markdown/T_MindFusion_Diagramming_Avalonia_InplaceEditable.md#gettexttoedit) represents the initial contents of the in-place edit box. (Markdown/T_MindFusion_Diagramming_Avalonia_InplaceEditable.md#seteditedtext) sets the edited text to the object after completing the in-place editing.
## Drag and Drop
### Built-in Drag and Drop
A (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md) can accept dragged shapes or nodes from ShapeListBox and NodeListView controls. To enable that, set its AllowDrop property to true. The view responds to (Markdown/T_MindFusion_Diagramming_Avalonia_Shape.md) objects dragged from ShapeListBox by creating a (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md) at the drop position and setting its (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md#shape) property. Nodes dragged from NodeListView are cloned and the copies are added to the diagram.
### Custom Drop Handling
(Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md) inherits standard drag-and-drop events from its base Control class. You could handle them to e.g. create nodes from dropped data, or to copy the data to existing node's fields. Note that you must call the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#viewtodiagram) method to convert the mouse position from view's to diagram's coordinate system (in (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#measureunit) and according to view's (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#zoomfactor) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#scrollx) position). The following example demonstrates that:
```csharp
void OnDiagramDragDrop(object sender, DragEventArgs e)
{
var position = e.GetPosition(diagramView);
position = diagramView.ViewToDiagram(position);
var node = diagram.GetNodeAt(position);
if (node == null)
{
node = diagram.Factory.CreateShapeNode(
position.X - nodeSize.Width / 2,
position.Y - nodeSize.Height / 2,
nodeSize.Width, nodeSize.Height);
}
node.Text = (string)e.Data.GetData(typeof(string));
e.Effects = DragDropEffects.Copy;
e.Handled = true;
}
Size nodeSize = new Size(96, 64);
```
### Initiate Drag Operation
You can start a drag-and-drop operation from the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md) by calling WPF's standard DoDragDrop method. Depending on the context from which you start dragging, you might also need to cancel view's internal user interaction handling. The following example demonstrates how to drag node's text when Shift is pressed down.
```csharp
protected override void OnPreviewMouseDown(MouseButtonEventArgs e)
{
if ((Keyboard.Modifiers & ModifierKeys.Shift) != 0)
{
var mousePosition = e.GetPosition(diagramView);
mousePosition = diagramView.ViewToDiagram(mousePosition);
var node = diagram.GetNodeAt(mousePosition);
if (node != null)
{
if (diagramView.Interaction != null)
diagramView.Interaction.CancelNow();
DragDrop.DoDragDrop(this, node.Text, DragDropEffects.Copy);
e.Handled = true;
}
}
}
```
## Placement and Layout
The following topics are contained within this topic:
(#items-placement---position-size-and-z-order)
Information on how to modify the position, size and z-order of diagram items, both interactively and programmatically.
(#alignment-grid)
Information about the alignment grid.
(#lanes-grid)
Introduces the lanes grid - a grid that can be used in Swimlane diagrams or Gantt charts.
(#laying-out-diagrams-automatically)
Provides information about the automatic layouts available in AvaloniaDiagram. Thes include the (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_TreeLayout.md), (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_SpringLayout.md) and (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_GridLayout.md).
(#link-routing)Information about the automatic link routing.
(#anchor-points-and-patterns)
Information on how to use anchor patterns and how to create custom anchor patterns.
## Items Placement - Position, Size and Z-order
### Measure Unit
The (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#measureunit) property specifies the unit of measure for all location and size-related values assigned to AvaloniaDiagram properties or passed as arguments to its methods.
### Location and Size of Nodes
Use the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#bounds) property to get or change the location and size of a node. To move a node without changing its size, call the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#move) method. To change only the size of a node, invoke the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#resize) method. (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md#resizetofitimage) and (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md#resizetofitimage) methods set nodes' sizes to fit that of their pictures.
### Links Control Points
Links have two or more control points, depending on their (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#shape) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#segmentcount). You can get access to the control points by the link's (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#controlpoints) collection. You must call (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#updatefrompoints) after moving control points of a link; that's needed in order to repaint the link and update its internal state variables. The (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#bounds) property is read-only. It returns the smallest rectangle that bounds all link points.
### Link Dynamics
The (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#dynamic) property of a link can be enabled to make the link automatically recalculate its end point positions if the nodes connected to the link are moved or resized; the end points are moved in such a way that the link points to the centers of the connected nodes. A related property is (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#autosnaptonode), which can be enabled to make the link end points align to the border of their origin or destination nodes while a user move the link ends.
(Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#retainform) is useful for links that have more than two control points. If the nodes that a link connects are moved around, usually only the segments at the ends of that link are updated, so that they stay connected to their respective nodes. In that case all intermediate control points stay where they are. However, if (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#retainform) is enabled, all control points will move simultaneously in a way they preserve their relative position to each other, and thus preserving the overall form of the link.
Links have an (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#autoroute) property that enables or disables automatic routing of a link. Routed links avoid nodes by finding the shortest path between their origin and destination that does not cross any other nodes. The link routing algorithm can be tuned by using the properties exposed by (Markdown/T_MindFusion_Diagramming_Avalonia_RoutingOptions.md).
### Interactive Moving or Resizing
End-users of your application can move or resize the diagram elements. They do this by selecting an item and dragging any of its adjustment handles, a point inside its interior, any of its sides or a selection frame. The (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#handlesstyle) property of nodes controls how interaction can be performed. Additionally it defines the representation of selected items on screen. (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#enabledhandles) lets you disable specific manipulations users are allowed to perform on a node, for example resizing the item horizontally or moving it. If an item is modified interactively, the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#nodemodified) or (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#linkmodified) event is raised, depending on the item's type.
### Controlling the Z-order
The Z-order defines how items are ordered on the Z-axis - so that one looks above or below another. Members of the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md) class give you full control over the Z-order. To move an item one level up or down, invoke the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#zlevelup) or (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#zleveldown) methods. To move an item to the bottom of the Z-order call its (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#zbottom) method. To move the item in front of all others, call its (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#ztop) method. You can use the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#zindex) property to get or set the index of an item within the Z-order array.
## Alignment Grid
AvaloniaDiagram provides an alignment grid to help users place the diagram items more precisely. To activate the grid, set the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#aligntogrid) property to true. If the grid is active while an item is being created or modified, the item's control-points are aligned to the nearest grid points. The distance between adjacent grid points is set by the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#gridsizex) and (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#gridsizey) properties. The (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#gridoffsetx) and (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#gridoffsety) properties allow specifying the horizontal and vertical offset of the first point in the alignment grid.
Items created or modified by a user are automatically aligned to the grid. However, if items are placed in the diagram programmatically, their coordinates are set to the specified positions without aligning. In such cases use (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#alignpointtogrid) if items must be placed exactly at grid points.
The grid can be either visible or invisible, depending on whether the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#showgrid) value is true or false. If visible, the grid is painted as a matrix of points or as series of crossing lines, as specified by the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#gridstyle) property. (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#gridpen) defines the pen with which the alignment points or lines are drawn.
## Lanes Grid
The classes from the (#mindfusiondiagrammingavalonialanes) namespace let you develop process maps and lane diagrams, useful in business process planning and reporting. Processes consist of consecutive operations accomplished by people involved, technical installations, means of contact, and flow of information. The AvaloniaDiagram lane grid features allow indicating and arranging related diagram items in complicated processes and systems, that is, Swim lane diagrams (known as Rummler-Brache diagram), Gantt Charts (planning and scheduling of projects). A lane in the grid can visually contain nodes, links, shapes or images, that represent tasks fulfilled in specified periods of time by people, companies or departments.
The (#mindfusiondiagrammingavalonialanes) namespace provides the (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Grid.md), (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Header.md), (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_HeaderCollection.md) and (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Style.md) classes, the (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_ICell.md) interface and the (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_ResizeType.md) enumeration. These types expose additional properties and methods that let you define your own grids as required by your application logic. Grids can include varying number of lanes, divided into child rows and columns whose intersections form cells. The cells color and style can be customized too.
Use the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#enablelanes) property of the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) class to display lanes in your application. The (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#lanegrid) lets you setup the rows and columns in the grid by defining horizontal and vertical lanes, where each lane can be titled by its own header and/or subheadings. The grid can be resized by setting the (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Grid.md#columncount) and (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Grid.md#rowcount) properties or by adding headers to the (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Grid.md#columnheaders) and (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Grid.md#rowheaders) collections. A column or row can be divided into child elements by adding to the (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Header.md#subheaders) collection of a (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Header.md), which lets you form a complex hierarchy of unlimited depth. The intersection of rows and columns can be either a simple cell for bottommost elements in the hierarchy, or a group of cells for parent rows and columns. Cells or cell groups can be accessed via the grid class (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Grid.md#item) property, that lets you index cells either by their integer positions, or by their (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Header.md) objects.
If the (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Grid.md#allowresizeheaders) property of the (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Grid.md) class is enabled, users can resize the grid columns and rows as desired. The (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Grid.md#cellboundschanged) event is raised when a cell is resized. An application can handle this event in order to rearrange or resize nodes so that they stay within a specific column or row of the grid.
The position of the grid and grid headers within the diagram is defined via (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Grid.md#topmargin) and (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Grid.md#leftmargin), which specify the grid offset relative to (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#bounds). (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Grid.md#hookheaders) enables lane headers to be anchored to the left or right side of the control's visible area. The sizes of headers at different levels in the lane hierarchy can be set in a single operation via the (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Grid.md#rowheaderswidths) and (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Grid.md#columnheadersheights) proeprties.
The appearance of the lanes grid can be customized further via the (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Grid.md#aligncells) property, which specifies whether cells are aligned to each other, the (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Grid.md#headersontop) poperty, which specifies whether headers should appear on top of the Z-order, and the (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Grid.md#topleftareastyle) specifying the appearance of the grid's top-left corner.
The (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Grid.md) class provides many miscalleaneous methods that can be used to find grid elements, for determining their bounds and for hit-testing: (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Grid.md#findcolumn), (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Grid.md#findrow), (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Grid.md#getcellbounds), (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Grid.md#getcellcolumn), (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Grid.md#getcellfrompoint), (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Grid.md#getcellrow), (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Grid.md#getcolumn), (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Grid.md#getrow), (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Grid.md#getrowindex), (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Grid.md#getcolumnheaderbounds), (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Grid.md#getcolumnindex), (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Grid.md#getheaderbounds), (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Grid.md#getrowheaderbounds), (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Grid.md#getheaderfrompoint).
The headers in the lanes grid can be customized by using the following properties of the (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Header.md) class:
| **Property Name
** | **Description
**
| (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Header.md#height)
| Gets or sets the height of the header and the related row in the grid.
| (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Header.md#resizetype)
| Gets or sets the resize type of the header.
| (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Header.md#rotatetitle)
| Gets or sets a value indicating whether rotating of the header caption at 90 degree is enabled.
| (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Header.md#style)
| Gets or sets the style of the header.
| (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Header.md#subheaders)
| Gets a collection with the subheaders of the header.
| (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Header.md#title)
| Gets or sets the header caption.
| (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Header.md#titlecolor)
| Gets or sets the color of the header caption.
| (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Header.md#titlefont)
| Gets or sets the font of the header caption.
| (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Header.md#titleformat)
| Gets or sets the alignment format of the header.
| (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Header.md#width)
| Gets or sets the width of the header and the related column in the grid.
## Laying Out Diagrams Automatically
Applications that process hierarchical or more complex entity-relationship data might need to present that data to end-users in an aesthetical and visually appealing manner. Such applications would store their data as graph of connected nodes possibly having additional information attached to them. However, position and size coordinates of nodes might be unnecessary and/or unavailable. AvaloniaDiagram provides a way to automatically arrange the nodes of a diagram, applying attractive layouts on the overall structure of the diagram. To utilize that functionality, an application can create a diagram by assigning generic coordinates to its nodes, instantiating a layout object and invoking the layout's (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_Layout.md#arrange) method. Non-blocking (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_Layout.md#arrangeasync) method is available in the .NET 4.5 build of diagramming.dll assembly. The Arrange methods can be prevented from changing positions of individual items by setting the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#ignorelayout) property of those items to true.
The classes that implement automatic layout algorithms are located in the (#mindfusiondiagrammingavalonialayout) namespace. The following sections list the available algorithms categorized by their general implementation strategy: (#force-directed-layout-algorithms), (#topology-based-layout-algorithms) and (#semantics-based-layout-algorithms).
## Force-directed layout algorithms
Force-directed algorithms simulate forces acting between objects in the graph and iteratively run a physical simulation that pulls the objects closer or pushes them apart. At each iteration the energy associated with the simulated system decreases, and the node positions calculated by this process usually lead to evenly distributed nodes and uniform link lengths.
### Spring-Embedder Graph Layout
Spring-Embedder is force-directed layout algorithm. It simulates a physical system in which nodes repulse each other, and the links between them act as confining springs. Graphs processed by Spring-Embedder have their nodes distributed uniformly across the diagram area. The algorithm can be applied on a graph by creating a (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_SpringLayout.md) object and calling its (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_Layout.md#arrange) method. Members of (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_SpringLayout.md) allow you to set the desired distance between graph nodes and the number of iteration steps to use while calculating node positions. You can also specify that AvaloniaDiagram tries to minimize link crossings. If you select that option, the algorithm would produce better result with more iteration steps. However, it needs more time to complete if more steps are specified. In VB.NET and C#, Spring-Embedder layout might be applied like this:
```csharp
using MindFusion.Diagramming.Avalonia;
using MindFusion.Diagramming.Avalonia.Layout;
...
private void button1_Click(object sender, EventArgs e)
{
SpringLayout sl = new SpringLayout();
sl.IterationCount = 500;
sl.NodeDistance = 30;
sl.Arrange(diagram);
}
```
```
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim sl As New SpringLayout()
sl.IterationCount = 500
sl.NodeDistance = 30
sl.Arrange(diagram)
End Sub
```
### Grid Graph Layout
The (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_GridLayout.md) algorithm arranges diagram nodes in a grid, keeping connected nodes close together. The algorithm strives to achieve a small number of link crossings. It is based on an iterative process whose initial steps shuffle the grid nodes randomly. That can lead to very different results each time the algorithm is run.
To apply the layout to a diagram, create a (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_GridLayout.md) instance, set its members and invoke the (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_Layout.md#arrange) method. Grid layout might be applied like this:
```csharp
using MindFusion.Diagramming.Avalonia;
using MindFusion.Diagramming.Avalonia.Layout;
...
private void button1_Click(object sender, EventArgs e)
{
GridLayout gl = new GridLayout();
gl.GridSize = 75;
gl.Arrange(diagram);
}
```
```
Imports MindFusion.Diagramming.Avalonia
Imports MindFusion.Diagramming.Avalonia.Layout
...
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim gl As New GridLayout()
gl.GridSize = 75
gl.Arrange(diagram)
End Sub
```
### Simulated Annealing Graph Layout
The (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_AnnealLayout.md) class implements the Simulated Annealing graph layout algorithm. Simulated Annealing is a general-purpose optimization method used to solve large-scale combinatorial problems by simulating the process of heating and cooling of metal to achieve freedom from defects. Finding a nice arrangement of a graph is a combinatorial problem that can be reduced to assigning costs to graph configurations and finding the minimum cost configuration. (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_AnnealLayout.md) assigns costs to graph configurations by evaluating different aesthetic criteria such as distance between nodes, length of links and the number of link crossings. Thus the best configuration found will have good aesthetic properties.
### Circular Graph Layout
(Markdown/T_MindFusion_Diagramming_Avalonia_Layout_CircularLayout.md) distributes nodes evenly on the circumference of a circle at positions that result in as few link crossing as possible. Set its (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_CircularLayout.md#radius) property to specify the size of the layout circle. Set (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_CircularLayout.md#siftingrounds) to set the number of fine-tuning crossing-reduction iterations.
## Topology based layout algorithms
The following algorithms are based on the topological features of the graph being arranged, such as the size and adjacency of faces (a face is a region bounded by links) and the overall direction of links. The algorithms differ in the shape they apply to graph faces and the manner in which faces are embedded in the plane.
### One-way Graph Layout
The (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_OneWayLayout.md) class ensures that links enter into nodes from the same general direction and exit them from the opposite side. If the graph contains cycles, some links bend around the nodes to keep the enter/exit direction consistent. The algorithm aims to minimize the number of such links.
### Topological Graph Layout
If the underlying graph if acyclic, (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_TopologicalLayout.md) arranges the nodes linearly in such a way that each node comes before all destination nodes of its outgoing links. The links are drawn as curves above the chain of nodes, with their height proportional to the distance between the nodes. If the graph is not acyclic, the layout algorithm finds an ordering with a minimal number of back links, and draws the back links below the chain of nodes.
### Orthogonal Graph Layout
The (Markdown/CC_T_MindFusion_Diagramming_Avalonia_Layout_OrthogonalLayout_0.md) class implements an orthogonal graph layout algorithm. Each link is drawn as a chain of alternating horizontal and vertical segments. Nodes are placed in a way that facilitates few links bends and crossings. This algorithm was designed for planar graphs where the nodes have at most four incident links, and produces best results with such graphs as input. It can arrange any arbitrary graph as well, by adding some dummy nodes and links to planarize the graph and reduce its vertex degree, and removing them after the layout. However this might lead to using larger area than necessary, due to the space occupied by dummy elements.
### Orthogonal Router
(Markdown/T_MindFusion_Diagramming_Avalonia_Layout_OrthogonalRouter.md) is a secondary layout algorithm that can be used to arrange links after an initial node arrangement has already been applied. The orthogonal layout is useful when there are much more links than nodes in a graph. The algorithm strives to achieve the following criteria, while preserving as much of the initial node configuration as possible.
- links must not overlap;
- only vertical and horizontal routing lines are used;
- graph routing is performed with respect to the specified main layout direction;
- links crossings are minimized;
- bends are minimized;
### Cascade Graph Layout
(Markdown/T_MindFusion_Diagramming_Avalonia_Layout_CascadeLayout.md) places nodes on a virtual grid and arranges links orthogonally, such that if the source graph is planar all links are guaranteed to have no more than two bends and will not intersect. By default the layout method arranges nodes in rows and link segments in columns; this can be changed by setting the (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_CascadeLayout.md#orientation) property.### Triangular Graph Layout
(Markdown/T_MindFusion_Diagramming_Avalonia_Layout_TriangularLayout.md) places nodes on a virtual grid, such that if the source graph is planar, all links are guaranteed to have a single segment and not intersect. If the graph is not planar, its intersecting links can be optionally segmented and bended in order to improve readability. The layout method places the nodes from the external face on a triangle and recursively adds the rest of the nodes as vertices of internal triangles. As a result, it is very effective for near maximal-planar (a.k.a. triangular) graphs.
## Semantics based layout algorithms
The following algorithms arrange the diagram in a way that shows the semantics of individual items or the overall graph structure, such as hierarchical relations between objects, loops and decisions in flowcharts, assignments of nodes to layers or swimlanes.
### Tree Layout
If application's data is structured hierarchically, it is appropriate to apply tree layout on it. To do this, create a (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_TreeLayout.md) object and call its (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_Layout.md#arrange) method. Members of (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_TreeLayout.md) control many aspects of the layout process. The type of layout can be directional or radial. You can choose how much space to leave between tree levels and between nodes on the same level. For directional layouts, the style of links in the arranged tree can be set to straight, orthogonal or curved. Global tree direction and alignment can be customized too. In VB.NET and C#, tree layout might be applied like this:
```csharp
using MindFusion.Diagramming.Avalonia;
using MindFusion.Diagramming.Avalonia.Layout;
...
private void button1_Click(object sender, EventArgs e)
{
TreeLayout tl = new TreeLayout();
tl.Type = TreeLayoutType.Cascading;
tl.Direction = TreeLayoutDirection.LeftToRight;
tl.LinkStyle = TreeLayoutLinkType.Cascading2;
tl.LevelDistance = 10;
tl.Arrange(diagram);
}
```
```
Imports MindFusion.Diagramming.Avalonia
Imports MindFusion.Diagramming.Avalonia.Layout
...
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim tl As New TreeLayout()
tl.Type = TreeLayoutType.Cascading
tl.Direction = TreeLayoutDirection.LeftToRight
tl.LinkStyle = TreeLayoutLinkType.Cascading2
tl.LevelDistance = 10
tl.Arrange(diagram)
End Sub
```
### Fractal Tree Layout
(Markdown/T_MindFusion_Diagramming_Avalonia_Layout_FractalLayout.md) is a tree layout algorithm that places child nodes symmetrically around their parent node. Nodes at the lowest level are arranged directly in a circle around their parent. At the upper level, the already arranged nodes form branches that are arranged in a circle around the new parent node. The algorithm is recursively repeated till the highest level is reached. If nodes in the tree have uniform number of children, the end result has fractal-like appearance (subsets of the graph look like scaled-down copies of the whole graph).
You can choose which node should be displayed at the center of the topmost circle by setting the (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_FractalLayout.md#root) property. If it is not specified, the algorithm automatically selects a root that leads to more balanced distribution of nodes.
### Layered Graph Layout
The (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_LayeredLayout.md) algorithm arranges diagram nodes in layers according to several criteria, most important of which are: connected nodes must be placed close together; links must flow in one direction if possible; links must cross as few layers as possible; links must not cross other links. To apply the layout to a diagram, create a (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_LayeredLayout.md) instance, set its members and invoke the (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_Layout.md#arrange) method. In C# and VB.NET, layered layout can be applied like this:
```csharp
using MindFusion.Diagramming.Avalonia;
using MindFusion.Diagramming.Avalonia.Layout;
...
private void btnArrange_Click(object sender, System.EventArgs e)
{
LayeredLayout ll = new LayeredLayout();
ll.Orientation = MindFusion.Diagramming.Layout.Orientation.Horizontal;
ll.SplitLayers = true;
ll.LayerDistance = 35;
ll.Arrange(diagram);
}
```
```
Imports MindFusion.Diagramming.Avalonia
Imports MindFusion.Diagramming.Avalonia.Layout
...
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim ll = New LayeredLayout()
ll.Orientation = MindFusion.Diagramming.Layout.Orientation.Horizontal
ll.SplitLayers = True
ll.LayerDistance = 35
ll.Arrange(Diagram)
End Sub
```
### Tree map layout
Tree maps represent hierarchies by nesting child nodes within their parents, where the areas of leaf nodes are proportional to their (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#weight) values. Unlike other layout algorithms, (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_TreeMapLayout.md) expects hierarchies to be defined via grouping or containment (see (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#attachto) method and (Markdown/T_MindFusion_Diagramming_Avalonia_ContainerNode.md) class), and will ignore any links in the diagram. The diagram area covered by the topmost nodes in a hierarchy is specified via the (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_TreeMapLayout.md#layoutarea) property. By default, the layout tries to keep the ratio of node sides as close as possible to one. However this could make it hard to distinguish separate levels of the hierarchy. To alleviate that, set (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_TreeMapLayout.md#squarify) to false, and child nodes will be arranged either as a row or a column inside their parent node, alternating directions for each level. The drawback is that when (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#weight) ratios differ greatly or nodes contain many children, some nodes could end up with very narrow rectangles.### Decision flowchart layout
(Markdown/T_MindFusion_Diagramming_Avalonia_Layout_DecisionLayout.md) arranges simple flowcharts consisting of decision boxes with up to three outgoing links per node and activity boxes with a single outgoing link per node. The nodes are arranged in columns and rows, whose distance depends on the (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_DecisionLayout.md#horizontalpadding) and (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_DecisionLayout.md#verticalpadding) property values. When links share the same row or column, they are placed at a distance specified via (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_DecisionLayout.md#linkpadding). The layout arranges nodes recursively starting from (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_DecisionLayout.md#startnode). If (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_DecisionLayout.md#startnode) is not specified, the algorithm selects the root of the deepest branch of the graph's spanning tree as start node.### Flowchart Graph Layout
(Markdown/T_MindFusion_Diagramming_Avalonia_Layout_FlowchartLayout.md) recognizes program code -like patterns in the graph, such as loops, sequences and if/switch branchings, and arranges them recursively. (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_FlowchartLayout.md) could be used to arrange other types of graphs as well, though with some restrictions. For example it treats all back links as loops in the code, and expects that they are nested - loop links starting closer to the stop node should end closer to the start node. Another similar restriction is that there shouldn't be any cross-links that connect different branches of a decision sub-graph.### Workflow Graph Layout
The (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_FlowLayout.md) algorithm can be used to lay out flowcharts, workflow and process diagrams. It works by applying a customizable set of rules for local positioning of connected nodes relatively to each other. On a larger scale, the algorithm keeps groups of nodes separate and prevents links between the groups from crossing nodes. The FlowLayout and ProcessLayout examples included in the AvaloniaDiagram package demonstrate two sample sets of layout rules.
### Swimlane Layout
(Markdown/T_MindFusion_Diagramming_Avalonia_Layout_SwimlaneLayout.md) can be used to arrange process diagrams in which nodes representing activities are placed in swimlanes representing resources. The index of the resource allocated to an activity should be assigned to the corresponding node's (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#layouttraits)[(Markdown/CC_T_MindFusion_Layout_SwimlaneLayoutTraits_1.md)].By default, the algorithm works with the diagram's (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#lanegrid), but its (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_SwimlaneLayout.md#swimlanegrid) property can be set to any class that implements (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_ISwimlaneGrid.md). This allows applying the layout to a custom-drawn grid rendered through a custom control template, or one composed of locked background nodes.
### Hierarchical Graph Layout
(Markdown/T_MindFusion_Diagramming_Avalonia_Layout_HierarchicalLayout.md) places nodes on user-defined levels, such that if the source graph is level-planar, all links are guaranteed to have a single segment and not intersect. The layout method requires that for each node LayoutTraits contains a (Markdown/CC_T_MindFusion_Layout_HierarchicalLayoutTraits_0.md) entry specifying the level, and no two connected nodes must be on the same level.
## Multi-level layout algorithms
Multi-level algorithms are used to arrange very large graphs quickly by running other layout algorithms on small parts of the original diagram. Since layout algorithms are usually of polynomial complexity, applying them on smaller subgraphs considerably reduces the overall running time. Multi-level algorithms typically construct a virtual graph that is coarse representation of the diagram, where each virtual node represents a set of actual nodes and links between them. Each set is arranged independently from the others, then the virtual graph is arranged too and the actual sets are placed at the positions of the virtual nodes.
### Composite Graph Layout
## Link Routing
Routed links avoid nodes marked as obstacles by finding the shortest path between their origin and destination that does not cross any other nodes.
### Setting Up a Link Router
The control finds paths for links affected by modifications of nearby nodes by calling methods of an object that implements the (Markdown/T_MindFusion_Diagramming_Avalonia_ILinkRouter.md) interface. This object can be get or set through the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#linkrouter) property of the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) class. AvaloniaDiagram provides a few classes that implement (Markdown/T_MindFusion_Diagramming_Avalonia_ILinkRouter.md) - (Markdown/T_MindFusion_Diagramming_Avalonia_PatternRouter.md), (Markdown/T_MindFusion_Diagramming_Avalonia_GridRouter.md), (Markdown/T_MindFusion_Diagramming_Avalonia_QuickRouter.md) and (Markdown/T_MindFusion_Diagramming_Avalonia_CompositeRouter.md). By default (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#linkrouter) is set to a (Markdown/T_MindFusion_Diagramming_Avalonia_CompositeRouter.md) instance.
### Automatic or Explicit Routing
The (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#routealllinks) method can be invoked to explicitly rearrange links in a way they do not cross nodes. In addition, links have an (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#autoroute) property that enables or disables automatic routing of a link; that property is initialized from the diagram's (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#routelinks) member. The (Markdown/T_MindFusion_Diagramming_Avalonia_RoutingOptions.md#triggerrerouting) member of the (Markdown/T_MindFusion_Diagramming_Avalonia_RoutingOptions.md) class specifies when links must be rerouted automatically.
### Tuning the Routing Algorithm
When a (Markdown/T_MindFusion_Diagramming_Avalonia_GridRouter.md) is used, the (Markdown/T_MindFusion_Diagramming_Avalonia_RoutingOptions.md) class allows customizing various aspects of the routing algorithm. That algorithm evaluates possible paths aiming to find one that has a minimal cost. The values of (Markdown/T_MindFusion_Diagramming_Avalonia_RoutingOptions.md#lengthcost), (Markdown/T_MindFusion_Diagramming_Avalonia_RoutingOptions.md#turncost), (Markdown/T_MindFusion_Diagramming_Avalonia_RoutingOptions.md#crossingcost) and (Markdown/T_MindFusion_Diagramming_Avalonia_RoutingOptions.md#nodevicinitycost) are added to the total cost of a route and have a great influence over the shape of the chosen path. The (Markdown/T_MindFusion_Diagramming_Avalonia_RoutingOptions.md#startorientation) and (Markdown/T_MindFusion_Diagramming_Avalonia_RoutingOptions.md#endorientation) properties specify the orientation of the first and last segments of routed links.
## Anchor Points and Patterns
### Anchor Points
For each node you can define one or more points to which links must dock when connecting to that node. Such points are represented by instances of the (Markdown/T_MindFusion_Diagramming_Avalonia_AnchorPoint.md) class. The position of an anchor point relative to node's bounding rectangle is specified by the X and Y properties. Their values are expressed as percent of the node's width and height to accommodate for moving and resizing. The final location of an anchor point is determined by this simple calculation:
```csharp
return new PointF(
nodeRect.X + nodeRect.Width * X / 100,
nodeRect.Y + nodeRect.Height * Y / 100);
```
```
Return New PointF( _
nodeRect.X + nodeRect.Width * X / 100, _
nodeRect.Y + nodeRect.Height * Y / 100)
```
A point's position can also be defined as a fixed offset from the node's top-left corner, letting you define anchor positions that do not depend on the node's width or height. This is controlled independently for (Markdown/T_MindFusion_Diagramming_Avalonia_AnchorPoint.md#x) and (Markdown/T_MindFusion_Diagramming_Avalonia_AnchorPoint.md#y) coordinates, by means of the (Markdown/T_MindFusion_Diagramming_Avalonia_AnchorPoint.md#xunit) and (Markdown/T_MindFusion_Diagramming_Avalonia_AnchorPoint.md#yunit) properties.
You can control whether an anchor point accepts incoming or outgoing links or both. That is done by the (Markdown/T_MindFusion_Diagramming_Avalonia_AnchorPoint.md#allowincoming) and (Markdown/T_MindFusion_Diagramming_Avalonia_AnchorPoint.md#allowoutgoing) properties. When a link is drawn, its ends are aligned to the nearest anchors allowing docking of the respective end type. Another way to control whether links can be connected to an anchor point is to handle the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#validateanchorpoint) event.
### Anchor Patterns
An (Markdown/T_MindFusion_Diagramming_Avalonia_AnchorPattern.md) instance defines a set of anchor points to be used together. When creating an anchor pattern, pass to its constructor an array of (Markdown/T_MindFusion_Diagramming_Avalonia_AnchorPoint.md) objects. The (Markdown/T_MindFusion_Diagramming_Avalonia_AnchorPattern.md) class exposes several predefined patterns as static properties. An existing pattern can be assigned as a single entity to the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#anchorpattern) property of nodes. The following example creates a pattern of four anchor points:
```csharp
apat1 = new AnchorPattern(new AnchorPoint[] {
new AnchorPoint(50, 0, true, true),
new AnchorPoint(100, 50, true, true),
new AnchorPoint(50, 100, true, true),
new AnchorPoint(0, 50, true, true)});
```
```
apat1 = new AnchorPattern(new AnchorPoint() { _
new AnchorPoint(50, 0, true, true), _
new AnchorPoint(100, 50, true, true), _
new AnchorPoint(50, 100, true, true), _
new AnchorPoint(0, 50, true, true) })
```
The points are located at the middles of bounding rectangle sides of nodes to which the pattern is assigned. All four points accept both incoming and outgoing links.
### Anchor Patterns and Tables
A distinct anchor pattern can be assigned to every row of a table. When a link is connected to a row, the respective end of the link is aligned to the nearest (Markdown/T_MindFusion_Diagramming_Avalonia_AnchorPoint.md) assigned to that row. If a row does not have associated anchor points of the appropriate type (incoming/outgoing), the link will be connected to the nearest row that has such anchors defined. If none of the rows of a table has an associated anchor pattern, links are connected to the middle of the left or right side of the pointed row.
### Anchor Points and User Interaction
By default, a link is attached to an anchor point only when the link is created. Afterwards, the user can move the link end to any part of the node. To ensure that links always stay attached to an anchor point even after subsequent modifications done by the user, set the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#snaptoanchor) property to (Markdown/T_MindFusion_Diagramming_Avalonia_SnapToAnchor.md). You can prevent the user from attaching specific links to specific anchor points by handling the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#validateanchorpoint) event.
### Setting Anchor Point Programmatically
You can connect a link to a specific anchor point by setting the link's (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#originanchor) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#destinationanchor) properties to the index of the point in the respective node's (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#anchorpattern). The (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#reassignanchorpoints) method of (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md) automatically chooses anchor points of the origin and destination nodes that are close to each other, so that the link takes a shorter path between the nodes. The (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#reassignanchorpoints) method of (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md) sets the anchor point of each link connected to the node so that links are evenly distributed among the available anchor points.
## Undo and Redo
The following topics are contained within this topic:
(#overview)
Introduces to the AvaloniaDiagram undo system.
(#actions-and-commands)
Previews the available actions on a diagram and their associated undo/redo commands.
(#undo-manager)
Introduces the UndoManager class.
(#command-history)Information about the command history where all previously executed commands are stored.
(#undo-or-redo-of-property-changes)
Information on how to undo/redo changes in diagram item properties.
(#composite-commands)Demonstrates how to encapsulate a set of commands as a single command that can be undone as an atomic operation.
(#subclassing-the-command-class)
Information on how to create custom commands.
## Overview
Interactive actions, carried out by users, and programmatic commands that change the structure of a diagram are recorded in a history queue. While action records are still in that queue, the actions can be undone or redone. The queue has a fixed length - if it gets full, recording a new action makes the oldest one drop from the queue.
Undo is disabled by default. To enable it, set the (Markdown/T_MindFusion_Diagramming_Avalonia_UndoManager.md#undoenabled) property to true. To undo or redo an action, call the (Markdown/T_MindFusion_Diagramming_Avalonia_UndoManager.md#undo) or (Markdown/T_MindFusion_Diagramming_Avalonia_UndoManager.md#redo) methods of (Markdown/T_MindFusion_Diagramming_Avalonia_UndoManager.md). AvaloniaDiagram does not provide keyboard shortcuts for undo/redo. Your application must have its own menu items and/or keyboard accelerators to provide the necessary user interface, and invoke the respective methods in response to UI events.
AvaloniaDiagram automatically saves the following types of actions for later undo/redo:
- adding an item to the diagram
- removing an item from the diagram
- moving or resizing items
- creating a group
- destroying a group
- expanding or collapsing trees
- scrolling table rows
- adding or removing tables' rows
Changes to property values are not saved automatically in the history. If your application must be able to undo/redo property changes, use the (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_ChangeItemCmd.md) command. (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_ChangeItemCmd.md) allows recording several property changes as an atomic undoable action.
In some cases you may need to create your own types of actions or commands. For example, suppose you need to implement undo/redo for changes made to the Tag property of items or changes to controls embedded in ControlNode items. However, Diagram.Avalonia is not able to detect such changes, so it cannot undo them. To enable undo/redo you would have to create a subclass of (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md) and implement its (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md#execute), (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md#undo) and (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md#redo) methods.
## Actions and Commands
Undoable interactive actions and programmatic commands that can be carried out by AvaloniaDiagram are represented by (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md)subclasses. The (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md) class provides the necessary interface to (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md#execute), (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md#undo) or (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md#redo) actions. In some cases you will have to implement these methods in derived classes, but you must not call them directly. Use the (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md#undo) or (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md#redo) methods of the (Markdown/T_MindFusion_Diagramming_Avalonia_UndoManager.md) to undo or redo a command. The (Markdown/T_MindFusion_Diagramming_Avalonia_UndoManager.md) methods call the respective (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md) methods and in addition update the state of the command history and the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md).
The following AvaloniaDiagram classes are derived from (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md):
| **Command
** | **Description
**
| (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_AddItemCmd.md)
| Adds a new item to the diagram.
| (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_RemoveItemCmd.md)
| Removes an item from the diagram.
| (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_AddGroupCmd.md)
| Creates a new hierarchical group.
| (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_RemoveGroupCmd.md)
| Destroys a group.
| (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_GroupAttachCmd.md)
| Attaches an item to a group.
| (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_GroupDetachCmd.md)
| Detaches an item from a group.
| (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_ModifyItemCmd.md)
| Moves or resizes an item.
| (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_RedimTableCmd.md)
| Change number of table's columns or rows.
| (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_ExpandItemCmd.md)
| Expands or collapses a tree of items.
| (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_ScrollTableCmd.md)
| Scrolls table's rows.
| (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_ExpandHeaderRowCmd.md)
| Expands or collapses tables sections.
| (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_ChangeItemCmd.md)
| Handles undo/redo of item property changes.
| (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_CompositeCmd.md)
| Allows several actions to be undo and redone at the same time.
Instances of most of these classes are created implicitly by AvaloniaDiagram in response to users' actions or method calls. You might need to explicitly instantiate only (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_ChangeItemCmd.md) - to undo or redo property changes - and (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_CompositeCmd.md) - to present several actions as single undoable operation.
The data of your application might be tightly integrated in AvaloniaDiagram diagrams, for example by Tag objects or .NET controls embedded in ControlNode items. In these cases AvaloniaDiagram cannot detect, undo or redo changes to your data. To enable undo of such changes, you must inherit the (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md) class and implement your versions of the (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md#execute), (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md#undo) and (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md#redo) methods. To record your own action in the undo/redo history, call the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#executecommand) method of the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) class.
## Undo Manager
The undo manager acts as a mediator between commands, the diagram and the command history. It is represented by the (Markdown/T_MindFusion_Diagramming_Avalonia_UndoManager.md) class, whose only instance can be accessed by the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md)'s (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#undomanager) property.
By default, undo functionality is disabled - commands are executed, but are not recorded in history for later undo or redo. To enable undo, set (Markdown/T_MindFusion_Diagramming_Avalonia_UndoManager.md#undoenabled) to true. You might need to disable undo before executing actions you don't want end-users to undo, for example creating special start/end nodes. Another situation in which you might want to disable undo is when creating programmatically a lot of new diagram items - say hundreds or thousands. AvaloniaDiagram creates an undo record for each item creation; if the (Markdown/T_MindFusion_Diagramming_Avalonia_CommandHistory.md#capacity) of the command history is smaller than the number of items created, most of the records will drop from the history queue while adding new ones. That would waste processing power and memory for creating undo records that won't be used.
As an alternative, you can create a composite record by calling (Markdown/T_MindFusion_Diagramming_Avalonia_UndoManager.md#startcomposite). All subsequent create-item actions are saved in the composite. The composite is saved in the undo history as a single record that allows undo or redo of all constituent actions as a single operation. (Markdown/T_MindFusion_Diagramming_Avalonia_UndoManager.md#startcomposite) creates and returns a (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_CompositeCmd.md) instance, which is marked as active composite in the undo manager. While there is an active composite, all actions that are carried out are added to it. Call the (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_CompositeCmd.md#execute) method of the active composite to stop recording subcommands in it and save it in the history as atomic undoable operation.
Use the (Markdown/T_MindFusion_Diagramming_Avalonia_UndoManager.md#undo) and (Markdown/T_MindFusion_Diagramming_Avalonia_UndoManager.md#redo) methods of the undo manager to undo or redo actions. Do not call the respective methods of the (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md) class - they are called internally by the undo manager, and in addition the current command history position is updated and the diagram view is repainted.
## Command History
The undo/redo history is represented by a (Markdown/T_MindFusion_Diagramming_Avalonia_CommandHistory.md) instance. That instance is created by the (Markdown/T_MindFusion_Diagramming_Avalonia_UndoManager.md) and can be accessed by its (Markdown/T_MindFusion_Diagramming_Avalonia_UndoManager.md#history) property.
The undo manager adds commands to the history after executing them. If the history queue is full, the oldest command records are removed when new ones are added. Use the (Markdown/T_MindFusion_Diagramming_Avalonia_CommandHistory.md#capacity) property of (Markdown/T_MindFusion_Diagramming_Avalonia_CommandHistory.md) to specify how many action records to keep in the queue.
The history has a current-command pointer indicating which are the next commands to undo or redo. If a command is undone, the current pointer in the history queue is moved back and allows undoing even older actions. If the current pointer is not at the last record, any newer commands can be redone again. Each time an action is undone or redone, respectively an (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#actionundone) or (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#actionredone) event is fired.
To query which are the next commands to be undone or redone, use the (Markdown/T_MindFusion_Diagramming_Avalonia_CommandHistory.md#nextundo) and (Markdown/T_MindFusion_Diagramming_Avalonia_CommandHistory.md#nextredo) read-only properties. They return the (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md) instances contained in the queue which are referred by the current position pointer. If no further undo or redo is possible, the properties return null (Nothing in Visual Basic). You might use them to indicate to end-users which are the next commands to undo/redo.
```csharp
if (diagram.UndoManager.History.NextUndo == null)
{
// Everything has been undone
miUndo.Enabled = false;
miUndo.Text = "Undo";
}
else
{
if (diagram.UndoManager.History.NextUndo is AddItemCmd)
{
// The next action to undo is item-creation
miUndo.Enabled = true;
miUndo.Text = "Undo Create";
}
}
```
```
If Diagram.UndoManager.History.NextUndo Is Nothing Then
' Everything has been undone
miUndo.Enabled = False
miUndo.Text = "Undo"
Else
If TypeOf Diagram.UndoManager.History.NextUndo Is AddItemCmd Then
' The next action to undo is item-creation
miUndo.Enabled = True
miUndo.Text = "Undo Create"
End If
End If
```
To ban end-users from undoing last commands, clear the command history by invoking the (Markdown/T_MindFusion_Diagramming_Avalonia_CommandHistory.md#clear) method. It is possible to filter some commands so they are not recorded in the history by handling the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#actionrecording) event.
## Undo or Redo of Property Changes
Changes to item properties are not recorded automatically for later undo. To enable undo of property changes, you must explicitly create a (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_ChangeItemCmd.md) instance and add it to the history queue.
The (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_ChangeItemCmd.md) constructor requires a reference to an item as argument and saves the item's initial state to be restored by later (Markdown/T_MindFusion_Diagramming_Avalonia_UndoManager.md#undo). Call the (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_ChangeItemCmd.md#execute) method after one or more assignments to item's properties. (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_ChangeItemCmd.md#execute) records the final state of the item to be restored by later (Markdown/T_MindFusion_Diagramming_Avalonia_UndoManager.md#redo). This allows changes to several properties of an item to be saved within a single record, which can be undone or redone as a single operation:
```csharp
// Save item state
ChangeItemCmd propChange = new ChangeItemCmd(diagram.Nodes, "Change");
// Change properties
ShapeNode shape = (ShapeNode)diagram.Nodes;
shape.Text = "new text";
shape.Brush = new SolidBrush(Color.Blue);
shape.Shape = Shape.FromId("Ellipse");
// Add to history
propChange.Execute();
```
```
' Save item state
Dim propChange = New ChangeItemCmd(Diagram.Nodes(0), "Change")
' Change properties
Dim shape As ShapeNode = Diagram.Nodes(0)
shape.Text = "new text"
shape.Brush = New SolidBrush(Color.Blue)
shape.Shape = MindFusion.Diagramming.Shape.FromId("Ellipse")
' Add to history
propChange.Execute()
```
You might need to treat changes to several items as an atomic operation. To do so, create a (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_CompositeCmd.md) instance and add the (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_ChangeItemCmd.md) commands to the composite by the (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md#addsubcmd) method:
```csharp
if (diagram.Selection.Nodes.Count == 0)
return;
// Make all changes seem like a single operation by
// putting them in composite Command
CompositeCmd composite = new CompositeCmd(
diagram, "Change selection");
foreach (DiagramNode node in diagram.Selection.Nodes)
{
ShapeNode shape = node as ShapeNode;
if (shape == null)
continue;
// Save item state
ChangeItemCmd propChange = new ChangeItemCmd(shape, "Change");
// Change properties
shape.Text = "new text";
shape.Brush = new SolidBrush(Color.Blue);
// Add to the composite
composite.AddSubCmd(propChange);
}
// Store final state of all contained commands
composite.Execute();
```
```
If diagram.Selection.Nodes.Count = 0 Then
Return
End If
' Make all changes seem like a single operation by
' putting them in composite Command
Dim composite As CompositeCmd = New CompositeCmd( _
diagram, "Change selection")
Dim node As DiagramNode
For Each node In diagram.Selection.Nodes
Dim shape As ShapeNode = CType(node, ShapeNode)
If Not shape Is Nothing Then
' Save item state
Dim propChange As ChangeItemCmd = New ChangeItemCmd(shape, "Change")
' Change properties
shape.Text = "new text"
shape.Brush = New SolidBrush(Color.Blue)
' Add to the composite
composite.AddSubCmd(propChange)
End If
Next
' Store final state of all contained commands
composite.Execute()
```
## Composite Commands
Sometimes you might prefer having a set of actions undo and redo as a single atomic operation. AvaloniaDiagram provides the (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_CompositeCmd.md) class to help you with that. (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_CompositeCmd.md) objects act as containers of other (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md)-derived objects. When (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_CompositeCmd.md#undo) or (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_CompositeCmd.md#redo) are invoked on a composite command, all its subcommands are respectively undone or redone.
To add a command to the composite call the (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md#addsubcmd) method. Call (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_CompositeCmd.md#execute) to execute all subcommands contained in the composite. Subcommands are executed or redone in the same order in which they were added to the container, and are undone in the opposite order.
Often AvaloniaDiagram implicitly generates (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md) objects in response to users actions or method calls, and automatically records them in the history queue. You do not have direct access to those commands and cannot add them to a composite by (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md#addsubcmd). To enable creating composites in such cases, the undo manager provides the notion of active composite. Active composite is created by calling the (Markdown/T_MindFusion_Diagramming_Avalonia_UndoManager.md#startcomposite) function of (Markdown/T_MindFusion_Diagramming_Avalonia_UndoManager.md). Each action executed after that is made part of the composite, instead of adding it directly to the command history. Invoking the (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_CompositeCmd.md#execute) method of the current composite completes it and saves it in the history queue.
```csharp
// Implicitly created undo records will be saved here
CompositeCmd composite = diagram.UndoManager.StartComposite("Create group");
// Call methods that create undo records
ShapeNode node1 = diagram.Factory.CreateShapeNode(0, 0, 30, 30);
ShapeNode node2 = diagram.Factory.CreateShapeNode (0, 0, 15, 15);
Group g = diagram.Factory.CreateGroup(node1);
g.AttachToCorner(node2, 0);
// This goes to the active composite too
ChangeItemCmd change = new ChangeItemCmd(node2, "");
node2.Locked = true;
change.Execute();
// Save the active composite in history
composite.Execute();
```
```
' Implicitly created undo records will be saved here
Dim composite As CompositeCmd = Diagram.UndoManager.StartComposite("Create group")
' Call methods that create undo records
Dim node1 As ShapeNode = Diagram.Factory.CreateShapeNode(0, 0, 30, 30)
Dim node2 As ShapeNode = Diagram.Factory.CreateShapeNode(0, 0, 15, 15)
Dim g As Group = Diagram.Factory.CreateGroup(node1)
g.AttachToCorner(node2, 0)
' This goes to the active composite too
Dim change As New ChangeItemCmd(node2, "")
node2.Locked = True
change.Execute()
' Save the active composite in history
composite.Execute()
```
## Subclassing the Command Class
AvaloniaDiagram diagrams can be just a part of the data model of your application, which might already have undo/redo functions implemented for its native data. To integrate AvaloniaDiagram undo functionality into the application's undo mechanism, use the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#actionrecorded) event. When the event is fired, add a corresponding wrapper-record to your application's history from the event handler. The wrapper could just call (Markdown/T_MindFusion_Diagramming_Avalonia_UndoManager.md#undo) and (Markdown/T_MindFusion_Diagramming_Avalonia_UndoManager.md#redo) methods of the (Markdown/T_MindFusion_Diagramming_Avalonia_UndoManager.md). In such situations make sure the AvaloniaDiagram's history (Markdown/T_MindFusion_Diagramming_Avalonia_CommandHistory.md#capacity) is at least as big as your application's.
Another possibility is to reuse AvaloniaDiagram's undo functionality by subclassing (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md) and creating classes responsible for changes in your application's data. When a change occurs outside the diagram, it can still be recorded by the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md)'s (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#executecommand) method and integrated into AvaloniaDiagram's command history.
A simpler scenario when you might have to subclass (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md) is using complex objects as tags or embedding controls in ControlNode instances. Actions that change these objects or controls cannot be detected and handled automatically by AvaloniaDiagram. To integrate such an action into the diagram's undo history, you must create a (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md) instance that knows how to carry out, undo or redo the action.
(Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md) subclasses must implement (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md#execute), (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md#undo) and (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md#redo) methods. Actions represented by your subclass must be carried out by executing the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#executecommand) method of (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md). (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#executecommand) invokes (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md#execute) on the command passed as argument, which is then added to the history queue and whose (Markdown/T_MindFusion_Diagramming_Avalonia_UndoManager.md#undo) and (Markdown/T_MindFusion_Diagramming_Avalonia_UndoManager.md#redo) methods can be called multiple times later by the undo manager. Usually you can implement (Markdown/T_MindFusion_Diagramming_Avalonia_UndoManager.md#redo) as a call to (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md#execute), but if the latter is time consuming, its result state can be saved in an instance member and restored by Redo.
Do not call the (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md#undo) and (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md#redo) methods of your class directly, just implement them and they will be invoked by (Markdown/T_MindFusion_Diagramming_Avalonia_UndoManager.md)'s (Markdown/T_MindFusion_Diagramming_Avalonia_UndoManager.md#undo) or (Markdown/T_MindFusion_Diagramming_Avalonia_UndoManager.md#redo) methods when necessary.
The example below shows a simple implementation of (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md) methods:
```csharp
public class PersonTag
{
public string Name;
public string Address;
// And so on
...
}
public class AddressChangeCmd : Command
{
public AddressChangeCmd(PersonTag p, string address) :
base("Address change")
{
this.p = p;
this.oldAddress = p.Address;
this.newAddress = address;
}
public override void Execute(bool undoEnabled)
{
p.Address = newAddress;
}
public override void Undo()
{
p.Address = oldAddress;
}
public override void Redo()
{
// Undo manager is enabled if Redo is called
// so pass true for the undoEnabled argument
Execute(true);
}
private PersonTag p;
private string oldAddress;
private string newAddress;
}
...
// Somewhere in later code
PersonTag tag = (PersonTag)diagram. ActiveItem.Tag;
AddressChangeCmd cc = new AddressChangeCmd(tag, "far far away");
diagram.ExecuteCommand(cc);
```
```
Public Class PersonTag
Public Name As String
Public Address As String
' And so on
...
End Class
Public Class AddressChangeCmd
Inherits Command
Public Sub New(ByVal p As PersonTag, ByVal address As String)
MyBase.New("Address change")
Me.p = p
Me.oldAddress = p.Address
Me.newAddress = address
End Sub
Protected Overrides Sub Execute(ByVal undoEnabled As Boolean)
p.Address = newAddress
End Sub
Protected Overrides Sub Undo()
p.Address = oldAddress
End Sub
Protected Overrides Sub Redo()
' Undo manager is enabled if Redo is called
' so pass true for the undoEnabled argument
Execute(True)
End Sub
Private p As PersonTag
Private oldAddress As String
Private newAddress As String
End Class
...
' Somewhere in later code
Dim tag As PersonTag = CType(diagram.ActiveItem.Tag, PersonTag)
Dim cc As AddressChangeCmd = New AddressChangeCmd(tag, "far far away")
diagram.ExecuteCommand(cc)
```
## Diagram Serialization and Output
The following topics are contained within this topic:
(#serializing-diagrams)
Provides information on how to serialize and deserialize diagrams to and from XML.
Exporting the Diagram
Detailed information about all formats that the diagrams can be exported to.
(#printing-and-print-preview)
Information on how to print and preview diagrams.
## Serializing Diagrams
### XML Serialization
A diagram can be saved as an XML document. To do that, call the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#savetoxml) method of the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) class. To deserialize a diagram back from its XML representation, call the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#loadfromxml) method.
Custom item classes can implement XML serialization for their additional properties by overriding the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#savetoxml) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#loadfromxml) methods. In addition, such classes must specify a string to use as their identifier in the XML document by calling (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#registeritemclass).
The control raises SerializeTag and DeserializeTag to enable serialization of complex (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#id) and Tag objects without overriding the item classes. The (Markdown/T_MindFusion_Diagramming_Avalonia_SerializeTagEventArgs.md#propertyname) event argument specifies which property is being serialized.
### JSON Serialization
To serialize a diagram as a JSON string, call its (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#savetojsonstring) method. To deserialize a diagram back from its JSON representation, call the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#loadfromjsonstring) method. The (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#savetojson) and (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#loadfromjson) methods serialize the JSON strings to / from files.Custom item classes can implement JSON serialization for their additional properties by overriding the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#savetojson) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#loadfromjson) methods. Such classes must be registered for serialization by calling the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#registeritemclass) method and providing a string identifier for the clientClass parameter.
The control raises (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#jsonserializetag) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#jsondeserializetag) to enable serialization of complex Id and Tag objects without overriding the item classes. The (Markdown/T_MindFusion_Diagramming_Avalonia_JsonSerializeTagEventArgs.md#propertyname) event argument specifies which property is being serialized.
JSON serialization is handled internally by the classes from (#mindfusionjsonavalonia) namespace. The (Markdown/T_MindFusion_Json_Wpf_JsonValue.md) class represents a property value. Property names and values are stored in instances of the (Markdown/T_MindFusion_Json_Wpf_JsonObject.md) dictionary class. The (Markdown/T_MindFusion_Json_Wpf_JsonContext.md) class handles the serialization of the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) properties. The (Markdown/T_MindFusion_Json_Wpf_JsonContext.md#serialize) method is a wrapper over the (Markdown/T_MindFusion_Json_Wpf_Serializer.md) class' (Markdown/T_MindFusion_Json_Wpf_Serializer.md#serialize) method. It takes a (Markdown/T_MindFusion_Json_Wpf_JsonObject.md) and serializes it to a string. The (Markdown/T_MindFusion_Json_Wpf_JsonContext.md#parse) method is a wrapper over the (Markdown/T_MindFusion_Json_Wpf_Parser.md) class' (Markdown/T_MindFusion_Json_Wpf_Parser.md#readjsonobject) method. It takes a JSON-formatted string and returns a (Markdown/T_MindFusion_Json_Wpf_JsonObject.md) with the parsed data.
## Printing and Print Preview
You can print a (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) using the standard WPF printing facilities. The (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#documentpaginator) property lets you print a multiple-page diagram. The following example shows how to use it:
```csharp
PrintDialog pd = new PrintDialog();
if (pd.ShowDialog())
pd.PrintDocument(diagram.DocumentPaginator, "my diagram");
```
As a shortcut, WpfDiagram provides the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#print) and (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#printpreview) methods, which use (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#documentpaginator) internally to print the diagram content, or to preview how it would look when printed.
## Appearance
The following topics are contained within this topic:
(#styles-and-themes)
Provides information on how to use styles and themes.
(#node-effects)
Information on how to apply the built-in node effects.
(#modifying-the-diagram-appearance)
General options affecting the appearance of a AvaloniaDiagram diagram.
(#customizing-the-appearance-of-items)
Information about how to modify various aspects of the appearance of individual diagram items.
(#user-defined-node-shapes-and-custom-drawing)
Information on how to define arbitrary node shapes as well as how to use custom-drawing.
(#text-attributes-and-formatting)
Provides information on how to customize the text of diagram items and lists all possible formatting tags.
## Styles and Themes
The style and theme system provides a consistent way to customize the appearance of a (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) and its items. By using styles and themes, it is easier to achieve coherent look and feel across the entire diagram. In addition, changing the look and feel can be achieved by simply replacing the current theme. New themes can be designed in the visual environment of the Theme Editor tool and subsequently used and distributed as XML files. Several pre-defined theme files are installed under the Themes subfolder of the control's root installation folder.
### Styles
AvaloniaDiagram styling system uses regular WPF Style objects. To apply a style to an individual diagram item set the style to the item's Style property - the same way you would apply a style to a regular FrameworkElement object. All rules that apply to the WPF Style objects are in effect here as well. For example, you can define a Style as a resource, then reference this resource from diagram items declared in XAML. To apply a style for all items of a particular type, define a Style object within the current scope with its TargetType set to the appropriate type. Alternatively you can use a (Markdown/T_MindFusion_Diagramming_Avalonia_Theme.md) (see the following section).
### Themes
The theme in AvaloniaDiagram is a set of styles, each associated with specific item type. When the theme is applied to a diagram, the styles registered in the theme affect all objects of their associated type.
Themes are represented by the (Markdown/T_MindFusion_Diagramming_Avalonia_Theme.md) class and can be assigned to (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) objects through the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#theme) property. Styles are associated with types within the theme through the (Markdown/T_MindFusion_Diagramming_Avalonia_Theme.md#registerstyle) method. The following code creates a new theme, with a single style for (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md) items and applies this theme to an existing diagram.
```csharp
Theme theme = new Theme();
Style style = new Style();
style.Setters.Add(new Setter(ShapeNode.FontFamilyProperty, new FontFamily("Courier New")));
theme.RegisterStyle(typeof(ShapeNode), style);
diagram.Theme = theme;
```
```vbnet
Dim theme As New Theme()
Dim style As New Style()
style.Setters.Add(New Setter(ShapeNode.FontFamilyProperty, New FontFamily("Courier New")))
theme.RegisterStyle(GetType(ShapeNode), style)
diagram.Theme = theme
```
Alternatively, themes can be loaded from XML files by calling the (Markdown/T_MindFusion_Diagramming_Avalonia_Theme.md#loadfromxml) method. Such XML files can be produced by the Theme Editor tool, or by calling the (Markdown/T_MindFusion_Diagramming_Avalonia_Theme.md#savetoxml) method of an existing theme.
Another way to implicitly register styles with themes is through a set of shortcut properties exposed by the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) class, namely (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#diagramlinkstyle), (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#shapenodestyle), (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#tablenodestyle), (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#containernodestyle), and (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#treeviewnodestyle). Setting any of these properties automatically registers the property value as a style within the currently associated theme. These properties are particularly useful for specifying styles through XAML. The following example illustrates this:
```xaml
```
### Theme Editor
The Theme Editor provides simple visual environment for theme creation and modification. The editor displays a sample diagram with items of various types and exposes a list of all style properties through a property grid to the left. Any modification of the style properties in the grid is immediately reflected on the diagram to give a preview on what effect the change would have if the theme is applied to a diagram. The theme can be saved at any time through the Save menu. Existing themes can be opened and modified.
The following image illustrates the Theme Editor in action:
## Node Effects
To apply an effect to the nodes in a diagram, create an instance of one of the effect classes and add this instance to the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#nodeeffects) collection. To apply the effect to individual nodes, add the instance to the node's (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#effects) collection. To discard the diagram effects for a particular node, add a null reference (Nothing in Visual Basic) at position 0 in the node's (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#effects) collection. Effects can also be applied through styles by using the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#effectssourceproperty) and (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#nodeeffectssourceproperty) dependency properties.
It is possible to combine different effects by adding instances of their appropriate types to the effect collections. If is also admissible to apply more than one effect of the same type.
The currently supplied effect types are Aero and Glass. They are examined in more details in the sections below.
### Aero Effect
The Aero effect is represented by the (Markdown/T_MindFusion_Diagramming_Avalonia_AeroEffect.md) class. The effect is designed to roughly resemble the Aero theme of Windows. More specifically, the effect adds semi transparency to the nodes, a smooth shade at the outside and a thin inset stroke. The semi transparency is specified through the (Markdown/T_MindFusion_Diagramming_Avalonia_AeroEffect.md#opacity) property. Opacity varies from 0 to 1 inclusive, where 0 indicates full transparency and 1 indicates the original node color. The semi transparency is applied only on the node brush. The colors of the shade and the inner stroke are specified through the (Markdown/T_MindFusion_Diagramming_Avalonia_AeroEffect.md#shadecolor) and (Markdown/T_MindFusion_Diagramming_Avalonia_AeroEffect.md#inneroutlinecolor) properties respectively. The following image illustrates how these properties affect the output:
The following example applies the Aero effect on the nodes of an existing diagram:
```csharp
AeroEffect effect = new AeroEffect();
effect.Opacity = 0.5;
effect.InnerOutlineColor = Color.FromArgb(100, 255, 255, 255);
diagram.NodeEffects.Add(effect);
```
```
Dim effect As New AeroEffect()
effect.Opacity = 0.5
effect.InnerOutlineColor = Color.FromArgb(100, 255, 255, 255)
diagram.NodeEffects.Add(effect)
```
### Tips
- The Aero effect works very well in scenarios with overlapping nodes or in cases where the background is more complex than solid color, due to the effect of semi transparency.
- Aero combines well with the Glass effect. There are some examples at the end of this topic.
- The (Markdown/T_MindFusion_Diagramming_Avalonia_AeroEffect.md#shadecolor) is usually black or another dark color. However, some nice glow effects can be achieved by setting bright (Markdown/T_MindFusion_Diagramming_Avalonia_AeroEffect.md#shadecolor) on a diagram with dark background.
- The Aero effect can impact performance if there are many nodes visible in the diagram.
### Glass Effect
The Glass effect is represented by the (Markdown/T_MindFusion_Diagramming_Avalonia_GlassEffect.md) class. The Glass effect adds visuals on top of the nodes in order to give the impression of a reflective surface. There are several variations of this effect, which can be selected through the (Markdown/T_MindFusion_Diagramming_Avalonia_GlassEffect.md#type) property. The color of the reflection and the ambient color can be specified through the (Markdown/T_MindFusion_Diagramming_Avalonia_GlassEffect.md#reflectioncolor) and (Markdown/T_MindFusion_Diagramming_Avalonia_GlassEffect.md#glowcolor) properties respectively. When (Markdown/T_MindFusion_Diagramming_Avalonia_GlassEffect.md#usepenasglow) is set to true the color of the node's pen is used as the ambient color. The following image illustrates the differences between the distinct effect types:
The following example applies a Glass effect with the default settings to the nodes of a diagram:
```csharp
diagram.NodeEffects.Add(new GlassEffect());
```
```
diagram.NodeEffects.Add(New GlassEffect())
```
### Tips
- The (Markdown/T_MindFusion_Diagramming_Avalonia_GlassEffect.md#glowcolor) is usually white. However, for (Markdown/T_MindFusion_Diagramming_Avalonia_GlassEffectType.md) glass effects it is often more suitable to use black glow.
- The Glass effect combines well with the Aero effect. There are some examples at the end of this topic.
- Several glass effects of different types can be applied simultaneously for emphasized effect.
### Examples
The values of the effect properties are usually selected in accordance with the color scheme of the target diagram and the desired end result. In addition different types of effects can be applied simultaneously to achieve more interesting results. The examples below demonstrate possible effect combinations in various color contexts.
### Aero & Glass (Dark on Light)
In this example the Aero and Glass effects are combined. The Aero effect is useful in scenarios when dark nodes are placed on light background or vice versa, in order to emphasize the contrast.
Here is the code that applies the above effects:
```csharp
diagram.NodeEffects.Add(new GlassEffect());
diagram.NodeEffects.Add(new AeroEffect());
```
```
diagram.NodeEffects.Add(New GlassEffect())
diagram.NodeEffects.Add(New AeroEffect())
```
### Aero & Glass (Light on Dark)
This example is similar to the first one, only this time the nodes are painted in light colors and the background is dark.
Here is the code that applies the above effect:
```csharp
GlassEffect glassEffect = new GlassEffect();
glassEffect.Type = GlassEffectType.Type3;
diagram.NodeEffects.Add(glassEffect);
diagram.NodeEffects.Add(new AeroEffect());
```
```
Dim glassEffect As New GlassEffect()
glassEffect.Type = GlassEffectType.Type3
diagram.NodeEffects.Add(glassEffect)
diagram.NodeEffects.Add(New AeroEffect())
```
### Glow Effect
This example uses bright colors on black background to create a glow effect. The example utilizes an Aero effect with (Markdown/T_MindFusion_Diagramming_Avalonia_AeroEffect.md#shadecolor) set to the color of the nodes' pens.
Here is the code that applies the above effects:
```csharp
GlassEffect glassEffect = new GlassEffect();
glassEffect.Type = GlassEffectType.Type2;
glassEffect.UsePenAsGlow = true;
diagram.NodeEffects.Add(glassEffect);
AeroEffect aeroEffect = new AeroEffect();
aeroEffect.Opacity = 0;
aeroEffect.InnerOutlineColor = Colors.Black;
aeroEffect.ShadeColor = Color.FromArgb(255, 128, 255, 255);
diagram.NodeEffects.Add(aeroEffect);
```
```
Dim glassEffect As New GlassEffect()
glassEffect.Type = GlassEffectType.Type2
glassEffect.UsePenAsGlow = True
diagram.NodeEffects.Add(glassEffect)
Dim aeroEffect As New AeroEffect()
aeroEffect.Opacity = 0
aeroEffect.InnerOutlineColor = Colors.Black
aeroEffect.ShadeColor = Color.FromArgb(255, 128, 255, 255)
diagram.NodeEffects.Add(aeroEffect)
```
## Modifying the Diagram Appearance
You can customize most of AvaloniaDiagram visualization effects.
### Background
The (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) background area can be filled using a solid brush, gradient, texture or color patterns, by setting the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#backbrush) property. Background theme can also be an image set by the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#backgroundimage) property. The image can be any from the supported by the .NET System.Drawing.Image file formats - metafiles, icons, bitmaps, jpegs or gifs. Background image can be centered, aligned to a corner of the control or document, tiled or stretched to cover the drawing area - depending on the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#backgroundimagealign) property value. It is possible to paint the area outside (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#bounds) using a distinct brush by setting the ExteriorBrush property.
### Shadows
Unlike the ActiveX and Windows Forms versions of the control, AvaloniaDiagram does not provide a built-in shadow rendering. Instead, it relies on the WPF Effect classes for rendering shadows and other visual effects, such as blur. To enable any of these effects, set the Effect property of items to an instance of an Effect -derived class.
### Selection
The style of selection handles drawn around the active item can be set through the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#activeitemhandlesstyle) compound property. Items in multiple selection have their handles drawn using the style specified through the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#selecteditemhandlesstyle) property. Disabled manipulation handles are painted using (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#disabledhandlesstyle) when (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#showdisabledhandles) is enabled (see (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#enabledhandles)). The (Markdown/T_MindFusion_Diagramming_Avalonia_Selection.md#style) property of the (Markdown/T_MindFusion_Diagramming_Avalonia_Selection.md) class controls the way multiple-selection is displayed.
### Mouse Cursors
Different mouse cursor icons can be set to give context-sensitive feedback to users, prompting them if creation/modification of an item is possible. The following properties specify what cursors are displayed at different situations: (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#pointercursor), (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#movecursor), (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#disallowcursor), (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#drawlinkcursor), (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#allowlinkcursor), (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#disallowlinkcursor), (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#horizontalresizecursor), (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#verticalresizecursor), (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#diagonalresizecursor), (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#counterdiagonalresizecursor). AvaloniaDiagram displays the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#pancursor) while panning the diagram view. Set the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#overridecursor) property if you need to set a cursor that does not depend on the current context.### Grid Settings
An alignment grid is drawn if the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#showgrid) is set to true. The (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#gridpen) property specifies the pen used to draw grid points and lines.
## Customizing the Appearance of Items
For every AvaloniaDiagram item, different visual styles and properties can be set as described in the following paragraphs.
### Styling
Diagram items can be styled using the WPF styling system. The Style property inherited from FrameworkElement can be set to an instance of the System.Windows.Style class that sets the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#brush), (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#stroke), (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#textalignment) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#fontfamily) dependency properties. If a style is not explicitly assigned to an item, it can use global styles defined for a type in the application or window resource dictionaries. For example, if this style is defined as a window resource, (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md)s will have a thick red border:
```xaml
```
Since style setters have lower precedence than local property values, styling works immediately only for items created through no-args constructors. Properties of items loaded from a file or created through a (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#diagramitem)((Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md)) constructor might have local values, which can be cleared through the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#clearstyleableproperties) method in order to enable styling.
### Pen Width and Style
The borders of nodes and the lines of links are drawn using a pen whose color, width and style can be customized through the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#stroke), (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#strokethickness) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#strokedashstyle) properties.
### Color of Diagram Elements
The color of link segments can be set using the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#stroke) property. (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#brush) specifies how closed arrowhead shapes are filled. Nodes have similar properties for color customization: the color of node borders is specified through the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#stroke) property; the interior of a node is filled using (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#brush).
### Text
Diagram items can have associated text, displayed inside or over them. It can be set through the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#text) property of the base (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md) class. (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#textbrush) specifies the brush used to draw the item's text.
The text of shape nodes can be laid out and rendered inside a polygonal outline; that depends on the value of (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md#polygonaltextlayout). To make a node big enough to display its text without clipping, call (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md#resizetofittext). Links have their text drawn horizontally above their middle segment or rotated as specified by (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#textstyle).
All diagram items expose (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#fontfamily), (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#fontstyle) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#fontsize) properties, specifying the name, style and size of the font of item's text. Text is formatted through properties such as (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#textalignment), (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#texttrimming) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#textwrapping).
### Images
Shape nodes and tables can display images inside them. Use (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md#image) and (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md#image) properties to load images into the respective items. A node can be made the same size as the image it contains by calling (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md#resizetofitimage).
Images can be positioned in different ways: they can be tiled, stretched or aligned to the containing nodes' centers or sides. Use (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md#imagealign) and (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md#imagealign) to specify how images are placed within the corresponding nodes. An image shown inside a node is clipped in accordance with the shape of that node.
Table cells can have (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode+Cell.md#image) and (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode+Cell.md#imagealign) assigned too. For example that might be used to display an icon for the key field of a database table.
### Effects
WPF shader effects such as drop shadows and blur can be applied to diagram items through their Effect property. The Effect dependency property is defined in the base UIElement class from which (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md) is derived. For more information on shader effects, check the Effect topic in the MSDN library.
The (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#defaulteffect) property of the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) class allows to specify an effect that must be assigned to all new items.
### DiagramLink-specific Properties
The shape and orientation of link segments is specified by the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#shape) property; the number of segments is specified by the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#segmentcount) property. The form and size of the arrowhead shape is set using the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#headshape) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#headshapesize) properties. Shapes displayed at the origin of links are defined by (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#baseshape) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#baseshapesize). Shapes can be displayed at middles of segments, helping to follow the path of long links. They are defined by the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#intermediateshape) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#intermediateshapesize) properties. The lines of arrowhead shapes are painted using the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#headpen) pen. Custom painting code may be invoked for a link, as set in (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#customdraw).
### Rounded Links
Links comprising straight segments, that is, ones whose (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#shape) is set to (Markdown/T_MindFusion_Diagramming_Avalonia_LinkStyle.md) or (Markdown/T_MindFusion_Diagramming_Avalonia_LinkStyle.md), can use arcs to join their adjacent segments. To enable that feature, set (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#roundedlinks) to true. Use (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#roundedlinksradius) to set the radius of the joining arcs.
### Link Crossings
Intersection points where links cross their paths can be rendered as arcs or breaks, as specified by (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#linkcrossings). It depends on the Z-order, which links jump over the others, or which links appear cut by the others. If (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#linkcrossings) is set to (Markdown/T_MindFusion_Diagramming_Avalonia_LinkCrossings.md), links with higher (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#zindex) jump over those with lower (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#zindex). If set to (Markdown/T_MindFusion_Diagramming_Avalonia_LinkCrossings.md), links at lower Z position are cut by links at higher Z. Radius of arcs and breaks can be set through the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#crossingradius) property.
### ShapeNode-specific Properties
The shape of a node is defined using its (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md#shape) property. Shape templates can be applied to a shape node with an orientation of 0/90/180/270 degrees as specified through the (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md#shapeorientation) property. Your own drawing code may be invoked for a node, depending on the value of (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md#customdraw). Shape nodes can be marked as (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md#transparent), having only their text or images rendered.
### TableNode-specific Properties
The outline of a table can be either a rectangle or rounded rectangle, as specified by the (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md#shape) property. The borders of table cells can be rendered in different ways, depending on the value of (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md#cellframestyle). The table caption area is painted using the (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md#captionbackbrush) brush. Custom painting can be performed on a table and its cells as set in the (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md#customdraw) and (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md#cellcustomdraw) properties.
## User Defined Node Shapes and Custom Drawing
The appearance of AvaloniaDiagram items can be customized in several additional ways, as described below.
### Shape Templates
The (Markdown/T_MindFusion_Diagramming_Avalonia_Shape.md) class provides the means for defining complex node shapes, made of straight lines, arcs and Bézier curves. A shape template must always contain an outline to be used for hit testing, clipping and finding intersections with other items. Optionally shapes can contain decoration elements and text region definitions. Decorations are visual elements that do not take part in hit testing and clipping. Text regions are the parts of shapes in which node's text is laid out and rendered. AvaloniaDiagram provides a set of 87 predefined shape templates, which can be accessed by the (Markdown/T_MindFusion_Diagramming_Avalonia_Shape.md#shapes) collection or (Markdown/T_MindFusion_Diagramming_Avalonia_Shape.md#fromid) method of the (Markdown/T_MindFusion_Diagramming_Avalonia_Shape.md) class. Each predefined shape has a string identifier assigned to it. Use the (Markdown/T_MindFusion_Diagramming_Avalonia_Shape.md#fromid) method to find a shape with the specified id. A shape template can be assigned to the (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md#shape) member of shape nodes.
### Dynamic Shapes
Shapes defined via (Markdown/T_MindFusion_Diagramming_Avalonia_ElementTemplate.md) objects are scaled proportionally to the size of nodes. If shape elements should scale non-uniformly, use the Shape(formula) constructor to define shapes through Visio-like formulas that take into consideration the current width and height of nodes. Another Shape constructor takes a CreatePathDelegate parameter that can be used to define shapes via .NET functions.
A formula shape can be parameterized by adding (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeControlPoint.md) objects to the shape's (Markdown/T_MindFusion_Diagramming_Avalonia_Shape.md#controlpoints) collection. The control point positions are passed as arguments to the shape scripts, where they can be used to modify the node's appearance. For example, the following code defines a rounded rectangle shape, whose corner radius can be modified by users via the control point.
```csharp
// a rounded rectangle shape, with an arc at each corner
string roundRect = @"
r = Min(Width / 2, radius.X);
MoveTo(r, 0);
LineTo(Width - r, 0);
ArcTo(Width, r, false, true, r, r);
LineTo(Width, Height - r);
ArcTo(Width - r, Height, false, true, r, r);
LineTo(r, Height);
ArcTo(0, Height - r, false, true, r, r);
LineTo(0, r);
ArcTo(r, 0, false, true, r, r);
";
var myRect = new Shape(roundRect, "MyRect");
// add a control point for the 'radius' parameter
myRect.ControlPoints.Add(new ShapeControlPoint(
"radius", 15, 5, 45, UnitType.Fixed, 0, 0, 0, UnitType.Fixed));
```
### Shape Libraries
The ShapeDesigner tool included in the AvaloniaDiagram suite lets you draw custom shapes and store them in shape libraries. A library file can be loaded into your application using the (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeLibrary.md) class. The definitions loaded from a shape library are automatically added to the (Markdown/T_MindFusion_Diagramming_Avalonia_Shapes.md) collection and can be accessed through the (Markdown/T_MindFusion_Diagramming_Avalonia_Shape.md#fromid) method, just as the predefined shapes.
### Custom Painting
Another way to customize item's appearance is implemented by raising an event each time an item is painted, giving you the option to attach your own drawing code to the AvaloniaDiagram's rendering engine. Use the corresponding CustomDraw property of items to enable that feature in your application.
AvaloniaDiagram provides several options for custom drawing. If you choose Additional drawing style, your drawing code will be executed after the standard item drawing code is executed and Image is rendered, but before the text is rendered. Furthermore, the DrawingContext object you receive to draw on has a clipping region applied that corresponds to a node's shape. If using (Markdown/T_MindFusion_Diagramming_Avalonia_CustomDraw.md) drawing mode, none of the standard AvaloniaDiagram drawing code is executed - just yours. The (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md#customdraw) mode performs standard painting of items, but leaves the drawing of shadows to your code.
Place your own drawing code in a handler of the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#drawnode), (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#drawcell) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#drawlink) events. These events are fired for each custom-drawn item that needs repainting.
### Combining Custom Shapes with Custom Drawing
Finally, you could combine user-defined shapes with the (Markdown/T_MindFusion_Diagramming_Avalonia_CustomDraw.md) custom-painting style. Thus, you can get custom shapes enabled for a node and your custom painting code executing with the node shape used as clipping region. You might clear the clipping region, but be careful - if you draw outside node's bounding rectangle the view may not update correctly.
### Shape control points
Shape formulas can now be parameterized by associating control points with (Markdown/T_MindFusion_Diagramming_Avalonia_Shape.md) objects. Each control point is passed to the shape script as a named variable. Apart from the name, you can specify the default, min and max coordinates for each parameter via the ShapeControlPoint constructor, and whether to treat its values as percents or fixed offset.
For example, the following code creates an arrow shape with adjustable arrowhead and fletching sizes:
```csharp
string arrow60deg = @"
x1 = p1.X;
y1 = p1.Y;
x2 = IIf(Width>=2*Height,0.5*Height*Tan(PI/6), 0.15*Width);
x3 = IIf(Width>=2*Height, Height/4, 0.15*Width);
MoveTo(0, Height * 0.5);
LineTo(x1 , Height);
LineTo(x1, Height - y1);
LineTo(Width -x3 -x2 -x2, Height - y1);
LineTo(Width -x3 -x2, Height);
LineTo(Width, Height);
LineTo(Width * p2.X / 100, Height * p2.Y / 100);
LineTo(Width, 0);
LineTo(Width - x3 -x2, 0);
LineTo(Width -x3 -x2 -x2, y1);
LineTo(x1, y1);
LineTo(x1, 0);
LineTo(0, Height * 0.5);
";
diagram.DefaultShape = new Shape(arrow60deg, "", new List
{
new ShapeControlPoint("p1",
20, 0, -10, UnitType.Fixed,
20, 0, 100, UnitType.Fixed) { MaxXRelativeToWidth = true },
new ShapeControlPoint("p2",
80, 60, 100, UnitType.Percentage,
50, 50, -50, UnitType.Percentage) { MaxYRelativeToHeight = true }
}, "arrow60deg");
```
## Text Attributes and Formatting
### Text in Shape Nodes
A (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md) node can display (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#text) within its outlines. Text position and alignment depend on the value of (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#textalignment), (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#textpadding), (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#textwrapping) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#textverticalalignment). The text is painted with the color set in (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#textbrush). Even more useful layout and formatting attributes can be enabled through (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md#polygonaltextlayout) and (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md#enablestyledtext).
### Layout Text in Arbitrary Shapes
(Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md) instances can have various shapes, as specified by their (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md#shape) and (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md#shapeorientation) properties. To layout text inside non-rectangular shapes, enable (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md#polygonaltextlayout). If enabled, AvaloniaDiagram uses a formatting algorithm that fits exactly each line of text within the width of a line inside a polygonal shape. If a shape node has curved outlines, the formatting algorithm approximates them the poly-lines.
### Supplementary Node Labels
Apart from main text content, the (Markdown/T_MindFusion_Diagramming_Avalonia_NodeLabel.md) class lets you display additional labels and pin them to node's edges or corners. Call the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#addlabel) method to create such supplementary labels, and use (Markdown/T_MindFusion_Diagramming_Avalonia_NodeLabel.md) (and base (Markdown/T_MindFusion_Diagramming_Avalonia_ItemLabel.md)) properties and methods to customize their appearance and position.
### Text Wrapping
If there isn't enough space available to fit a whole line of text, AvaloniaDiagram wraps the text to a new line when it reaches the edge of the node. You can specify that the text should be wrapped only at word boundaries by setting (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#texttrimming) to Word. The default is to split words into multiple parts if there is not enough space to fit a whole word.
If you prefer to use your own line-breaks, you can disable the automatic text wrapping by setting (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#textwrapping) to None. If automatic wrapping is disabled and there isn't enough space to fit the whole line, the text is clipped at the node boundaries.
### Text in Tables
A (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md) can display text in its caption area and inside each cell. Text in the (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md#caption) is painted with (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#textbrush) and is aligned as specified by CaptionFormat. Text in cells is painted using their own (Markdown/T_MindFusion_Diagramming_Avalonia_TextPresenter.md#textbrush) and is aligned according to their own TextFormat. Even more useful formatting attributes can be enabled by (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md#enablestyledtext) property.
### Styled Text
The (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md#enablestyledtext) property of shape nodes and the (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md#enablestyledtext) property of tables enables or disables styled text rendering. Styled text can have various attributes applied to the characters it contains. The attributes are specified using HTML-like formatting tags embedded in the raw text. Shape nodes can display styled text only if (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md#polygonaltextlayout) is enabled. Use the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#drawstyledtext) method to display styled text in custom-drawn items.
The following table lists the currently supported style tags:
| **Tag
** | **Description
**
| text
| Indicates italic text.
| text
| Indicates bold text.
| text
| Indicates underlined text.
| text
| Indicates subscript.
| text
| Indicates superscript.
| text
| Changes the color of the text. The red green and blue color channels are specified as two-digit hexadecimal numbers.
### Link Labels
The (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#text) of a (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md) is painted with the color specified in (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#textbrush) and is positioned as set in (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#textstyle). Apart from main text content, the (Markdown/T_MindFusion_Diagramming_Avalonia_LinkLabel.md) class lets you display additional labels and pin them to link's points or segments. Call the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#addlabel) method to create such supplementary labels, and use (Markdown/T_MindFusion_Diagramming_Avalonia_LinkLabel.md) (and base (Markdown/T_MindFusion_Diagramming_Avalonia_ItemLabel.md)) properties and methods to customize their appearance and position. Labels can automatically avoid overlapping nodes or other labels when their (Markdown/T_MindFusion_Diagramming_Avalonia_LinkLabel.md#autoarrange) property is set.
### Fonts
All items provide (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#fontfamily), (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#fontsize), (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#fontstyle), (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#fontweight) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#fontstretch) properties that allows getting or setting the font attributes used for rendering the items' text.
## Initial Values of Item Properties
Each new item, created either by the user or programmatically, is initialized with some kind of default property values.
If you create items by using the new operator and adding them the diagram's (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#nodes) or (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#links) collection, you can initialize the items by passing a (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) reference to the respective constructor, or by passing another item to the copy constructor. In the former case, item properties are initialized from the default-property values defined in (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md). In the latter case, properties are copied from the prototype item.
When users draw new items, the items are initialized from the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) properties, but you can change the default values by handling the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#initializenode) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#initializelink) events.
Items created via the diagram's (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#factory) object are always initialized from the default-property values defined in (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md).
Below are listed item properties and the corresponding constants or (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) properties through which they are initialized:
| **DiagramItem Property
** | **Initialized With
**
| (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#brush)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#shapebrush)(Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#tablebrush)
(Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#linkbrush)
| Font
| Font
| (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#locked)
| false
| Pen
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#shapepen)
(Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#tablepen)(Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#linkpen)
| (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#selected)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#selectaftercreate)
| Tag
| null
| ToolTip
| (empty string)
| (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#visible)
| true
| **ShapeNode Property
** | **Initialized With
**
| (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md#customdraw)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#shapecustomdraw)
| (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#enabledhandles)
| (Markdown/T_MindFusion_Diagramming_Avalonia_AdjustmentHandles.md)
| (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#expandable)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#nodesexpandable)
|
(Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#handlesstyle)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#shapehandlesstyle)
| (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md#image)
| null
| (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md#imagealign)
| (Markdown/T_MindFusion_Diagramming_Avalonia_ImageAlign.md)
| Text
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#shapetext)
| TextColor
| TextColor
| TextFormat
| TextFormat
| (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md#transparent)
| false
| **ContainerNode Property
** | **Initialized With
**
| (Markdown/T_MindFusion_Diagramming_Avalonia_ContainerNode.md#autoshrink)
| false
| (Markdown/T_MindFusion_Diagramming_Avalonia_ContainerNode.md#caption)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#containercaption)
| (Markdown/T_MindFusion_Diagramming_Avalonia_ContainerNode.md#captionbrush)
| Black
| CaptionFormat
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#textformat)
| (Markdown/T_MindFusion_Diagramming_Avalonia_ContainerNode.md#captionheight)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#containercaptionheight)
| (Markdown/T_MindFusion_Diagramming_Avalonia_ContainerNode.md#foldable)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#containersfoldable)
| (Markdown/T_MindFusion_Diagramming_Avalonia_ContainerNode.md#folded)
| false
| (Markdown/T_MindFusion_Diagramming_Avalonia_ContainerNode.md#highlightpen)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#containerhighlightpen)
| (Markdown/T_MindFusion_Diagramming_Avalonia_ContainerNode.md#margin)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#containermargin)
| (Markdown/T_MindFusion_Diagramming_Avalonia_ContainerNode.md#minimumsize)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#containerminimumsize)
| **TableNode Property
** | **Initialized With
**
| (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md#caption)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#tablecaption)
| (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md#captionbrush)
| Color.FromArgb(0, 0, 0)
| CaptionFormat
| Centered horizontal and vertical alignment
| (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md#cellcustomdraw)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#cellcustomdraw)
| (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md#cellframestyle)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#cellframestyle)
| (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md#columnwidth)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#tablecolumnwidth)
| (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md#customdraw)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#tablecustomdraw)
| (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md#handlesstyle)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#tablehandlesstyle)
| (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md#image)
| null
| (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md#imagealign)
| (Markdown/T_MindFusion_Diagramming_Avalonia_ImageAlign.md)
| (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md#connectionstyle)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#tableconnectionstyle)
| (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md#rowheight)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#tablerowheight)
| (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md#scrollable)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#tablesscrollable)
| (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md#shape)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#tableshape)
| TextColor
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#textbrush)
| **DiagramLink Property
** | **Initialized With
**
| (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#baseshape)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#linkbaseshape)
| (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#baseshapesize)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#linkbaseshapesize)
| (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#headshape)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#linkheadshape)
| (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#headshapesize)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#linkheadshapesize)
| (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#autoroute)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#routelinks)
| (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#cascadeorientation)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#linkcascadeorientation)
| (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#customdraw)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#linkcustomdraw)
| (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#dynamic)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#dynamiclinks)
| (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#headpen)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#linkpen)
| (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#intermediateshape)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#linkintermediateshape)
| (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#intermediateshapesize)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#linkintermediateshapesize)
| (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#retainform)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#linksretainform)
| (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#segmentcount)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#linksegments)
| (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#shape)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#linkshape)
| Text
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#linktext)
| TextColor
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#textbrush)
| (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#textstyle)
| (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#linktextstyle)
## Miscellaneous
### Associate Custom Data with Items
You can associate custom values from any data type with diagram elements by setting their Tag and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#id) properties. If the associated data is of a value type or of type that is serializable (marked as and implementing the ISerializable interface), then it is saved and loaded together with the diagram items when a diagram is saved or loaded. The (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#findnode), (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#findlink), (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#findnodebyid) and (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#findlinkbyid) methods let you find diagram elements associated with a specific value.
### Inspecting Items Geometry
- The (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#intersects) method of DiagramLink lets you test if links intersect other links or nodes.
- The (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#length) method of the DiagramLink class returns the total length of a link.
- The (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#containspoint) method let you check if an item contains specified point.
### Fluent API
Extension methods in MindFusion.Diagramming.Avalonia.Fluent and MindFusion.Diagramming.Avalonia.Layout.Fluent namespaces let you initialize objects using fluent programming style:
```csharp
using MindFusion.Diagramming.Avalonia.Fluent;
using MindFusion.Diagramming.Avalonia.Layout.Fluent;
//...
diagram.Factory
.CreateShapeNode(20, 20, 60, 40)
.Brush(Colors.LightGray)
.Font("Arial", 12)
.EnableStyledText(true)
.Text("Task 1")
.ToolTip("This is the task")
.TextRotationAngle(15);
new TreeLayout()
.LevelDistance(20)
.NodeDistance(20)
.LinkStyle(TreeLayoutLinkType.Cascading3)
.Arrange(diagram);
```
## Tutorials
The tutorials in this section assume you have already added a (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) object to your WPF application as shown in the (#getting-started) topic. Visual Studio solutions that contain the full source code from the tutorials are available in the Samples folder under the AvaloniaDiagram installation folder.
## Tutorial 1: Loading Graph Data
This tutorial shows how to load graph data from XML and create diagram objects corresponding to the graph nodes and edges.
1. Right-click the project in Solution Explorer and choose Add -> New Item from the context menu. Create a new XML file called SampleGraph.xml and add to it content in the following form:
```
```
2. Set the file's "Build Action" property to "Content" and "Copy to Output Directory" to "Copy if newer".
3. Add a Loaded event handler to the WPF window:
```xaml
```
```csharp
private void OnWindowLoaded(object sender, RoutedEventArgs e)
{
}
```
4. Add the following variables to the Loaded handler. "nodeMap" maps diagram nodes to their identifiers, and "bounds" contains the default node size.
```csharp
var nodeMap = new Dictionary();
var bounds = new Rect(0, 0, 60, 22);
```
5. Load the XML document and its root element using the Linq for XML API:
```csharp
// load the graph xml
var xml = XDocument.Load("SampleGraph.xml");
var graph = xml.Element("Graph");
```
6. Load the graph node elements and create their corresponding (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md) objects by calling the (Markdown/T_MindFusion_Diagramming_Avalonia_Factory.md#createshapenode) method of the (Markdown/T_MindFusion_Diagramming_Avalonia_Factory.md) class. (Markdown/T_MindFusion_Diagramming_Avalonia_Factory.md#createshapenode) is just a shortcut to creating a (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md) instance using the "new" operator and adding it to the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#nodes) collection of the diagram. Additionally, this code maps the new node to the "id" attribute of the XML element, and sets the node's (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#text) to the value of the "name" attribute.
```csharp
// load node data
var nodes = xml.Descendants("Node");
foreach (var node in nodes)
{
var diagramNode = diagram.Factory.CreateShapeNode(bounds);
nodeMap = diagramNode;
diagramNode.Text = node.Attribute("name").Value;
}
```
7. Load the graph links and create corresponding (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md) objects. The (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#origin) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md#destination) of the links are accessed by their ids through the "nodeMap" dictionary.
```csharp
// load link data
var links = xml.Descendants("Link");
foreach (var link in links)
{
diagram.Factory.CreateDiagramLink(
nodeMap,
nodeMap);
}
```
8. Arrange the diagram using the (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_LayeredLayout.md) class.
```csharp
// arrange the graph
var layout = new LayeredLayout();
layout.Arrange(diagram);
```
9. Build and run the project. If everything is fine, you should see this representation of the graph:
## Tutorial 2: Loading Hierarchical Data
This tutorial shows how to load hierarchical data recursively from XML and create diagram items corresponding to the hierarchy.
1. Right-click the project in Solution Explorer and choose Add -> New Item from the context menu. Create a new XML file called SampleTree.xml and add to it content in the following form:
```
```
2. Set the file's "Build Action" property to "Content" and "Copy to Output Directory" to "Copy if newer".
3. Add a Loaded event handler to the WPF window:
```xaml
```
```csharp
private void OnWindowLoaded(object sender, RoutedEventArgs e)
{
}
```
4. Add the following member to the window class to hold the default node size.
```csharp
Rect nodeBounds = new Rect(0, 0, 100, 22);
```
5. Create the tree root node, and call the CreateChildren method, which builds the tree recursively.
```csharp
var root = diagram.Factory.CreateShapeNode(nodeBounds);
root.Text = "Project";
var document = XDocument.Load("SampleTree.xml");
CreateChildren(root, document.Element("Project"));
```
6. Define CreateChildren as follows. It takes as parameters the parent (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md) and parent XML element, iterates the child XML elements to build the next level of the hierarchy, and creates corresponding diagram items by calling (Markdown/T_MindFusion_Diagramming_Avalonia_Factory.md#createshapenode) and (Markdown/T_MindFusion_Diagramming_Avalonia_Factory.md#creatediagramlink).
```csharp
private void CreateChildren(DiagramNode parentDiagNode, XElement parentXmlElement)
{
foreach (var element in parentXmlElement.Elements("Activity"))
{
var node = diagram.Factory.CreateShapeNode(nodeBounds);
node.Text = element.Attribute("Name").Value;
diagram.Factory.CreateDiagramLink(parentDiagNode, node);
CreateChildren(node, element);
}
}
```
7. Use (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_TreeLayout.md) to arrange the diagram. Add the following code to the end of the Loaded handler.
```csharp
var layout = new TreeLayout();
layout.Type = TreeLayoutType.Cascading;
layout.Direction = TreeLayoutDirections.LeftToRight;
layout.LinkStyle = TreeLayoutLinkType.Cascading2;
layout.NodeDistance = 5;
layout.LevelDistance = -25; // let horizontal positions overlap
layout.Arrange(diagram);
```
8. Build and run the project. If everything is fine, you should see this representation of the hierarchy:
## Tutorial 3: Create a Custom Node Type
This tutorial shows how to define a custom node class that inherits (Markdown/T_MindFusion_Diagramming_Avalonia_TemplatedNode.md) and adds several new properties. Its appearance is defined using a WPF data template.
1. Right-click the project in Solution Explorer and choose Add -> New Item from the context menu. Create a new WPF Resource Dictionary file called generic.xaml and add the following control template to it. Note that (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#stroke), (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#brush) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#text) are properties of the base (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md) class. Image, Title and FullName are new properties defined in the custom class.
```xaml
```
2. Add to the project a new class called OrgChartNode. Make it derive from (Markdown/T_MindFusion_Diagramming_Avalonia_TemplatedNode.md).
```csharp
using System.Windows;
using System.Windows.Media;
using MindFusion.Diagramming.Avalonia;
namespace Tutorial3
{
public class OrgChartNode : TemplatedNode
{
}
}
```
3. Add a static constructor that overrides the DefaultStyleKey metadata to associate the node class with the data template defined in the resource dictionary. Note that "OrgChartNode" is set as TargetType for both the Style and DataTemplate elements in the Xaml.
```csharp
static OrgChartNode()
{
DefaultStyleKeyProperty.OverrideMetadata(
typeof(OrgChartNode), new FrameworkPropertyMetadata(typeof(OrgChartNode)));
}
```
4. Define the custom Title, FullName and Image dependency properties.
```csharp
public string Title
{
get { return (string)GetValue(TitleProperty); }
set { SetValue(TitleProperty, value); }
}
public static readonly DependencyProperty TitleProperty = DependencyProperty.Register(
"Title",
typeof(string),
typeof(OrgChartNode),
new PropertyMetadata(""));
public string FullName
{
get { return (string)GetValue(FullNameProperty); }
set { SetValue(FullNameProperty, value); }
}
public static readonly DependencyProperty FullNameProperty = DependencyProperty.Register(
"FullName",
typeof(string),
typeof(OrgChartNode),
new PropertyMetadata(""));
public ImageSource Image
{
get { return (ImageSource)GetValue(ImageProperty); }
set { SetValue(ImageProperty, value); }
}
public static readonly DependencyProperty ImageProperty = DependencyProperty.Register(
"Image",
typeof(ImageSource),
typeof(OrgChartNode),
new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender));
```
5. Add a Loaded event handler to the WPF window.
```xaml
```
```csharp
private void OnWindowLoaded(object sender, RoutedEventArgs e)
{
}
```
6. Add a few instances of the OrgChartNode class.
```csharp
var node1 = new OrgChartNode
{
Bounds = new Rect(100, 60, 240, 100),
Title = "CEO",
FullName = "John Smith",
Text = "Our beloved leader. \r\n" +
"The CEO of this great corporation.",
Image = new BitmapImage(
new Uri("016.png", UriKind.Relative))
};
diagram.Nodes.Add(node1);
var node2 = new OrgChartNode
{
Bounds = new Rect(220, 220, 240, 100),
Title = "CIO",
FullName = "Bob Smith",
Text = "The CIO of this great corporation.",
Image = new BitmapImage(
new Uri("ac0026-64.png", UriKind.Relative))
};
diagram.Nodes.Add(node2);
diagram.Factory.CreateDiagramLink(node1, node2);
```
7. Build and run the project. You should see the custom nodes rendered like this:
## Tutorial 4: Custom Nodes Integration
This tutorial builds upon the OrgChartNode type from (#tutorial-3-create-a-custom-node-type). It shows how to fully integrate the custom type with other AvaloniaDiagram features, such as serialization, undo support, creating nodes by drag-and-drop or drawing with the mouse on the canvas.
1. Add a NodeListView to the page and add a few OrgChartNode objects as its children:
```xaml
```
2. Add a copy constructor to the OrgChartNode class. The control throws an exception if you try to create via drag-and-drop an instance of a class without copy constructor:
```csharp
// Required for creating nodes by dragging them from the NodeListView
public OrgChartNode(OrgChartNode prototype) : base(prototype)
{
Title = prototype.Title;
FullName = prototype.FullName;
Image = prototype.Image;
}
```
3. In order to enable drawing OrgChartNodes with the mouse, inherit the LinkNodesBehavior and override its CreateNode method. You could also inherit (Markdown/T_MindFusion_Diagramming_Avalonia_Behaviors_BehaviorBase.md) or any of its derived classes, and override either CreateNode or (Markdown/T_MindFusion_Diagramming_Avalonia_Behaviors_BehaviorBase.md#startdraw):
```csharp
public class OrgChartBehavior : LinkNodesBehavior
{
public OrgChartBehavior(Diagram diagram) : base(diagram) { }
protected override DiagramNode CreateNode()
{
return new OrgChartNode();
}
}
```
4. Assign an instance of the behavior class to the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#custombehavior) property of the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md) class:
```csharp
private void Window_Loaded(object sender, RoutedEventArgs e)
{
// enable drawing OrgChartNodes with the mouse
diagramView.CustomBehavior = new OrgChartBehavior(diagram);
}
```
5. To implement serialization of any new properties added by a custom item class, override the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#savetoxml) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#loadfromxml) methods of the base (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md) class:
```csharp
// serialization support for custom properties
protected override void SaveToXml(XmlElement xmlElement, XmlPersistContext context)
{
base.SaveToXml(xmlElement, context);
context.WriteString(Title, "Title", xmlElement);
context.WriteString(FullName, "FullName", xmlElement);
context.WriteImage(Image, "Image", xmlElement);
}
protected override void LoadFromXml(XmlElement xmlElement, XmlPersistContext context)
{
base.LoadFromXml(xmlElement, context);
Title = context.ReadString("Title", xmlElement);
FullName = context.ReadString("FullName", xmlElement);
Image = context.ReadImage("Image", xmlElement);
}
```
6. Call the static (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#registeritemclass) method to assign an XML element name to the custom item type:
```csharp
private void Window_Loaded(object sender, RoutedEventArgs e)
{
// enable serialization of the custom class
Diagram.RegisterItemClass(typeof(OrgChartNode), "my:OrgChartNode", 1);
// enable drawing OrgChartNodes with the mouse
diagram.CustomBehavior = new OrgChartBehavior(diagram);
}
```
7. In order to enable undo / redo of changes done on OrgChartNode, create a (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItemProperties.md) -derived class that contains member corresponding to the additional properties defined by OrgChartNode:
```csharp
public class OrgChartNodeProperties : DiagramNodeProperties
{
internal string Title;
internal string FullName;
internal ImageSource Image;
}
```
8. Override the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#createproperties), (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#saveproperties) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#restoreproperties) methods:
```csharp
// undo and redo support
protected override DiagramItemProperties CreateProperties()
{
return new OrgChartNodeProperties();
}
protected override void SaveProperties(DiagramItemProperties props)
{
base.SaveProperties(props);
var state = (OrgChartNodeProperties)props;
state.Title = Title;
state.FullName = FullName;
state.Image = Image;
}
protected override void RestoreProperties(DiagramItemProperties props)
{
base.RestoreProperties(props);
var state = (OrgChartNodeProperties)props;
Title = state.Title;
FullName = state.FullName;
Image = state.Image;
}
```
9. The full source code for this tutorial with several additional UI controls that invoke serialization and undo methods is available in the Samples\CSharp\Tutorial4 subfolder under the AvaloniaDiagram installation folder.
## Reference
## Table of Predefined Shapes
| **Shape
** | **Identifier
** | **Common Uses
**
|
| Actor
| A user
An actor in use case model
|
| Alternative
| An alternative in SDL
An extraction in flowcharts
Storage in quality management
|
| Arrow1
| Use as desired
|
| Arrow2
| Use as desired
|
| Arrow3
| Transportation in quality management
A reference point
|
| Arrow4
| Use as desired
|
| Arrow5
| Use as desired
|
| Arrow6
| Use as desired
|
| Arrow7
| A signal
Electronic transmission of data
|
| Arrow8
| Use as desired
|
| Arrow9
| Use as desired
|
| BeginLoop
| Begin of a loop
|
| BpmnComplex
| BPMN Gateways: Complex Decision/Merge
|
| BpmnDataBasedXor
| BPMN Gateways: Data-Based Exclusive Decision/Merge (XOR)
|
| BpmnEndCancel
| BPMN Events: Cancel (End)
|
| BpmnEndCompensation
| BPMN Events: Compensation (End)
|
| BpmnEndError
| BPMN Events: Error (End)
|
| BpmnEndLink
| BPMN Events: Link (End)
|
| BpmnEndMessage
| BPMN Events: Message (End)
|
| BpmnEndMultiple
| BPMN Events: Multiple (End)
|
| BpmnEndTerminate
| BPMN Events: Terminate (End)
|
| BpmnEventBasedXor
| BPMN Gateways: Event-Based Exclusive Decision/Merge (XOR)
|
| BpmnInclusive
| BPMN Gateways: Inclusive Decision/Merge (OR)
|
| BpmnIntermediateCancel
| BPMN Events: Cancel (Intermediate)
|
| BpmnIntermediateCompensation
| BPMN Events: Compensation (Intermediate)
|
| BpmnIntermediateError
| BPMN Events: Error (Intermediate)
|
| BpmnIntermediateLink
| BPMN Events: Link (Intermediate)
|
| BpmnIntermediateMessage
| BPMN Events: Message (Intermediate)
|
| BpmnIntermediateMultiple
| BPMN Events: Multiple (Intermediate)
|
| BpmnIntermediateRule
| BPMN Events: Rule (Intermediate)
|
| BpmnIntermediateTimer
| BPMN Events: Timer (Intermediate)
|
| BpmnParallelFork
| BPMN Gateways: Parallel Fork/Join (AND)
|
| BpmnStartLink
| BPMN Events: Link (Start)
|
| BpmnStartMessage
| BPMN Events: Message (Start)
|
| BpmnStartMultiple
| BPMN Events: Multiple (Start)
|
| BpmnStartRule
| BPMN Events: Rule (Start)
|
| BpmnStartTimer
| BPMN Events: Timer (Start)
|
| Cloud
| Object instance in data flow diagrams
|
| Collate
| A collation in flowcharts
|
| ConeDown
| Use as desired
|
| ConeUp
| Use as desired
|
| ConnectedIssues
| Connected issues in quality management
|
| CreateRequest
| Request to create in SDL
|
| Cross
| Use as desired
|
| Cube
| Use as desired
|
| Cylinder
| Use as desired
|
| Database
| A database in flowcharts
|
| DataTransmition
| Electronic transmission of data
|
| DDelay
| Use as desired
|
| Decagon
| Use as desired
|
| Decision
| Decision in flowcharts
A comparison in flowcharts
Relationship in data flow diagrams
|
| Decision2
| A decision in SDL
|
| Delay
| A delay in process diagrams
|
| DInDelay
| Use as desired
|
| DirectAccessStorage
| A direct access storage
|
| DiskStorage
| Data stored on disk in flowcharts
|
| Display
| Data that is displayed for human use
|
| DividedEvent
| An event
|
| DividedProcess
| A process or document in flowcharts
Entity in data flow diagrams
|
| Document
| A document
|
| Donut
| Use as desired
|
| DOutDelay
| Use as desired
|
| Ellipse
| A cross-reference within the same page of a flowchart
Process in data flow diagrams
State in data flow diagrams
A continuation of the flowchart in SDL
An use case
Operation in quality management
|
| EndLoop
| End of a loop
|
| ExternalOrganization
| An external organization
|
| ExternalProcess
| An external process
|
| File
| A file
|
| FramedRectangle
| Use as desired
|
| Gate
| A gateway
|
| Heart
| Use as desired
|
| Heptagon
| Use as desired
|
| Hourglass
| Use as desired
|
| Input
| Data that is input by manual means
|
| InternalStorage
| An internal storage
|
| Interrupt
| An interrupt
|
| Interrupt2
| An interrupt
|
| IsoProcess
| Iso9000 process
|
| Junction
| A summing junction
A return in SDL
|
| Lightning
| Use as desired
|
| LinedDocument
| A document in flowcharts
|
| ManualOperation
| Operation performed by a human
|
| Merge
| A merger in flowcharts
Inbound goods in quality management
Non-electronic file
Stop state in data flow diagrams
|
| MessageFromUser
| A message from user side in SDL
|
| MessageToUser
| A message to user side in SDL
|
| Microform
| A microform
|
| MicroformProcessing
| A microform processing
|
| MicroformRecording
| A microform recording
|
| MultiDocument
| A multiple document in flowcharts
|
| MultiProc
| A multiple process or document in flowcharts
|
| Octagon
| Use as desired
|
| OfflineStorage
| An offline storage
|
| OffpageConnection
| A cross-reference to another page of a flowchart
|
| OffpageReference
| A cross-reference to another page of a flowchart
A foreign module
|
| Or
| An 'or' statement
|
| Pentagon
| Use as desired
|
| Plaque
| Use as desired
|
| PrimitiveFromCall
| A primitive from call control in SDL
|
| PrimitiveToCall
| A primitive to call control in SDL
|
| Procedure
| Procedure in SDL
|
| Process
| A process or document in flowcharts
A file or data storage
|
| Prysm
| Use as desired
|
| PunchedCard
| A punched card
|
| PyramidDown
| Use as desired
|
| PyramidUp
| Use as desired
|
| Rectangle
| A metric operation
'External interactor' in data flow diagrams
Inspection in quality management
|
| RightTriangle
| Use as desired
|
| RoundRect
| A process or item in flowcharts
An event
An issue in quality management
|
| RSave
| Input or output data in flowcharts
|
| Save
| A save in SDL
Input or output data in flowcharts
|
| Sort
| A sort operation
|
| Sphere
| Use as desired
|
| Star
| Use as desired
|
| Star4Pointed
| Use as desired
|
| Star5Pointed
| Use as desired
|
| Star6Pointed
| Use as desired
|
| Star7Pointed
| Use as desired
|
| Star16Pointed
| Use as desired
|
| Star24Pointed
| Use as desired
|
| Star32Pointed
| Use as desired
|
| Start
| Start of a program flow
A starting point in SDL
|
| Tape
| Sequentially accessible data
|
| Terminator
| Start or end of a program flow
|
| TransmittalTape
| A transmittal tape
|
| Trapezoid
| Use as desired
## Online Resources
### Video Tutorials
- How to set up the WPF diagram control
- Create a custom diagram shape
### Blog Posts
- PERT network charts in WPF
- Combine layout algorithms I (use OrthogonalLayout to generate initial placement for SpringLayout)
- Combine layout algorithms II (apply TreeLayout twice to arrange a genealogy tree)
- Combine layout algorithms III (apply FractalLayout and SpringLayout to generate a tag cloud)
- Create a dialogue editor using MindFusion diagram
- Display Petri nets using MindFusion diagram component
- Create diagram connectors using drag and drop
- Visualize graph algorithms using MindFusion diagram component
- Database schema diagram
- ContainerNode fold / unfold animations
- Create a musical score writer using MindFusion diagram component
## Technical Support
Detailed information about everything connected with software products offered by MindFusion - online documentation, demos, information about forthcoming products can be found at https://mindfusion.dev/. The site is updated every day, so make sure you visit it regularly to catch up with the newest from us.
Apart from that, MindFusion employs a dedicated and technically proficient support team. This guarantees that all your questions and inquiries will be answered in quick and professional manner. They can be reached by e-mail at mailto:support@mindfusion.eu or by phone at +359 889 199 729.
You can post a question on the AvaloniaDiagram discussion board here:
https://mindfusion.dev/Forum/YaBB.pl?board=wpfdg_disc
or visit our help desk site:
https://mindfusion.dev/HelpDesk/index.php
We will be happy to hear any suggestions and recommendations you might have regarding AvaloniaDiagram. We do take in account the opinion of every single person who has shown interest in our products.
## MindFusion Products
MindFusion offers various programming components for different platforms. Below is a list of our products with links to their sections on our website as well link to download a trial version. Clients that have already purchased a product use an increasing discount for each subsequent one.
| **Diagramming
** | **Links
**
| Diagramming for WPF
| Product Information
Download
| Diagramming for WinForms
| Product Information
Download
| Diagramming for Java Swing
| Product Information
Download
| Diagramming for JavaScript
| Product Information
Download
| Diagramming for ASP.NET
| Product Information
Download
| Diagramming for ASP.NET MVC
| Product Information
Download
| Diagramming for Xamarin
| Product Information
Download
| Diagramming for UWP
| Product Information
Download
| Diagramming for Android
| Product Information
Download
| DiagramViewer for iOS/Cocoa Touch
| Product Information
Download
| Diagramming for ActiveX
| Product Information
Download
| Diagramming for Silverlight
| Product Information
Download
| **Charting
** | **Links
**
| Charting for WPF
| Product Information
Download
| Charting for WinForms
| Product Information
Download
| Charting for Java Swing
| Product Information
Download
| Charting for JavaScript
| Product Information
Download
| Charting for ASP.NET
| Product Information
Download
| Charting for Xamarin
| Product Information
Download
| Charting for Android
| Product Information
Download
| Charting for Silverlight
| Product Information
Download
| **Scheduling
** | **Links
**
| Scheduling for WPF
| Product Information
Download
| Scheduling for WinForms
| Product Information
Download
| Scheduling for Java Swing
| Product Information
Download
| Scheduling for JavaScript
| Product Information
Download
| Scheduling for ASP.NET
| Product Information
Download
| Scheduling for Xamarin
| Product Information
Download
| Scheduling for Silverlight
| Product Information
Download
| **Spreadsheet
** | **Links
**
| Spreadsheet for WPF
| Product Information
Download
| Spreadsheet for WinForms
| Product Information
Download
| Spreadsheet for Java Swing
| Product Information
Download
| **Reporting
** | **Links
**
| Reporting for WPF
| Product Information
Download
| Reporting for WinForms
| Product Information
Download
| Reporting for Silverlight
| Product Information
Download
| **Virtual Keyboard
** | **Links
**
| Virtual Keyboard for WPF
| Product Information
Download
| Virtual Keyboard for WinForms
| Product Information
Download
| Virtual Keyboard for Java Swing
| Product Information
Download
| Virtual Keyboard for JavaScript
| Product Information
Download
| **Mapping
** | **Links
**
| Mapping for WPF
| Product Information
Download
| Mapping for WinForms
| Product Information
Download
| Mapping for ASP.NET
| Product Information
Download
| Mapping for Silverlight
| Product Information
Download
| **Suites
** | **Links
**
| Pack for WPF
| Product Information
Download
| Pack for WinForms
| Product Information
Download
| Pack for Java Swing
| Product Information
Download
| Pack for JavaScript
| Product Information
Download
| Pack for ASP.NET
| Product Information
Download
| Pack for Xamarin
| Product Information
Download
| Pack for Silverlight
| Product Information
Download
| Pack for Diagramming
| Product Information
Download
| Pack for Scheduling
| Product Information
Download
# Section 2: API Class Reference
The following are links to the consolidated class reference guides. Each file contains all constructors, fields, properties, methods, and events for that class.
### Namespace MindFusion
- [Utilities Class](Markdown/T_MindFusion_Utilities.md): Contains common helper methods.
### Namespace MindFusion.Animations
- [Animation Class](Markdown/T_MindFusion_Animations_Animation_1.md): Represents an object that is used to animate items.
- [AnimationOptions Class](Markdown/T_MindFusion_Animations_AnimationOptions_0.md): An object used to specify various property values for an Animation.
- [AnimationType Enumeration](Markdown/T_MindFusion_Animations_AnimationType_1.md): Specifies the animation function used by an Animation object.
- [CustomFunctionCallback Delegate](Markdown/T_MindFusion_Animations_CustomFunctionCallback_0.md): A callback function called when the animation type is set to Custom, responsible to provide the animation update function.
- [EasingType Enumeration](Markdown/T_MindFusion_Animations_EasingType_1.md): Specifies the easing applied to an animation.
- [IAnimationItem Interface](Markdown/T_MindFusion_Animations_IAnimationItem_0.md): Represents an item that can be animated by an Animation.
- [UpdateCallback Delegate](Markdown/T_MindFusion_Animations_UpdateCallback_0.md): A callback function called on every animation tick, responsible for updating animated objects according to current animation progress.
### Namespace MindFusion.Common.Avalonia
- [DashStyles Class](Markdown/T_MindFusion_Common_Avalonia_DashStyles.md):
- [GraphicsUnit Class](Markdown/T_MindFusion_Diagramming_Avalonia_GraphicsUnit.md): Specifies units of measure for a particular data.
- [HatchBrush Class](Markdown/T_MindFusion_Diagramming_Avalonia_HatchBrush.md): Emulates GDI+ hatch brushes using the WPF ImageBrush class.
- [HatchStyle Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_HatchStyle.md): Represents hatch patterns corresponding to GDI+ HatchBrush objects.
- [Point3D Structure](Markdown/T_MindFusion_Common_Avalonia_Point3D.md):
### Namespace MindFusion.Diagramming.Avalonia
- [Action Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_Action.md): Specifies the possible actions a user can carry out on diagram items.
- [AdjustmentHandle Class](Markdown/T_MindFusion_Diagramming_Avalonia_AdjustmentHandle.md): Represents an adjustment handle used to move or modify diagram items.
- [AdjustmentHandles Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_AdjustmentHandles.md): Identifies the distinct selection handles of a node.
- [AdornerVisual Class](Markdown/T_MindFusion_Diagramming_Avalonia_AdornerVisual.md): Visual that contains the adjustment handles for a diagram item. It is separate from (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md) so that the adjustment handles do not interfere with ...
- [AeroEffect Class](Markdown/T_MindFusion_Diagramming_Avalonia_AeroEffect.md): Represents an effect that adds semitransparency to the node and emphasizes its outline by adding a shade and an inner stroke.
- [Alignment Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_Alignment.md): Generalized alignment enum.
- [Anchoring Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_Anchoring.md): Defines values that specify how automatic layout algorithms align links to anchor points.
- [AnchorPattern Class](Markdown/T_MindFusion_Diagramming_Avalonia_AnchorPattern.md): Represents a set of anchor points, which specify the exact locations where links are allowed to connect to nodes.
- [AnchorPoint Class](Markdown/T_MindFusion_Diagramming_Avalonia_AnchorPoint.md): Specifies the locations in a node, to which the user is allowed to connect links.
- [AnchorPointCollection Class](Markdown/T_MindFusion_Diagramming_Avalonia_AnchorPointCollection.md): Represents a strongly typed collection of anchor points.
- [AnchorPointEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_AnchorPointEventArgs.md): Contains the arguments passed to the anchor point-related events, such as (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#originanchorchanged) and (Markdown/T_MindFusion_Diagramming_Aval...
- [ArcTemplate Class](Markdown/T_MindFusion_Diagramming_Avalonia_ArcTemplate.md): Represents an arc in a shape definition.
- [AreaEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_AreaEventArgs.md): Contains arguments passed to handlers of the (Markdown/T_MindFusion_Diagramming_Avalonia_HtmlBuilder.md#creatingarea) event of the (Markdown/T_MindFusion_Diagramming_Avalonia_HtmlBuilder.md) class.
- [ArrowHeads Class](Markdown/T_MindFusion_Diagramming_Avalonia_ArrowHeads.md): Contains predefined arrowhead shapes.
- [AttachTo Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_AttachTo.md): Specifies the type of attachment in a group.
- [AttachToLink Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_AttachToLink.md): Specifies the possible ways to attach a node to a link.
- [AttachToNode Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_AttachToNode.md): Defines values specifying the possible ways to attach a node to another node.
- [AutoJson Class](Markdown/T_MindFusion_Diagramming_Avalonia_AutoJson.md): Apply the AutoJson attribute to a property of a CompositeNode-derived class to indicate that it should be included in JSON serialization.
- [AutoResize Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_AutoResize.md): Defines in which directions automatic resizing can enlarge the diagram scrollable area.
- [Behavior Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_Behavior.md): Defines values that specify how the component responds to actions performed by the user.
- [BezierTemplate Class](Markdown/T_MindFusion_Diagramming_Avalonia_BezierTemplate.md): Represents a Bezier curve in a shape definition.
- [CameraType Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_CameraType.md): Specifies the type of camera projection.
- [CellEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_CellEventArgs.md): Contains the arguments passed to event handlers, such as (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#cellclicked).
- [CellFrameStyle Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_CellFrameStyle.md): Specifies the style of the cells' frame lines.
- [CellValidationEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_CellValidationEventArgs.md): Contains the arguments passed to event handlers, such as (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#celltextediting).
- [CollectionBase(T) Class](Markdown/T_MindFusion_Diagramming_Avalonia_CollectionBase.md): An implementation of the IList interface.
- [ColumnStyle Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_ColumnStyle.md): Specifies how table columns' width is set.
- [CommandHistory Class](Markdown/T_MindFusion_Diagramming_Avalonia_CommandHistory.md): Maintains a queue of (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md) records used to undo or redo actions.
- [CompositeRouter Class](Markdown/T_MindFusion_Diagramming_Avalonia_CompositeRouter.md): Implements a chain of link routers (objects implementing (Markdown/T_MindFusion_Diagramming_Avalonia_ILinkRouter.md) interface) so that a link passes through the sequence until it gets routed succe...
- [ConnectionPoint Class](Markdown/T_MindFusion_Diagramming_Avalonia_ConnectionPoint.md): This class represents a connection between an edge and a node in a graph. It decouples the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md) class from the (Markdown/T_MindFusion_Diagramm...
- [Constants Class](Markdown/T_MindFusion_Diagramming_Avalonia_Constants.md): Contains various global constants, also provides measure unit independent constants.
- [ContainerChildEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_ContainerChildEventArgs.md): Contains arguments passed to ContainerChildEventHandler,
- [ContainerNode Class](Markdown/T_MindFusion_Diagramming_Avalonia_ContainerNode.md): Implements nodes that can contain other nodes.
- [ContainerNodeProperties Class](Markdown/T_MindFusion_Diagramming_Avalonia_ContainerNodeProperties.md): Stores the values of (Markdown/T_MindFusion_Diagramming_Avalonia_ContainerNode.md) properties during undo / redo operations. If you need to implement undo support for the additional properties defi...
- [ContainerPage Class](Markdown/T_MindFusion_Diagramming_Avalonia_ContainerPage.md): Represents a page in a PagedContainerNode.
- [ContainerPresenter Class](Markdown/T_MindFusion_Diagramming_Avalonia_ContainerPresenter.md): Renders the contents of a (Markdown/T_MindFusion_Diagramming_Avalonia_ContainerNode.md) in specified viewport.
- [ContainerValidation Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_ContainerValidation.md): Validation values for container adding/removing events.
- [ContainmentKeys Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_ContainmentKeys.md): For internal use.
- [ControlMouseAction Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_ControlMouseAction.md): Specifies available ways to handle mouse clicks on .NET controls hosted in a ControlNode.
- [ControlNode Class](Markdown/T_MindFusion_Diagramming_Avalonia_ControlNode.md): (Markdown/T_MindFusion_Diagramming_Avalonia_ControlNode.md) is an adapter class that allows using any WPF control as a diagram node.
- [ControlNodeEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_ControlNodeEventArgs.md): Contains the arguments passes to handlers of the control host serialization events.
- [ControlPointEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_ControlPointEventArgs.md): Contains arguments passed to handlers of the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#shapemodified) event.
- [Converter Class](Markdown/T_MindFusion_Diagramming_Avalonia_Converter.md): Provides capabilities to convert various types to and from strings in a culture-independent way.
- [CopyHostedControlEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_CopyHostedControlEventArgs.md): Contains the arguments passes to the CopyHostedControl event handlers.
- [CreateImageCallback Delegate](Markdown/T_MindFusion_Diagramming_Avalonia_CreateImageCallback.md): Loads an image from a stream.
- [CreatePathDelegate Delegate](Markdown/T_MindFusion_Diagramming_Avalonia_CreatePathDelegate.md): Specifies the signature of callback functions used to generate dynamic node shapes.
- [CursorHint Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_CursorHint.md): Specifies what mouse cursor to display while a user interacts with the diagram.
- [CustomCursors Class](Markdown/T_MindFusion_Diagramming_Avalonia_CustomCursors.md): Provides a collection of cursor object to use with the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) control.
- [CustomDraw Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_CustomDraw.md): Specifies what kind of custom painting to perform on diagram elements.
- [DelKeyAction Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_DelKeyAction.md): Specifies the type of action performed when the user presses the DEL key.
- [DevFlags Class](Markdown/T_MindFusion_Diagramming_Avalonia_DevFlags.md): For internal use.
- [Diagram Class](Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md): Represents a flow diagram.
- [DiagramBase Class](Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md): The base class of the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramDocument.md) classes.
- [DiagramBookmark Class](Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBookmark.md): Represents a saved logical area of interest or landmark zone within a diagram.
- [DiagramDocument Class](Markdown/T_MindFusion_Diagramming_Avalonia_DiagramDocument.md): Represents a collection of diagram pages.
- [DiagramDocumentPaginator Class](Markdown/T_MindFusion_Diagramming_Avalonia_DiagramDocumentPaginator.md): Implements pagination of a DiagramDocument object.
- [DiagramEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_DiagramEventArgs.md): Contains the arguments passed to event handlers, such as Clicked and DoubleClicked.
- [DiagramItem Class](Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md): Represents an item in the diagram document. All classes representing diagram elements derive from (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md).
- [DiagramItemCollection Class](Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItemCollection.md): Represents a strongly typed collection of (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md) objects.
- [DiagramItemProperties Class](Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItemProperties.md): The base class for classes that store diagram item properties during undo / redo operations.
- [DiagramItemState Class](Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItemState.md): Contains a snapshot of the internal state of a diagram item. Instances of this class are used to store the state of items for later undo or redo operations.
- [DiagramLink Class](Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md): Represents a link between two diagram nodes.
- [DiagramLinkCollection Class](Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLinkCollection.md): Represents a strongly typed collection of (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md) objects.
- [DiagramLinkProperties Class](Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLinkProperties.md): Stores the values of DiagramLink properties during undo / redo operations. If you need to implement undo support for the additional properties defined by a class derived from DiagramLink, do so by ...
- [DiagramLinkState Class](Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLinkState.md): Contains a snapshot of the internal state of a DiagramLink. Instances of this class are used to store the state of links for later undo or redo operations. If you derive from DiagramLink and need t...
- [DiagramNode Class](Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md): Represents a diagram node.
- [DiagramNodeCollection Class](Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNodeCollection.md): Represents a strongly typed collection of diagram nodes.
- [DiagramNodeProperties Class](Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNodeProperties.md): The base class for classes that store the properties for a (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md)-derived items during undo / redo operations.
- [DiagramNodeState Class](Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNodeState.md): Contains a snapshot of the internal state of a (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md). Instances of this class are used to store the state of nodes for later undo or redo opera...
- [DiagramPage Class](Markdown/T_MindFusion_Diagramming_Avalonia_DiagramPage.md): Represents a single page in a (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramDocument.md) object.
- [DiagramPageEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_DiagramPageEventArgs.md): Contains the arguments passed to (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramPage.md)-related event handlers.
- [DiagramPageValidationEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_DiagramPageValidationEventArgs.md): Contains the arguments passed to handlers of (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramPage.md) validation events.
- [DiagramPaginator Class](Markdown/T_MindFusion_Diagramming_Avalonia_DiagramPaginator.md): Implements pagination of a Diagram document.
- [DiagramPresenter Class](Markdown/T_MindFusion_Diagramming_Avalonia_DiagramPresenter.md): Renders the contents of a Diagram in specified viewport.
- [DiagramTabControl Class](Markdown/T_MindFusion_Diagramming_Avalonia_DiagramTabControl.md): Represents a TabControl that displays (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramTabItem.md) items.
- [DiagramTabItem Class](Markdown/T_MindFusion_Diagramming_Avalonia_DiagramTabItem.md): Represents a tab item in a (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramTabControl.md).
- [DiagramView Class](Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md): A WPF control that displays the content of a (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) object.
- [DirectionConstraint Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_DirectionConstraint.md): Defines values that specify in what direction to constrain node movement.
- [DoubleToRectConverter Class](Markdown/T_MindFusion_Diagramming_Avalonia_DoubleToRectConverter.md): Converts double values to Rect structures.
- [DraggedItem Class](Markdown/T_MindFusion_Diagramming_Avalonia_DraggedNode.md): Class used to hold the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md) instance during drag and drop. It is used for easier detection of the dragged content as DragEventArgs.Data.GetDat...
- [DraggedShape Class](Markdown/T_MindFusion_Diagramming_Avalonia_DraggedShape.md): Contains drag-and-drop information for a shape being dragged from ShapeToolBar and ShapeListBox.
- [DrawAnchorPointEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_DrawAnchorPointEventArgs.md): Contains the arguments passed to the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#drawanchorpoint) event handlers.
- [DrawCellEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_DrawCellEventArgs.md): Contains the arguments passed to the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#drawcell) event handlers.
- [DrawItemEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_DrawItemEventArgs.md): Contains the arguments passed to the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#drawadjustmenthandles) event handlers.
- [DrawLinkEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_DrawLinkEventArgs.md): Contains the arguments passed to the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#drawlink) event handlers.
- [DrawNodeEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_DrawNodeEventArgs.md): Contains the arguments passed to the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#drawnode) event handlers.
- [DummyNode Class](Markdown/T_MindFusion_Diagramming_Avalonia_DummyNode.md): Represents virtual nodes used for disconnected links.
- [EditCellTextEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_EditCellTextEventArgs.md): Contains the arguments passed to the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#celltextedited) event handlers.
- [EditLinkTextEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_EditLinkTextEventArgs.md): Contains the arguments passed to the EditLinkTextEventArgs event handlers.
- [EditNodeTextEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_EditNodeTextEventArgs.md): Contains the arguments passed to the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#nodetextedited) event handlers.
- [ElementTemplate Class](Markdown/T_MindFusion_Diagramming_Avalonia_ElementTemplate.md): Represents an element of a shape definition. This is the parent class of specific element types, such as (Markdown/T_MindFusion_Diagramming_Avalonia_ArcTemplate.md), (Markdown/T_MindFusion_Diagramm...
- [ExpandButtonAction Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_ExpandButtonAction.md): Specifies what action is triggered by the +/- buttons that are displayed near expandable nodes.
- [ExpandButtonPosition Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_ExpandButtonPosition.md): Defines values that specify possible locations for expand/collapse buttons.
- [ExpandIconRenderer Class](Markdown/T_MindFusion_Diagramming_Avalonia_ExpandIconRenderer.md): Draws expand and collapse buttons of Expandable nodes.
- [Extensions Class](Markdown/T_MindFusion_Diagramming_Avalonia_Extensions.md):
- [Factory Class](Markdown/T_MindFusion_Diagramming_Avalonia_Factory.md): Provides shortcut methods for creating and adding instances of the standard AvaloniaDiagram item types. Call the class methods through the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#fac...
- [FitSize Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_FitSize.md): Specifies how the (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md#resizetofittext) method should resize a node.
- [FoldIconRenderer Class](Markdown/T_MindFusion_Diagramming_Avalonia_FoldIconRenderer.md): Draws fold and unfold buttons in ContainerNode caption bar.
- [Font Class](Markdown/T_MindFusion_Diagramming_Avalonia_Font.md): Replacement for System.Drawing.Font that does not reference System.Drawing.dll
- [FreeFormHandle Class](Markdown/T_MindFusion_Diagramming_Avalonia_FreeFormHandle.md): Represents an adjustment handle used to modify the outline of a (Markdown/T_MindFusion_Diagramming_Avalonia_FreeFormNode.md).
- [FreeFormNode Class](Markdown/T_MindFusion_Diagramming_Avalonia_FreeFormNode.md): A (Markdown/T_MindFusion_Diagramming_Avalonia_FreeFormNode.md) collects all points from users' mouse or touch input and displays them as node's outline.
- [GetManipulatorRect Delegate](Markdown/T_MindFusion_Diagramming_Avalonia_GetManipulatorRect.md): Returns the manipulator position for a given node.
- [GlassEffect Class](Markdown/T_MindFusion_Diagramming_Avalonia_GlassEffect.md): Represents a glass-like visual effect.
- [GlassEffectType Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_GlassEffectType.md): Specifies the type of a (Markdown/T_MindFusion_Diagramming_Avalonia_GlassEffect.md) node effect.
- [Granularity Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_Granularity.md): Specifies the granularity of the obstacles map generated by (Markdown/T_MindFusion_Diagramming_Avalonia_QuickRouter.md).
- [GridRouter Class](Markdown/T_MindFusion_Diagramming_Avalonia_GridRouter.md): Implements a link routing algorithm that uses a grid to represent the free and occupied regions in the diagram.
- [GridStyle Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_GridStyle.md): Defines values that specify the visual style of the alignment grid.
- [Group Class](Markdown/T_MindFusion_Diagramming_Avalonia_Group.md): Represents a group of items in the diagram document.
- [Group.Attachment Class](Markdown/T_MindFusion_Diagramming_Avalonia_Group+Attachment.md): Encapsulates attachment information.
- [GroupAnchorStyles Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_GroupAnchorStyles.md): Specifies the master node edges to which a subordinate node can be anchored.
- [GroupCollection Class](Markdown/T_MindFusion_Diagramming_Avalonia_GroupCollection.md): Represents a strongly typed collection of (Markdown/T_MindFusion_Diagramming_Avalonia_Group.md) objects.
- [GroupEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_GroupEventArgs.md): Contains the arguments passed to handlers of group-related events, such as (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#groupdestroyed).
- [GroupRotation Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_GroupRotation.md): Defines values that indicate how rotation of a group's master node affects the nodes attached to that group.
- [HandlesStyle Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_HandlesStyle.md): Enumerates possible visual styles for frames that are drawn around selected nodes.
- [HandlesVisualStyle Class](Markdown/T_MindFusion_Diagramming_Avalonia_HandlesVisualStyle.md): Defines the Pen and Brush objects used to draw items' adjustment handles.
- [HitTestEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_HitTestEventArgs.md): Contains the arguments passed to the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#hittestadjustmenthandles) event handlers.
- [HitTestPriority Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_HitTestPriority.md): Defines values that specify the order of item hit-testing.
- [HotkeyPrefix Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_HotkeyPrefix.md): Replaces System.Drawing.Text.HotkeyPrefix
- [HtmlBuilder Class](Markdown/T_MindFusion_Diagramming_Avalonia_HtmlBuilder.md): Provides methods to create and use HTML client side image maps.
- [HyperLinkStyle Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_HyperLinkStyle.md): Specifies how various export components should treat the HyperLink property of items.
- [IItemFactory Interface](Markdown/T_MindFusion_Diagramming_Avalonia_IItemFactory.md): Defines an interface for constructing IPersists objects.
- [ILinkRouter Interface](Markdown/T_MindFusion_Diagramming_Avalonia_ILinkRouter.md): Defines methods that should be implemented by a link-router component. The control calls them when a new link path should be set in response to changes in the diagram, such as adding or modifying n...
- [ImageAlign Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_ImageAlign.md): Specifies the position and alignment of a picture in a node or table, or that of the background image.
- [InplaceEditable Interface](Markdown/T_MindFusion_Diagramming_Avalonia_InplaceEditable.md): Represents an in-place editable object.
- [InplaceEditableList Interface](Markdown/T_MindFusion_Diagramming_Avalonia_InplaceEditableList.md): Represents an object that can be edited via an inplace list control.
- [InPlaceEditEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_InPlaceEditEventArgs.md): Contains the arguments passed to the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#enterinplaceeditmode) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#leaveinplaceedit...
- [InputState Class](Markdown/T_MindFusion_Diagramming_Avalonia_InputState.md): Encapsulates touch information, provided to the behavior classes.
- [InstantiateItemEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_InstantiateItemEventArgs.md): Contains the arguments passed to the (Markdown/T_MindFusion_Diagramming_Avalonia_IItemFactory.md#instantiateitem) event handlers.
- [Interaction Class](Markdown/T_MindFusion_Diagramming_Avalonia_Interaction.md): Tracks mouse messages to implement user interaction with the diagram.
- [InteractionState Class](Markdown/T_MindFusion_Diagramming_Avalonia_InteractionState.md): Encapsulates the current state of user interaction with the control.
- [InteractionTarget Interface](Markdown/T_MindFusion_Diagramming_Avalonia_InteractionTarget.md): Abstracts the target object for user interactions with the diagram.
- [InternalUtils Class](Markdown/T_MindFusion_Diagramming_Avalonia_InternalUtils.md): Contains common helper methods, specific to AvaloniaDiagram.
- [ItemCollectionBase(T) Class](Markdown/CC_T_MindFusion_Diagramming_Avalonia_ItemCollectionBase_0.md): A base collection class for the diagram item collections.
- [ItemEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_ItemEventArgs.md): Contains the arguments passed to item instantiation event handlers.
- [ItemLabel Class](Markdown/T_MindFusion_Diagramming_Avalonia_ItemLabel.md): The base class for node and link labels.
- [ItemListView Class](Markdown/T_MindFusion_Diagramming_Avalonia_ItemListView.md): ListBox control with specific support for hosting DiagramItems and dragging them to DiagramView control.
- [ItemListViewItem Class](Markdown/T_MindFusion_Diagramming_Avalonia_ItemListViewItem.md): Renders diagram items inside ItemListView.
- [ItemRenderer Class](Markdown/T_MindFusion_Diagramming_Avalonia_ItemRenderer.md): Renders diagram items in their standard appearance. This element can be included in Xaml template of an item class to render item's standard graphics before any additional WPF elements defined by t...
- [ITextAttributes Interface](Markdown/T_MindFusion_Diagramming_Avalonia_ITextAttributes.md): Defines attributes of text content displayed by diagram items.
- [JsonImageHandler Interface](Markdown/T_MindFusion_Diagramming_Avalonia_JsonImageHandler.md): Defines methods that can be used to implement serialization of custom image source types.
- [JsonPersistContext Class](Markdown/T_MindFusion_Diagramming_Avalonia_JsonPersistContext.md): Contains methods that can help you serialize and deserialize AvaloniaDiagram items to and from JSON.
- [JsonSerializeTagEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_JsonSerializeTagEventArgs.md): Contains the arguments passed to the JsonSerializeTag and JsonDeserializeTag event handlers.
- [Layer Class](Markdown/T_MindFusion_Diagramming_Avalonia_Layer.md): Represents a layer in a (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md) object.
- [LayerListView Class](Markdown/T_MindFusion_Diagramming_Avalonia_LayerListView.md): Represents a list box with (Markdown/T_MindFusion_Diagramming_Avalonia_Layer.md) objects.
- [LineTemplate Class](Markdown/T_MindFusion_Diagramming_Avalonia_LineTemplate.md): Represents a line segment in a shape definition.
- [LinkAdjustmentHandle Class](Markdown/T_MindFusion_Diagramming_Avalonia_LinkAdjustmentHandle.md): Represents an adjustment handle used to modify the position of a link's control point.
- [LinkCrossingEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_LinkCrossingEventArgs.md): Contains the arguments passed to the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#validatelinkcrossing) event handler.
- [LinkCrossings Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_LinkCrossings.md): Defines values that indicate how to render link intersection points.
- [LinkEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_LinkEventArgs.md): Contains the arguments passed to handlers of link related events, such as (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#linkcreated) and (Markdown/T_MindFusion_Diagramming_Avalonia_Dia...
- [LinkLabel Class](Markdown/T_MindFusion_Diagramming_Avalonia_LinkLabel.md): Represents a label displayed by a (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md). New labels can be added to a link by calling the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLi...
- [LinkRenderer Class](Markdown/T_MindFusion_Diagramming_Avalonia_LinkRenderer.md): Renders diagram links in their standard appearance. This element can be included in Xaml template of a link class to render link's standard graphics before any additional WPF elements defined by th...
- [LinkShape Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_LinkStyle.md): Specifies available link shapes.
- [LinkShapeEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_LinkShapeEventArgs.md): Contains the arguments passed to the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#setselfloopshape) event handler.
- [LinkTextStyle Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_LinkTextStyle.md): Specifies the position and alignment of links' labels.
- [LinkTo Class](Markdown/T_MindFusion_Diagramming_Avalonia_LinkTo.md): A helper class that provides attached properties for connecting a link to nodes from Xaml.
- [LinkValidationEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_LinkValidationEventArgs.md): Contains the arguments passed to handlers of link validation events.
- [Magnifier Class](Markdown/T_MindFusion_Diagramming_Avalonia_Magnifier.md): Represents a magnifying tool.
- [Manipulator Class](Markdown/T_MindFusion_Diagramming_Avalonia_Manipulator.md): Base class for interactive manipulators, which are user interface elements attached to a diagram item. The user can perform various manipulations on objects through their attached manipulators.
- [MarkStyle Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_MarkStyle.md): Specifies the visual style of anchor point marks.
- [MatrixExtensions Class](Markdown/T_MindFusion_Diagramming_Avalonia_MatrixExtensions.md):
- [ModificationEffect Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_ModificationEffect.md): Specifies the visual effect to apply during interactive modification of items.
- [ModificationStart Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_ModificationStart.md): Specifies how the user can start modifying an item.
- [ModifierKeyAction Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_ModifierKeyAction.md): Defines the actions that can be assigned to a modifier key such as CTRL or ALT.
- [ModifierKeyActions Class](Markdown/T_MindFusion_Diagramming_Avalonia_ModifierKeyActions.md): Maps keyboard modifier keys to special actions in AvaloniaDiagram such as panning and drawing selection rectangle.
- [MouseButton Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_MouseButton.md): Specifies constants that define which mouse button was pressed.
- [MouseButtonActions Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_MouseButtonActions.md): Specifies what actions can be associated with the middle and right mouse buttons.
- [MouseInputMode Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_MouseInputMode.md): Contains values that identify how to process mouse input.
- [NodeAdjustmentHandle Class](Markdown/T_MindFusion_Diagramming_Avalonia_NodeAdjustmentHandle.md): Represents an adjustment handle used to move, resize or rotate a node.
- [NodeConstraints Class](Markdown/T_MindFusion_Diagramming_Avalonia_NodeConstraints.md): Defines specific constraints that can be applied to the size and location of nodes.
- [NodeEffect Class](Markdown/T_MindFusion_Diagramming_Avalonia_NodeEffect.md): Represents the base class of all visual effects that can be applied to the nodes in a (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md).
- [NodeEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_NodeEventArgs.md): Contains the arguments passed to handlers of node-related events, such as (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#treecollapsed) and (Markdown/T_MindFusion_Diagramming_Avalonia_D...
- [NodeHandleType Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_NodeHandleType.md): Identifies the types of selection handles of a node.
- [NodeLabel Class](Markdown/T_MindFusion_Diagramming_Avalonia_NodeLabel.md): Represents a supplementary label displayed by a (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md). New labels can be added to a node by calling its (Markdown/T_MindFusion_Diagramming_Aval...
- [NodeRenderer Class](Markdown/T_MindFusion_Diagramming_Avalonia_NodeRenderer.md): Renders diagram nodes in their standard appearance. This element can be included in Xaml template of a node class to render node's standard graphics before any additional WPF elements defined by th...
- [NodeRotationType Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_NodeRotationType.md): Specifies whether nodes should rotate to face the camera in DiagramView3D.
- [NodesAlignedEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_NodesAlignedEventArgs.md): Contains the arguments passed to handlers of the (Markdown/T_MindFusion_Diagramming_Avalonia_Ruler.md#nodesaligned) event.
- [NodeValidationEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_NodeValidationEventArgs.md): Contains the arguments passed to handlers of node validation events.
- [NotATreeException Class](Markdown/T_MindFusion_Diagramming_Avalonia_NotATreeException.md): An exception raised by the (Markdown/T_MindFusion_Diagramming_Avalonia_TreeEnumerator.md) class if the specified node does not represent a root of a tree.
- [Orientation Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_Orientation.md): Defines values that specify the orientation of the first segment of cascading links.
- [Overview Class](Markdown/T_MindFusion_Diagramming_Avalonia_Overview.md): The (Markdown/T_MindFusion_Diagramming_Avalonia_Overview.md) control provides a scaled-down view of a (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md) and lets the user scroll or zoom th...
- [PagedContainerNode Class](Markdown/T_MindFusion_Diagramming_Avalonia_PagedContainerNode.md): A container that can arrange its children in pages.
- [PageIconRenderer Class](Markdown/T_MindFusion_Diagramming_Avalonia_PageIconRenderer.md): Draws page navigation arrows in PagedContainerNode caption bar.
- [PageRenamedEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_PageRenamedEventArgs.md): Contains arguments for the (Markdown/T_MindFusion_Diagramming_Avalonia_TabbedDiagramView.md#pagerenamed) event.
- [Palette Class](Markdown/T_MindFusion_Diagramming_Avalonia_Palette.md): Represents a tool palette control that displays DiagramItem objects grouped into categories. Items from the palette can be added to a diagram by drag-and-drop.
- [PaletteCategory Class](Markdown/T_MindFusion_Diagramming_Avalonia_PaletteCategory.md): Represents a category in a Palette control.
- [Path Class](Markdown/T_MindFusion_Diagramming_Avalonia_Path.md): Represents a sequence of connected (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramNode.md) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramLink.md) elements.
- [PathCollection Class](Markdown/T_MindFusion_Diagramming_Avalonia_PathCollection.md): Represents a strongly typed collection of (Markdown/T_MindFusion_Diagramming_Avalonia_Path.md) objects.
- [PathFinder Class](Markdown/T_MindFusion_Diagramming_Avalonia_PathFinder.md): Provides methods that help you find paths and cycles in a graph.
- [PatternRouter Class](Markdown/T_MindFusion_Diagramming_Avalonia_PatternRouter.md): Routes links by applying patterns of segment and turn sequences and accepting them when resulting paths do not cross nodes.
- [PointCollection Class](Markdown/T_MindFusion_Diagramming_Avalonia_PointCollection.md): Represents a strongly typed collection of points.
- [PolylineRouting Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_PolylineRouting.md): Defines values that indicate how Polyline links should be routed.
- [PrintOptions Class](Markdown/T_MindFusion_Diagramming_Avalonia_PrintOptions.md): Provides properties that allow customization of various aspects of printing and print-preview.
- [QuickRouter Class](Markdown/T_MindFusion_Diagramming_Avalonia_QuickRouter.md): Implements a very fast link routing algorithm that uses a tree to represent the free and occupied regions in the diagram.
- [ReadOnlyCollection(T) Class](Markdown/CC_T_MindFusion_Diagramming_Avalonia_ReadOnlyCollection_0.md): Represents a read-only wrapper of a collection.
- [ReadOnlyDiagramItemCollection Class](Markdown/T_MindFusion_Diagramming_Avalonia_ReadOnlyDiagramItemCollection.md): Represents a read-only collection of items.
- [ReadOnlyDiagramLinkCollection Class](Markdown/T_MindFusion_Diagramming_Avalonia_ReadOnlyDiagramLinkCollection.md): Represents a read-only collection of links.
- [ReadOnlyDiagramNodeCollection Class](Markdown/T_MindFusion_Diagramming_Avalonia_ReadOnlyDiagramNodeCollection.md): Represents a read-only collection of nodes.
- [Relationship Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_Relationship.md): Specifies the type of relationship between two tables.
- [RelativePosition Class](Markdown/T_MindFusion_Diagramming_Avalonia_RelativePosition.md): Represents relative positions inside diagram elements.
- [RelativeToLink Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_RelativeToLink.md): Specifies how the link labels are positioned.
- [RelativeToNode Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_RelativeToNode.md): Specifies how the node labels are positioned.
- [RenderCallback(T) Delegate](Markdown/T_MindFusion_Diagramming_Avalonia_RenderCallback.md): This delegate declares the prototype of drawing callbacks called by various icon Renderers.
- [Renderers Class](Markdown/T_MindFusion_Diagramming_Avalonia_Renderers.md): This class lets you set icons for shared diagram elements such as expand / collapse and fold / unfold buttons, or provide callbacks that draws them using DrawingContext code.
- [RenderOptions Class](Markdown/T_MindFusion_Diagramming_Avalonia_RenderOptions.md): Provides properties that allow customization of various aspects of printing and print-preview.
- [RenderTarget Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_RenderTarget.md): Specifies where the diagram is being rendered.
- [RepaintEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_RepaintEventArgs.md): Specifies the coordinates of the area that should be repainted by views when the Repaint event is raised.
- [RerouteLinks Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_RerouteLinks.md): Provides values indicating in what circumstances links must be rerouted automatically.
- [RestrictToBounds Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_RestrictToBounds.md): Specifies the restriction of the position of an object as to the document extents.
- [RoundRectangleTemplate Class](Markdown/T_MindFusion_Diagramming_Avalonia_RoundRectangleTemplate.md): Represents an (Markdown/T_MindFusion_Diagramming_Avalonia_ElementTemplate.md) that draws round rectangle.
- [RoutePattern Class](Markdown/T_MindFusion_Diagramming_Avalonia_RoutePattern.md): Represents a template from which link routes are created.
- [RouteStep Class](Markdown/T_MindFusion_Diagramming_Avalonia_RouteStep.md): Represents segments or turns in routing patterns.
- [RouteStepKind Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_RouteStepKind.md): Represents parts of a route template.
- [RoutingOptions Class](Markdown/T_MindFusion_Diagramming_Avalonia_RoutingOptions.md): Allows customization of various aspects of the link routing algorithm.
- [RowEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_RowEventArgs.md): Contains the arguments passed to handlers of table row-related events, such as (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#tablesectioncollapsed) and (Markdown/T_MindFusion_Diagrammi...
- [Ruler Class](Markdown/T_MindFusion_Diagramming_Avalonia_Ruler.md): The (Markdown/T_MindFusion_Diagramming_Avalonia_Ruler.md) control provides horizontal and vertical scales that help users measure diagram items.
- [RulerUnit Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_RulerUnit.md): Specifies a measurement unit for the Ruler.
- [SaveToStringFormat Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_SaveToStringFormat.md): Specifies in what format to save the diagram when generating a string using the (Markdown/T_MindFusion_Diagramming_Avalonia_Diagram.md#savetostring) method.
- [ScaleMode Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_ScaleMode.md): Defines (Markdown/T_MindFusion_Diagramming_Avalonia_Overview.md) scaling modes.
- [ScalingMode Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_ScalingMode.md): Specifies whether 3D models of links should scale when the camera zooms in or out.
- [ScrollIconRenderer Class](Markdown/T_MindFusion_Diagramming_Avalonia_ScrollIconRenderer.md): Draws scroll arrows in TableNode caption bar.
- [Selection Class](Markdown/T_MindFusion_Diagramming_Avalonia_Selection.md): Represents a set of items selected in the diagram document.
- [SelectionCopy Class](Markdown/T_MindFusion_Diagramming_Avalonia_SelectionCopy.md): Used internally in the implementation of copy/paste functions.
- [SelectionEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_SelectionEventArgs.md): Contains the arguments passed to the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#selectionmodified) event handler.
- [SelectionRenderer Class](Markdown/T_MindFusion_Diagramming_Avalonia_SelectionRenderer.md): Renders diagram selection lasso.
- [SelectionStyle Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_SelectionStyle.md): Defines values that specify how multiple selected items are indicated visually.
- [SelectionValidationEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_SelectionValidationEventArgs.md): Contains the arguments passed to the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#selectionmodifying) event handler.
- [SerializationOptions Class](Markdown/T_MindFusion_Diagramming_Avalonia_SerializationOptions.md): Allows customization of some aspects of the binary serialization of AvaloniaDiagram diagrams.
- [SerializeTagEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_SerializeTagEventArgs.md): Contains the arguments passed to the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#serializetag) and (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#deserializetag) event ha...
- [ShadowsStyle Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_ShadowsStyle.md): Enumerates possible shadows-drawing styles.
- [Shape Class](Markdown/T_MindFusion_Diagramming_Avalonia_Shape.md): An instance of this class represents a shape defined through a series of arc, line and Bezier segments. Such shapes can be assigned to (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md) ojec...
- [ShapeAdjustmentHandle Class](Markdown/T_MindFusion_Diagramming_Avalonia_ShapeAdjustmentHandle.md): Represents an adjustment handle used to modify the (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md#shape) of a (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md).
- [ShapeCollection Class](Markdown/T_MindFusion_Diagramming_Avalonia_ShapeCollection.md): Represents a read-only collection of shapes.
- [ShapeControlPoint Class](Markdown/T_MindFusion_Diagramming_Avalonia_ShapeControlPoint.md): Represents a control point that can be used to adjust the shape of a (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md). Control point positions are passed as parameters to shape formulas, w...
- [ShapeConverter Class](Markdown/T_MindFusion_Diagramming_Avalonia_ShapeConverter.md): Converts from Shape to other data types.
- [ShapeData Class](Markdown/T_MindFusion_Diagramming_Avalonia_ShapeData.md): Contains the cached coordinates of the key points of a shape when the shape is applied to a specific (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md). This class also stores additional dat...
- [ShapeDecoration Class](Markdown/T_MindFusion_Diagramming_Avalonia_ShapeDecoration.md): Defines decoration elements that are displayed as filled shapes.
- [ShapeEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_ShapeEventArgs.md): Contains the arguments passed to the ShapeSelected and ShapeRenamed event handlers.
- [ShapeFormulaParam Class](Markdown/T_MindFusion_Diagramming_Avalonia_ShapeFormulaParam.md): Represents the position of a (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeControlPoint.md), passed as parameter to shape formulas.
- [ShapeLibrary Class](Markdown/T_MindFusion_Diagramming_Avalonia_ShapeLibrary.md): The (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeLibrary.md) class represents a collection of shape definitions stored together.
- [ShapeNode Class](Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md): (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md) instances are diagram nodes that represent geometric shapes.
- [ShapeNodeProperties Class](Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNodeProperties.md): Stores the values of ShapeNode properties during undo / redo operations. If you need to implement undo support for the additional properties defined by a class derived from ShapeNode, do so by deri...
- [ShapeNodeState Class](Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNodeState.md): Contains a snapshot of the internal state of a (Markdown/T_MindFusion_Diagramming_Avalonia_ShapeNode.md). Instances of this class are used to store the state of nodes for later undo or redo operati...
- [Shapes Class](Markdown/T_MindFusion_Diagramming_Avalonia_Shapes.md): Provides alternative method of access to the AvaloniaDiagram predefined shapes, that allows code completion and IntelliSense support, which is not available when using (Markdown/T_MindFusion_Diagra...
- [ShowAnchors Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_ShowAnchors.md): Specifies when anchors points should be displayed.
- [SimpleShape Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_SimpleShape.md): Defines the possible values for the (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md#shape) property of tables, tree views and containers.
- [SizeSyncMode Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_SizeSyncMode.md): Contains values that identify the possible ways to synchronize the size of a (Markdown/T_MindFusion_Diagramming_Avalonia_ControlNode.md) node with the size of its hosted control.
- [SnapToAnchor Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_SnapToAnchor.md): Specifies when link ends are snapped to nearest anchor points.
- [StringAlignment Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_StringAlignment.md): Replaces System.Drawing.StringAlignment
- [StringFormat Class](Markdown/T_MindFusion_Diagramming_Avalonia_StringFormat.md): Replaces System.Drawing.StringFormat
- [StringFormatFlags Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_StringFormatFlags.md): Replaces System.Drawing.StringFormatFlags
- [StringTrimming Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_StringTrimming.md): Replaces System.Drawing.StringTrimming
- [SvgNode Class](Markdown/T_MindFusion_Diagramming_Avalonia_SvgNode.md): Represents nodes that can render SVG drawings.
- [SvgNodeProperties Class](Markdown/T_MindFusion_Diagramming_Avalonia_SvgNodeProperties.md): Stores the values of SvgNode properties during undo / redo operations. If you need to implement undo support for the additional properties defined by a class derived from SvgNode, do so by deriving...
- [TabbedDiagramView Class](Markdown/T_MindFusion_Diagramming_Avalonia_TabbedDiagramView.md): Represents a control that can display (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramDocument.md) objects. The individual diagram pages can be activated through the tabs in the tray located at ...
- [TableConnectionPoint Class](Markdown/T_MindFusion_Diagramming_Avalonia_TableConnectionPoint.md): Represents a connection between a link and a table node.
- [TableConnectionStyle Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_TableConnectionStyle.md): Specifies the possible values for the (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md#connectionstyle) property of tables.
- [TableNode Class](Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md): Tables are diagram nodes that can contain multiple cells and can be related to other nodes through their rows.
- [TableNode.Cell Class](Markdown/T_MindFusion_Diagramming_Avalonia_TableNode+Cell.md): Represents a cell in a (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md) instance.
- [TableNode.CellCollection Class](Markdown/T_MindFusion_Diagramming_Avalonia_TableNode+CellCollection.md): Represents a strongly-typed collection of (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode+Cell.md) objects.
- [TableNode.Column Class](Markdown/T_MindFusion_Diagramming_Avalonia_TableNode+Column.md): Represents a column of a (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md).
- [TableNode.ColumnCollection Class](Markdown/T_MindFusion_Diagramming_Avalonia_TableNode+ColumnCollection.md): Represents a strongly-typed collection of (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode+Column.md) objects.
- [TableNode.Row Class](Markdown/T_MindFusion_Diagramming_Avalonia_TableNode+Row.md): Represents a row in (Markdown/T_MindFusion_Diagramming_Avalonia_TableNode.md) node.
- [TableNode.RowCollection Class](Markdown/T_MindFusion_Diagramming_Avalonia_TableNode+RowCollection.md): Represents a strongly-typed collection of TableNode.Row objects.
- [TableNodeProperties Class](Markdown/T_MindFusion_Diagramming_Avalonia_TableNodeProperties.md): Stores the values of TableNode properties during undo / redo operations. If you need to implement undo support for the additional properties defined by a class derived from TableNode, do so by deri...
- [TemplatedNode Class](Markdown/T_MindFusion_Diagramming_Avalonia_TemplatedNode.md): The (Markdown/T_MindFusion_Diagramming_Avalonia_TemplatedNode.md) class represents nodes whose appearance is set through Xaml data templates.
- [TextAttributes Class](Markdown/T_MindFusion_Diagramming_Avalonia_TextAttributes.md): Defines attributes of text content displayed by diagram items.
- [TextPresenter Class](Markdown/T_MindFusion_Diagramming_Avalonia_TextPresenter.md): Implements a container for text content and defines text attributes.
- [Theme Class](Markdown/T_MindFusion_Diagramming_Avalonia_Theme.md): Represents a set of (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Style.md) objects for different diagram item types.
- [ToolTipEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_ToolTipEventArgs.md): Contains the arguments passed to CreateToolTipControl event handlers.
- [TreeEnumerator Class](Markdown/T_MindFusion_Diagramming_Avalonia_TreeEnumerator.md): Enables an easy standard method to itereate over the elements of a tree-like structure of objects.
- [TreeItemEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_TreeItemEventArgs.md): Contains the arguments passed to handlers of (Markdown/T_MindFusion_Diagramming_Avalonia_TreeViewItem.md)-related events.
- [TreeItemValidationEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_TreeItemValidationEventArgs.md): Contains the arguments passed to event handlers, such as (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#treeitemtextediting).
- [TreeViewConnectionPoint Class](Markdown/T_MindFusion_Diagramming_Avalonia_TreeViewConnectionPoint.md): Represents a connection between a link and a (Markdown/T_MindFusion_Diagramming_Avalonia_TreeViewNode.md).
- [TreeViewConnectionStyle Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_TreeViewConnectionStyle.md): Specifies the possible values for the (Markdown/T_MindFusion_Diagramming_Avalonia_TreeViewNode.md#connectionstyle) property of TreeViewNodes.
- [TreeViewItem Class](Markdown/T_MindFusion_Diagramming_Avalonia_TreeViewItem.md): Represents a constituent item of the hierarchy displayed inside a (Markdown/T_MindFusion_Diagramming_Avalonia_TreeViewNode.md).
- [TreeViewNode Class](Markdown/T_MindFusion_Diagramming_Avalonia_TreeViewNode.md): Represents nodes that can draw hierarchical data.
- [UndoEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_UndoEventArgs.md): Contains the arguments passed to the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#actionrecorded), (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#actionundone) and (Markdo...
- [UndoManager Class](Markdown/T_MindFusion_Diagramming_Avalonia_UndoManager.md): Implements undo/redo functionality in AvaloniaDiagram.
- [UndoValidationEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_UndoValidationEventArgs.md): Contains the arguments passed to the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#actionrecording) event handlers.
- [UnitType Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_UnitType.md): Defines values that indicate whether point positions are specified in percentage, or in absolute units relative to the node's top-left corner.
- [VisualContainer Interface](Markdown/T_MindFusion_Diagramming_Avalonia_VisualContainer.md): Abstract container of Visual objects.
- [XmlOptions Class](Markdown/T_MindFusion_Diagramming_Avalonia_XmlOptions.md): Defines properties used to customize the XML serialization process.
- [XmlPersistContext Class](Markdown/T_MindFusion_Diagramming_Avalonia_XmlPersistContext.md): Contains methods that can help you serialize and deserialize AvaloniaDiagram items to end from XML documents.
### Namespace MindFusion.Diagramming.Avalonia.Behaviors
- [BehaviorBase Class](Markdown/T_MindFusion_Diagramming_Avalonia_Behaviors_BehaviorBase.md): An abstract base class for classes that defines how AvaloniaDiagram reacts to users' actions with a mouse or other pointing devices.
- [CustomTypesBehavior Class](Markdown/T_MindFusion_Diagramming_Avalonia_Behaviors_CustomTypesBehavior.md): This class is used when view's (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#behavior) is set to (Markdown/T_MindFusion_Diagramming_Avalonia_Behavior.md).
- [DrawControlsBehavior Class](Markdown/T_MindFusion_Diagramming_Avalonia_Behaviors_DrawControlsBehavior.md): This class is used when view's (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#behavior) is set to BehaviorType.DrawControls.
- [DrawFreeFormsBehavior Class](Markdown/T_MindFusion_Diagramming_Avalonia_Behaviors_DrawFreeFormsBehavior.md): This class is used when view's (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#behavior) is set to (Markdown/T_MindFusion_Diagramming_Avalonia_Behavior.md).
- [DrawLinksBehavior Class](Markdown/T_MindFusion_Diagramming_Avalonia_Behaviors_DrawLinksBehavior.md): This class is used when view's (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#behavior) is set to (Markdown/T_MindFusion_Diagramming_Avalonia_Behavior.md).
- [DrawNodesBehavior(T) Class](Markdown/T_MindFusion_Diagramming_Avalonia_Behaviors_DrawNodesBehavior_0.md): Implements functionality that allows users to draw nodes on the diagram canvas.
- [LassoBehavior Class](Markdown/T_MindFusion_Diagramming_Avalonia_Behaviors_ZoomBehavior.md): Implements the (Markdown/T_MindFusion_Diagramming_Avalonia_Behavior.md) behavior.
- [LinkControlsBehavior Class](Markdown/T_MindFusion_Diagramming_Avalonia_Behaviors_LinkControlsBehavior.md): This class is used when view's (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#behavior) is set to BehaviorType.LinkControls.
- [LinkFreeFormsBehavior Class](Markdown/T_MindFusion_Diagramming_Avalonia_Behaviors_LinkFreeFormsBehavior.md): This class is used when view's (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#behavior) is set to (Markdown/T_MindFusion_Diagramming_Avalonia_Behavior.md).
- [LinkNodesBehavior(T) Class](Markdown/T_MindFusion_Diagramming_Avalonia_Behaviors_LinkNodesBehavior_0.md): Implements functionality that allows users to draw nodes on the diagram canvas, when the interaction starts from an unoccupied point, and to connect nodes with links when the interaction starts fro...
- [ModifyBehavior Class](Markdown/T_MindFusion_Diagramming_Avalonia_Behaviors_ModifyBehavior.md): This class is used when view's (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#behavior) is set to (Markdown/T_MindFusion_Diagramming_Avalonia_Behavior.md).
- [MoveNodesBehavior Class](Markdown/T_MindFusion_Diagramming_Avalonia_Behaviors_MoveNodesBehavior.md): This class is used when view's (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#behavior) is set to Behavior.MoveNodes.
- [PanBehavior Class](Markdown/T_MindFusion_Diagramming_Avalonia_Behaviors_PanBehavior.md): Implements the Pan and PanAndModify behaviors.
- [SelectOnlyBehavior Class](Markdown/T_MindFusion_Diagramming_Avalonia_Behaviors_SelectOnlyBehavior.md): This class is used when view's (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramView.md#behavior) is set to Behavior.SelectOnly.
### Namespace MindFusion.Diagramming.Avalonia.Commands
- [AddGroupCmd Class](Markdown/T_MindFusion_Diagramming_Avalonia_Commands_AddGroupCmd.md): Implements creation of groups.
- [AddItemCmd Class](Markdown/T_MindFusion_Diagramming_Avalonia_Commands_AddItemCmd.md): Implements creation of new diagram items.
- [AddToContainerCmd Class](Markdown/T_MindFusion_Diagramming_Avalonia_Commands_AddToContainerCmd.md): Undoable command that implements an addition of a node to a container.
- [ChangeContainerCmd Class](Markdown/T_MindFusion_Diagramming_Avalonia_Commands_ChangeContainerCmd.md): Undoable command that implements changing node's container.
- [ChangeItemCmd Class](Markdown/T_MindFusion_Diagramming_Avalonia_Commands_ChangeItemCmd.md): Handles undo / redo of programmatic property changes.
- [Command Class](Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md): Represent an action that can be carried out on a diagram, and later undone or redone.
- [CommandCollection Class](Markdown/T_MindFusion_Diagramming_Avalonia_Commands_CommandCollection.md): A collection of commands.
- [CommandContext Class](Markdown/T_MindFusion_Diagramming_Avalonia_Commands_CommandContext.md): The context of an executing command.
- [CommandList Class](Markdown/T_MindFusion_Diagramming_Avalonia_Commands_CommandList.md): Represents a read-only collection of (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md) objects.
- [CompositeCmd Class](Markdown/T_MindFusion_Diagramming_Avalonia_Commands_CompositeCmd.md): Represents a set of (Markdown/T_MindFusion_Diagramming_Avalonia_Commands_Command.md) instances as a single operation. Undoing or redoing the composite action, respectively undoes or redoes all its ...
- [ContainerPagesCmd Class](Markdown/T_MindFusion_Diagramming_Avalonia_Commands_ContainerPagesCmd.md): Tracks changes of the Pages collection of a PagedContainerNode.
- [DisconnectLinkCmd Class](Markdown/T_MindFusion_Diagramming_Avalonia_Commands_DisconnectLinkCmd.md): Disconnects links from a deleted node.
- [EditTextCmd Class](Markdown/T_MindFusion_Diagramming_Avalonia_Commands_EditTextCmd.md): Represents undoable edit operations.
- [ExpandHeaderRowCmd Class](Markdown/T_MindFusion_Diagramming_Avalonia_Commands_ExpandHeaderRowCmd.md): Implements undo and redo of collapsing or expanding the header row of a table section.
- [ExpandItemCmd Class](Markdown/T_MindFusion_Diagramming_Avalonia_Commands_ExpandItemCmd.md): Implements expanding/collapsing trees of items.
- [ExpandTreeViewItemCmd Class](Markdown/T_MindFusion_Diagramming_Avalonia_Commands_ExpandTreeViewItemCmd.md): Implements support for undo of (Markdown/T_MindFusion_Diagramming_Avalonia_TreeViewItem.md) collapse/expand operations.
- [FoldContainerCmd Class](Markdown/T_MindFusion_Diagramming_Avalonia_Commands_FoldContainerCmd.md): Undoable command that implements scrolling of table rows.
- [GroupAttachCmd Class](Markdown/T_MindFusion_Diagramming_Avalonia_Commands_GroupAttachCmd.md): Implements an addition of a subordinated item to a group.
- [GroupDetachCmd Class](Markdown/T_MindFusion_Diagramming_Avalonia_Commands_GroupDetachCmd.md): Implements removal of an item from a group.
- [ModifyItemCmd Class](Markdown/T_MindFusion_Diagramming_Avalonia_Commands_ModifyItemCmd.md): Implements changes of item's size and position.
- [PageContainerCmd Class](Markdown/T_MindFusion_Diagramming_Avalonia_Commands_PageContainerCmd.md): Implements page navigation of PagedContainerNode.
- [RedimTableCmd Class](Markdown/T_MindFusion_Diagramming_Avalonia_Commands_RedimTableCmd.md): Implements changes to the number of table's rows and coolumns.
- [RemoveFromContainerCmd Class](Markdown/T_MindFusion_Diagramming_Avalonia_Commands_RemoveFromContainerCmd.md): Undoable command that implements an addition of a node to a container.
- [RemoveGroupCmd Class](Markdown/T_MindFusion_Diagramming_Avalonia_Commands_RemoveGroupCmd.md): Implements destruction of groups.
- [RemoveItemCmd Class](Markdown/T_MindFusion_Diagramming_Avalonia_Commands_RemoveItemCmd.md): Implements deletion of diagram items.
- [ResizeTableColumnCmd Class](Markdown/T_MindFusion_Diagramming_Avalonia_Commands_ResizeTableColumnCmd.md): Implements resizing of table's columns.
- [ResizeTableRowCmd Class](Markdown/T_MindFusion_Diagramming_Avalonia_Commands_ResizeTableRowCmd.md): Implements resizing of table's rows.
- [ScrollContainerCmd Class](Markdown/T_MindFusion_Diagramming_Avalonia_Commands_ScrollContainerCmd.md): Implements support for undo of (Markdown/T_MindFusion_Diagramming_Avalonia_ContainerNode.md) scroll operations.
- [ScrollTableCmd Class](Markdown/T_MindFusion_Diagramming_Avalonia_Commands_ScrollTableCmd.md): Implements scrolling of table's rows.
- [ScrollTreeViewCmd Class](Markdown/T_MindFusion_Diagramming_Avalonia_Commands_ScrollTreeViewCmd.md): Implements support for undo of (Markdown/T_MindFusion_Diagramming_Avalonia_TreeViewNode.md) scroll operations.
### Namespace MindFusion.Diagramming.Avalonia.Controllers
- [ModifyLabelController Class](Markdown/T_MindFusion_Diagramming_Avalonia_Controllers_ModifyLabelController.md): A controller that moves item labels.
- [NodeConstructor Delegate](Markdown/T_MindFusion_Diagramming_Avalonia_Controllers_NodeConstructor.md): Creates new nodes.
- [PointerController Class](Markdown/T_MindFusion_Diagramming_Avalonia_Controllers_PointerController.md): Processes mouse or touch events targeting a diagram element.
- [SinglePointerController Class](Markdown/T_MindFusion_Diagramming_Avalonia_Controllers_SinglePointerController.md): Represents controllers that handle mouse or single-touch input.
### Namespace MindFusion.Diagramming.Avalonia.Lanes
- [CellBoundsEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_CellBoundsEventArgs.md): Contains the arguments passed to handlers of the (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Grid.md#cellboundschanged) event.
- [DrawHeaderEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_DrawHeaderEventArgs.md): Contains the arguments passed to the handlers of the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#drawlaneheader) event.
- [EditHeaderTextEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_EditHeaderTextEventArgs.md): Contains the arguments passed to the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#lanegridheadertextedited) event handlers.
- [Grid Class](Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Grid.md): Represents a lane grid.
- [Header Class](Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Header.md): Represents a header in a grid view.
- [HeaderCollection Class](Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_HeaderCollection.md): Represents a strongly typed collection of (Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Header.md) objects.
- [HeaderEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_HeaderEventArgs.md): Contains the arguments passed to handlers of header-related events.
- [HeaderValidationEventArgs Class](Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_HeaderValidationEventArgs.md): Contains the arguments passed to event handlers, such as (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramBase.md#lanegridheadertextediting).
- [ICell Interface](Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_ICell.md): Defines a base for cells in a lane list.
- [LaneResizeType Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_LaneResizeType.md): Specifies how to distribute lane sizes when the user resizes rows or columns.
- [ResizeType Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_ResizeType.md): Specifies how to resize child columns and rows in the lanes grid when their parent column or row is resized.
- [Style Class](Markdown/T_MindFusion_Diagramming_Avalonia_Lanes_Style.md): Encapsulates the appearance properties of an element in a lane grid.
### Namespace MindFusion.Diagramming.Avalonia.Layout
- [AnnealLayout Class](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_AnnealLayout.md): Implements a simulated annealing graph layout algorithm.
- [CascadeLayout Class](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_CascadeLayout.md): Performs cascading layout on simple, connected graphs.
- [CircularLayout Class](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_CircularLayout.md): Implements a circular graph layout algorithm. Nodes are distributed evenly on the circumference of a circle at positions that result in as few link crossing as possible.
- [CompositeLayout Class](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_CompositeLayout.md): Implements a multi-level graph layout algorithm.
- [DecisionLayout Class](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_DecisionLayout.md): Implements a decision graph layout algorithm.
- [Direction Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_Direction.md): Specifies a layout direction.
- [FlowchartLayout Class](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_FlowchartLayout.md): (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_FlowchartLayout.md) can be used to arrange flowcharts representing program source code.
- [FlowLayout Class](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_FlowLayout.md): Implements a flowchart, workflow and process diagrams layout algorithm.
- [FractalLayout Class](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_FractalLayout.md): A tree layout algorithm that places child nodes symmetrically around their parent node.
- [GridLayout Class](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_GridLayout.md): Implements a grid graph layout algorithm.
- [HierarchicalLayout Class](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_HierarchicalLayout.md): Performs hierarchical layout on simple, connected, level-planar graphs.
- [ILayout Interface](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_ILayout.md): Common interface for all AvaloniaDiagram layouters.
- [ISwimlaneGrid Interface](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_ISwimlaneGrid.md): Represents an object which can be used by a SwimlaneLayout to adjust the corresponding swimlane grid.
- [LaneGrid Class](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_LaneGrid.md): Represents an (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_ISwimlaneGrid.md) which operates on a MindFusion.Diagramming.Lanes.Grid object.
- [LaneType Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_LaneType.md): Specifies where (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_FlowLayout.md) gets the swimlane dimensions from.
- [LayeredLayout Class](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_LayeredLayout.md): Implements a layered graph layout algorithm.
- [LayeredLayoutLinkType Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_LayeredLayoutLinkType.md): Specifies the style of the links after they are laid out.
- [LayeredLayoutStatistics Class](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_LayeredLayoutStatistics.md): Encapsulates information about a layered layout which has already complete.
- [Layout Class](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_Layout.md): The base class for all layout classes.
- [LayoutLink Delegate](Markdown/CC_T_MindFusion_Diagramming_Avalonia_Layout_LayoutLink_0.md): Represents methods that are called by the layout algorithms when the position of a link changes.
- [LayoutNode Delegate](Markdown/CC_T_MindFusion_Diagramming_Avalonia_Layout_LayoutNode_0.md): Represents methods that are called by the layout algorithms when the position of a node changes.
- [LayoutProgress Delegate](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_LayoutProgress.md): Represents methods that are called to report on progress of layout algorithms.
- [LayoutSubgraph Delegate](Markdown/CC_T_MindFusion_Diagramming_Avalonia_Layout_LayoutSubgraph_0.md): Represents methods that are called by the layout algorithms in order to perform custom arrangement of a subgraph.
- [MultipleGraphsPlacement Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_MultipleGraphsPlacement.md): Specifies graph orientation.
- [OneWayLayout Class](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_OneWayLayout.md): Implements a one-way graph layout algorithm.
- [Orientation Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_Orientation.md): Specifies axial orientation.
- [OrthogonalLayout Class](Markdown/CC_T_MindFusion_Diagramming_Avalonia_Layout_OrthogonalLayout_0.md): Implements an orthogonal graph layout algorithm. Each link is drawn as a chain of alternating horizontal and vertical segments. Nodes are placed in a way that facilitates few links bends and crossi...
- [OrthogonalRouter Class](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_OrthogonalRouter.md): Implements an orthogonal link routing algorithm.
- [SolarLayout Class](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_SolarLayout.md): A tree layout algorithm that places child nodes around their parent node, such that the child nodes do not overlap. The algorithm optionally bends the links to prevent them from crossing nodes.
- [SpringLayout Class](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_SpringLayout.md): Implements the Spring-Embedder graph layout algorithm.
- [SpringLayoutLinkType Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_SpringLayoutLinkType.md): Specifies the style of the diagram links after they are laid out.
- [SwimlaneLayout Class](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_SwimlaneLayout.md): Implements an algorithm which arranges nodes in lanes.
- [TopologicalLayout Class](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_TopologicalLayout.md): Implements a topological ordering.
- [TreeLayout Class](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_TreeLayout.md): Implements several algorithms for arranging tree structures.
- [TreeLayoutBalance Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_TreeLayoutBalance.md): Specifies how to order child nodes in order to produce tree layouts with custom balance.
- [TreeLayoutDirections Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_TreeLayoutDirection.md): Specifies the direction of a tree layout.
- [TreeLayoutLinkType Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_TreeLayoutLinkType.md): Specifies the shape of the diagram links after they are laid out.
- [TreeLayoutType Enumeration](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_TreeLayoutType.md): Specifies the type of a tree layout.
- [TreeMapLayout Class](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_TreeMapLayout.md): Implements a tree map layout algorithm.
- [TriangularLayout Class](Markdown/T_MindFusion_Diagramming_Avalonia_Layout_TriangularLayout.md): Performs triangular layout on simple, connected graphs.
### Namespace MindFusion.Json.Avalonia
- [Converter Class](Markdown/T_MindFusion_Json_Wpf_Converter.md): Provides capabilities to convert various types to and from strings in a cutlure-independent way.
- [JsonContext Class](Markdown/T_MindFusion_Json_Wpf_JsonContext.md): Contains methods that can help you serialize and deserialize to and from JSON.
- [JsonObject Class](Markdown/T_MindFusion_Json_Wpf_JsonObject.md): Represents a dictionary of property names and values.
- [JsonValue Class](Markdown/T_MindFusion_Json_Wpf_JsonValue.md): Represents a property value.
- [Parser Class](Markdown/T_MindFusion_Json_Wpf_Parser.md): Deserializes objects from a JSON-formatted string.
- [Serializer Class](Markdown/T_MindFusion_Json_Wpf_Serializer.md): Serializes objects to JSON format.
### Namespace MindFusion.Layout
- [AnnealLayoutStatistics Class](Markdown/T_MindFusion_Layout_AnnealLayoutStatistics.md): Contains the accumulated costs for a graph configuration produced by (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_AnnealLayout.md).
- [AssistantType Enumeration](Markdown/CC_T_MindFusion_Layout_AssistantType_0.md): Indicates the type of an assistant node in a tree.
- [BaseLayout Enumeration](Markdown/T_MindFusion_Layout_BaseLayout.md): Specifies how (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_OrthogonalRouter.md) should arrange nodes.
- [ConnectorRules Class](Markdown/T_MindFusion_Layout_ConnectorRules.md): Represents a set of rules that are applied according to the logic identifiers of links.
- [FlowLayoutKeys Class](Markdown/T_MindFusion_Layout_FlowLayoutKeys.md): Defines keys that can be used to define (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_FlowLayout.md) rules.
- [FlowLayoutRules Class](Markdown/T_MindFusion_Layout_FlowLayoutRules.md): A class representing a set of rules that define the behavior of the (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_FlowLayout.md) class.
- [FlowLayoutTraits Enumeration](Markdown/T_MindFusion_Layout_FlowLayoutTraits.md): Values used as keys in (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_FlowLayout.md) rules.
- [HierarchicalLayoutTraits Enumeration](Markdown/CC_T_MindFusion_Layout_HierarchicalLayoutTraits_0.md): Indicates item traits specific to hierarchical layouts. Members of this enumeration can be used as keys in the DiagramItem.LayoutTraits hashtable.
- [LayeredLayoutTraits Enumeration](Markdown/CC_T_MindFusion_Layout_LayeredLayoutTraits_0.md): Indicates item traits specific to layered layouts. Members of this enumeration can be used as keys in the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#layouttraits) hashtable.
- [LayoutRules Class](Markdown/T_MindFusion_Layout_LayoutRules.md): Summary description for (Markdown/T_MindFusion_Layout_LayoutRules.md).
- [NodeRules Class](Markdown/T_MindFusion_Layout_NodeRules.md): Represents a set of rules that are applied according to the logic identifiers of node pairs.
- [OrderDirection Enumeration](Markdown/T_MindFusion_Layout_OrderDirection.md): Values controlling the direction of link segments in (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_FlowLayout.md) rules.
- [Pair Class](Markdown/T_MindFusion_Layout_Pair.md): Represents a coupling between two arbitrary objects.
- [PartitionMethod Enumeration](Markdown/CC_T_MindFusion_Layout_PartitionMethod_1.md): Identifies graph partitioning methods supported by (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_CompositeLayout.md).
- [PreferredRules Enumeration](Markdown/T_MindFusion_Layout_PreferredRules.md): Specifies which set of rules to use.
- [RouteHeuristics Delegate](Markdown/CC_T_MindFusion_Layout_RouteHeuristics_2.md): The link routing algorithm uses a heuristic function of this type in its prediction steps.
- [RoutingOptions Interface](Markdown/CC_T_MindFusion_Layout_RoutingOptions_1.md): Allows customization of various aspects of the link routing algorithm.
- [SimpleKeys Class](Markdown/T_MindFusion_Layout_SimpleKeys.md): Defines keys that can be used to define (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_FlowLayout.md) rules.
- [SimpleLinkLogic Class](Markdown/T_MindFusion_Layout_SimpleLinkLogic.md): Contains link identifiers for the predefined (Markdown/T_MindFusion_Layout_SimpleRules.md) set of rules.
- [SimpleNodeLogic Class](Markdown/T_MindFusion_Layout_SimpleNodeLogic.md): Contains node identifiers for the predefined (Markdown/T_MindFusion_Layout_SimpleRules.md) set of rules.
- [SimpleOrientation Enumeration](Markdown/T_MindFusion_Layout_SimpleOrientation.md): Specifies the preferred orientation for the main connector type in (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_FlowLayout.md).
- [SimpleRules Class](Markdown/T_MindFusion_Layout_SimpleRules.md): Class of simple rules requisited for (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_FlowLayout.md) algorithm.
- [SpringLayoutMethod Enumeration](Markdown/CC_T_MindFusion_Layout_SpringLayoutMethod_0.md): Specifies what energy model (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_SpringLayout.md) should use for the simulation.
- [SpringLayoutTraits Enumeration](Markdown/CC_T_MindFusion_Layout_SpringLayoutTraits_1.md): Indicates item traits specific to (Markdown/T_MindFusion_Diagramming_Avalonia_Layout_SpringLayout.md). Members of this enumeration can be used as keys in the (Markdown/T_MindFusion_Diagramming_Aval...
- [SwimlaneLayoutTraits Enumeration](Markdown/CC_T_MindFusion_Layout_SwimlaneLayoutTraits_1.md): Indicates item traits specific to swimlane layouts. Members of this enumeration can be used as keys in the DiagramItem.LayoutTraits hashtable.
- [TreeLayoutTraits Enumeration](Markdown/CC_T_MindFusion_Layout_TreeLayoutTraits_0.md): Indicates item traits specific to tree layouts. Members of this enumeration can be used as keys in the (Markdown/T_MindFusion_Diagramming_Avalonia_DiagramItem.md#layouttraits) hashtable.
- [TreeMapLayoutTraits Enumeration](Markdown/T_MindFusion_Layout_TreeMapLayoutTraits_0.md): Indicates item traits specific to tree map layouts. Members of this enumeration can be used as keys in the DiagramItem.LayoutTraits hashtable.
### Namespace MindFusion.Layout.Layout3D
- [Surface Enumeration](Markdown/CC_T_MindFusion_Layout_Layout3D_Surface_1.md): Contains values specifying the type of surface on which nodes are initially placed when running 3D SpringLayout.
### Namespace MindFusion.Vsx
- [Action Class](Markdown/T_MindFusion_Vsx_Action.md): Represents an action in a Visio shape.
- [Connection Class](Markdown/T_MindFusion_Vsx_Connection.md): Represents a connection point in a Visio shape.
- [Control Class](Markdown/T_MindFusion_Vsx_Control.md): Represents a control point in a Visio shape.
- [Ellipse Class](Markdown/T_MindFusion_Vsx_Ellipse.md): Represents an ellipse, defined by two incident points and a center.
- [EllipticalArc Class](Markdown/T_MindFusion_Vsx_EllipticalArc.md): Represents an elliptical arc defined by three incident points, rotation angle and axes ratio.
- [Geometry Class](Markdown/T_MindFusion_Vsx_Geometry.md): Represents a geometry in a Visio shape.
- [GeometryOperator Class](Markdown/T_MindFusion_Vsx_GeometryOperator.md): Represents the base class for all geometry operators.
- [GeometryStorage Class](Markdown/T_MindFusion_Vsx_GeometryStorage.md): Represents a geometry object, which is defined by up to six parameters.
- [GeometryVisitor Class](Markdown/T_MindFusion_Vsx_GeometryVisitor.md): Represents a visitor of a (Markdown/T_MindFusion_Vsx_Geometry.md) object.
- [IPlatformHelper(TColor, TImage) Interface](Markdown/T_MindFusion_Vsx_IPlatformHelper.md): An object that provides platform-specific functions, such as creating an image or color.
- [Master(TColor, TImage) Class](Markdown/T_MindFusion_Vsx_Master.md): Represents a master Visio shape.
- [Point Class](Markdown/T_MindFusion_Vsx_Point.md): Represents a 2-dimensional point.
- [Property Class](Markdown/T_MindFusion_Vsx_Property.md): Represents a property in a Visio shape.
- [Rect Class](Markdown/T_MindFusion_Vsx_Rect.md): Represents a 2-dimensional rectangle.
- [Shape(TColor, TImage) Class](Markdown/T_MindFusion_Vsx_Shape.md): Represents a Visio shape.
- [Stencil(TColor, TImage) Class](Markdown/T_MindFusion_Vsx_Stencil.md): Represents a Visio stencil.
- [UserValue Class](Markdown/T_MindFusion_Vsx_UserValue.md): Represents a user value in a Visio shape.