Garph as a user control

Apr 8, 2010 at 3:20 PM

I have write a User control in xmal where the graph draw and consume this in the win form when i debug the project it will generate the graph but not display that on the form. can any one suggest me this one or send me this kind of sample where a grap[h is generated as user control and consumed any where also need to define the tooltip and right clik on edge or node remove that one.

Thanks in advance Nitin Singhal 

Apr 9, 2010 at 11:36 AM

My requirement is to show tool tip on edge as well as on vertices and on right click of vertices or edge i can remove the node or edge. i suppose this sample is tightly bound for the functionality. due to which i am not able to make changes in the sample graph code. Please help me or send me a examle code for these functionalities.

 

Thanks

Nitin Singhal

Apr 15, 2010 at 3:27 PM

This is a badly formulated question... please provide more information on what you did, any sample, etc.

Developer
Apr 14, 2011 at 2:18 PM
Edited Apr 18, 2011 at 6:06 PM

I am having a similar issue.  I basically took the example (from youtube), created a WPF User Control.  I then took that user control and added it to a Win Form using an ElementHost.  Everything compiles and it debugs, however when the control is displayed on the WinForm the actual nodes aren't visible.  The nodes may be drawn somewhere on the graph but I cannot see them.

Any suggestions on what could be happening are most welcome.  If I find a solution I'll post it here.

 

I had a very stupid mistake in my code.  Add the below to your partial class for the WPF User Control:

 

DataContext = this;

 

Adding the above line should allow the graph to grab the data you're attempting to use (ie: if you're creating the data manually like I did in my test).  Hopefully this helps someone.