Page Index Toggle Pages: 1 [2]  Send TopicPrint
Hot Topic (More than 10 Replies) add a custom property for ShapeNode (Read 8295 times)
kelum
Full Member
***
Offline


I Love MindFusion!

Posts: 100
Joined: Mar 25th, 2017
Re: add a custom property for ShapeNode
Reply #15 - May 2nd, 2017 at 9:24am
Print Post  
is this need to serialize and de-serialize also ?

if I want to access above initiated property in another place, how to get it ?


var allNodes = diagram.Nodes;

foreach (var item in allNodes)
{
// Get the new property Value
string Type = item.Tag.Type;
}
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: add a custom property for ShapeNode
Reply #16 - May 2nd, 2017 at 10:40am
Print Post  
If you want them saved in XML see how it's done in SiteMap example.

Code
Select All
var myTag = (MyTag)item.Tag;
string Type =  myTag.Type; 

  
Back to top
 
IP Logged
 
kelum
Full Member
***
Offline


I Love MindFusion!

Posts: 100
Joined: Mar 25th, 2017
Re: add a custom property for ShapeNode
Reply #17 - May 3rd, 2017 at 8:14am
Print Post  
With your proposed approach I can see Tag Properties and its values come to code level, then How to bind this Tag Properties to show on XML tag ?

I tried following

binding from code level like this

listNodes.ItemsSource = diagram.Nodes;

then In XML file showing above properties like this

<ListBox Name="listNodes" local:GridControl.Row="0" local:GridControl.Column="0">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Vertical">
<TextBlock Text="{Binding Text}" />
<TextBlock Text="{Binding Brush}" />
<TextBlock Text="{Binding Name}" />
<TextBlock Text="{Binding Type}" />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>

but this is not showing 'Type' on frontend, how to show it ?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: add a custom property for ShapeNode
Reply #18 - May 3rd, 2017 at 9:15am
Print Post  
{Binding Tag.Type} should work.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send TopicPrint