Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Preview of MindFusion.Diagramming for Avalonia (Read 301 times)
Forum Admin
YaBB Administrator
*****
Offline


Rock and Roll

Posts: 740
Joined: Apr 6th, 2003
Preview of MindFusion.Diagramming for Avalonia
Jan 26th, 2026 at 7:09am
Print Post  
First preview build of our diagramming library for Avalonia UI is now available as NuGet package:

https://www.nuget.org/packages/MindFusion.Diagramming.Avalonia

This is a technical preview, offering a core subset of the features you know from our WPF library (DiagramView control only, ShapeNode and ContainerNode types, no import/export classes yet).

Here’s how to quickly integrate it into your Avalonia project:

Register the Library

In Program.cs, add the UseMindFusionDiagramming() call to AppBuilder chain:

Code
Select All
using MindFusion.Diagramming.Avalonia;
...
public static AppBuilder BuildAvaloniaApp()
    => AppBuilder.Configure<App>()
        .UsePlatformDetect()
        .UseMindFusionDiagramming()
        .WithInterFont()
        .LogToTrace(); 



Add the XAML Namespace

In your Window or UserControl XAML file, add the MindFusion.Diagramming.Avalonia namespace:

Code
Select All
<Window xmlns="https://github.com/avaloniaui"
        ...
        xmlns:diag="using:MindFusion.Diagramming.Avalonia"> 



Add the DiagramView Control

You can now add DiagramView to your layout:

Code
Select All
<diag:DiagramView x:Name="diagramView" /> 



Interact with the API

The API should look the same to users of our WPF version (https://mindfusion.dev/docs/wpf/diagramming/). The primary difference is the use of Avalonia's native geometry and drawing types (Avalonia.Rect, Avalonia.Point, Avalonia.Media.IBrush, etc).

Here is a simple example of creating a few nodes and a link from your code-behind:

Code
Select All
var diagram = diagramView.Diagram;

var node1 = diagram.Factory.CreateShapeNode(70, 300, 100, 100);
node1.Text = "Hello";
var node2 = diagram.Factory.CreateShapeNode(350, 200, 100, 100);
node2.Text = "Avalonia";
var link = diagram.Factory.CreateDiagramLink(node1, node2);

var ctr = diagram.Factory.CreateContainerNode(30, 30, 200, 200);
ctr.Text = "ctr";

diagramView.AllowInplaceEdit = true; 



Important Notes for This Preview
  • This is an early build. While we have worked to ensure stability, you may encounter issues.
  • The API surface is not yet complete compared to the WPF version, but the core diagramming functionality is in place.
  • As we discovered during the port, Avalonia's immutable structs require a different approach to geometry calculations. You may need to adjust diagram-related code that manipulates Rect and Point objects if porting from WPF or WinForms.

Any comments, questions and general feedback are welcome. We are particularly interested in hearing what features from the WPF version you would like to see prioritized.
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint