Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic WinUI 3 Diagram control preview (Read 2921 times)
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3315
Joined: Oct 19th, 2005
WinUI 3 Diagram control preview
Jul 29th, 2024 at 7:13am
Print Post  
We are beta-testing a WinUI 3 version of the MindFusion.Diagramming library. If anyone is interested in trying it out, please install it from:

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

In order to create a Diagram in Xaml, import the MindFusion.Diagramming namespace:

Code
Select All
<?xml version="1.0" encoding="utf-8"?>
<Window
    ...
    xmlns:diag="using:MindFusion.Diagramming">

	<Grid>
		<ScrollViewer HorizontalScrollBarVisibility="Auto">
		    <diag:Diagram x:Name="diagram" />
		</ScrollViewer>
	</Grid>

</Window>
 



The initial release implements the same API as our WinRT / UWP control, documented at http://www.mindfusion.eu/onlinehelp/diagramrt/index.htm :

Code
Select All
public sealed partial class MainWindow : Window
{
    public MainWindow()
    {
        this.InitializeComponent();

        diagram.Bounds = new Rect(0, 0, 5000, 5000);

        var node1 = diagram.Factory.CreateShapeNode(30, 30, 90, 90);
        node1.Text = "Hello";

        var node2 = diagram.Factory.CreateShapeNode(180, 75, 90, 90);
        node2.Text = "WinUI!";

        diagram.Factory.CreateDiagramLink(node1, node2);
    }
} 



A sample project is available here:
https://mindfusion.eu/DiagramWinUI.zip

We do not support C++ binding at this time. This will be added upon request.

Any comments, questions and general feedback are welcome.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint