Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic ShapeNode tag (Read 1098 times)
tmtton
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 39
Joined: May 9th, 2008
ShapeNode tag
Dec 3rd, 2008 at 11:15pm
Print Post  
I have user data tagged to a ShapeNode. I need to get this data upon the node selection; but the tag is null in the selectionChanged event handler.

private void diagram_SelectionChanged(object sender, EventArgs e)
{
    foreach (ShapeNode node in diagram.Selection.Nodes)
    {
        // My tag is always null here?

        if (node.Tag != null)
        {
            // ...
        }
    }
}
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ShapeNode tag
Reply #1 - Dec 4th, 2008 at 7:56am
Print Post  
Add to the SelectionChanged handler a foreach loop over Diagram.Nodes and print the node tags using Debug.WriteLine(). Are there any tags different from null at all? If the tags are lost after loading a file or copy/paste, check if your tag objects are serializable. Also check if the Tag is not set to null in some other selection related event handler.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint