Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Databinding Nodes/Links and Auto-Layout (Read 2500 times)
KillaChris19
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 8
Joined: Mar 9th, 2018
Databinding Nodes/Links and Auto-Layout
Mar 9th, 2018 at 3:47pm
Print Post  
Hello,
I'm currently testing the WPF Diagramming Component for my company and I have some questions about Databinding.
I already did some researches on the forum and found out following things (Please correct me if I'm wrong)

- Databinding for Nodes and Links is only supported in VirtualizingDiagram, but not in the normal Diagram
- I need X and Y Properties on my Nodes and (Width/Height or I set default node size)

So I assume that it is not possible to use Databinding for Nodes/Links and have an automatic Layout at the same time?
Or is there something I've missed?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3448
Joined: Oct 19th, 2005
Re: Databinding Nodes/Links and Auto-Layout
Reply #1 - Mar 9th, 2018 at 5:44pm
Print Post  
Hi,

Check if this method helps -
https://mindfusion.eu/Forum/YaBB.pl?num=1306412889/1#1

>> I need X and Y Properties on my Nodes and (Width/Height or I set default node size)

Either that, or return coordinates from Diagram.ResolveNodePosition callback to specify position of data item. There's Arrange(VirtualizingDiagram) overload in layout classes that should let you arrange the virtual diagram too.

Another way you could approach it is consider the diagram only as a lower-level graphics view, create a VideModel class to whose properties you bind your Model data, and in the ViewModel keep a map from data items to diagram items and update the latter when data changes.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
KillaChris19
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 8
Joined: Mar 9th, 2018
Re: Databinding Nodes/Links and Auto-Layout
Reply #2 - Mar 16th, 2018 at 12:38pm
Print Post  
Thanks for the answer Smiley
I've written my own wrapper around the DiagramView so it's working like a charm Smiley
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint