This project has moved and is read-only. For the latest updates, please go here.

Nshape Diagram designer in a wpf application

Apr 7, 2014 at 1:16 PM

I want to display the diagram designer from the Archisketch project in a pannel in a WPF application. I try to use the system.Windows.Forms.Integration to put the diagram in a WindowsFormsHost but it wasn't succesfull because i can't access to the diagram class in my project from my wpf MainWindow.
Can someone help me please?
Apr 7, 2014 at 1:36 PM
I'm not sure what exactly your problem is, but if you have problems with WPF integration, please have a look at the "WPF Demo" sample program shipped with NShape.
It should be enough to add a WindowsFormsHost to your WPF application's main window and add a Display in it (via XAML or code):
Here is an example how to do it in XAML, the 'code behind' way is shown in the "WPF Demo".
<Window x:Class="NShape_WPF_Demo.MainWindow"
            <NShapeUI:Display Name="display" />
If this does not help you, please describe your problem a bit more detailed (perhaps with some code).
Apr 7, 2014 at 3:05 PM
Thank you, That's help me.
The "display" panel is now visible (yellow). But i need, now, to display the "diagram" panel (red) into the "display" panel!
Apr 8, 2014 at 7:58 AM
display.Diagram = new Diagram("My Diagram");
In order to learn the basic concepts of NShape, I would strongly recommend to work through the tutorial in order to learn how to create diagrams and shapes, change the shape appearance and many other useful things.
You can find it in the documentation (typically you will find it in C:\Program Files (x86)\NShape\Documentation\NShape.chm), chapter "Basic Tutorial".
Apr 8, 2014 at 9:58 AM
ok! thank you for your help!