Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic DataBinding and Silverlight ShapeNode (Read 2513 times)
rajesh_patil74
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 220
Joined: Sep 3rd, 2009
DataBinding and Silverlight ShapeNode
Aug 16th, 2010 at 11:05am
Print Post  
Hi Stoyo

Is databinding is supported with Silverlight diagram controls ?

I have following class defined
class NodeTag
{
     .....
     .....

     public string Title
     {
          get {  return "test"; }

     }
}

And while creating node
ShapeNode node = new ShapeNode(this.diagram);
node.DataContext = new NodeTag();

doesn't show me the node text as "test".

-Rajesh
  
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: DataBinding and Silverlight ShapeNode
Reply #1 - Aug 16th, 2010 at 11:42am
Print Post  
Hi Rajesh,

I suppose you must also add a binding between ShapeNode.Text and NodeTag.Title, either through a template or by code.

Stoyan
  
Back to top
 
IP Logged
 
rajesh_patil74
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 220
Joined: Sep 3rd, 2009
Re: DataBinding and Silverlight ShapeNode
Reply #2 - Aug 16th, 2010 at 11:57am
Print Post  
Oops ! sorry stoyo

The property name is not "Title" but it is "Text".

-Rajesh
  
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: DataBinding and Silverlight ShapeNode
Reply #3 - Aug 16th, 2010 at 1:41pm
Print Post  
You must still add a binding, e.g. in NodeCreated:

Code
Select All
e.Node.DataContext = new NodeTag();
BindingOperations.SetBinding(e.Node,
	ShapeNode.TextProperty, new Binding("Title")); 



If you have a custom template, it should be possible to do that there using Binding instead of ControlBinding for the Text property.

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