Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Custom shape and SaveToString issue (Read 2237 times)
Mas-Tool
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 5
Joined: Feb 5th, 2010
Custom shape and SaveToString issue
Mar 20th, 2010 at 8:40pm
Print Post  
Hello,
I'm making a custom node shape with the following code:

ShapeNode recStart = diagram.Factory.CreateShapeNode(new Rect(0,0,130,52));

recStart.Shape = new MindFusion.Diagramming.Wpf.Shape(
new ElementTemplate[]
{
new LineTemplate(0, 100, 50, 74),
new LineTemplate(50, 74, 100, 100),
new LineTemplate(100, 100, 100, 0),
new LineTemplate(100, 0, 50, 0),
new LineTemplate(50, 0, 0, 0),
new LineTemplate(0, 0, 0, 100)
},
new ElementTemplate[]
{
}, null, FillRule.Nonzero);

but it seems that when i use the SaveToString and LoadToString the custom shape is gone, and i get a normal rectangle.

Anything i can do to solve this ?
Thanks in advance,
Miky.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Custom shape and SaveToString issue
Reply #1 - Mar 21st, 2010 at 7:14am
Print Post  
Hi Miky,

At this time the shapes of nodes are saved only by their IDs. You can specify an ID through the Shape constructor. Also move the shape definition code to the app's startup / initialization method, so that the Shape definition is available before calling LoadFromString.

If you need more custom shapes, you could save them in a shape library file, and call ShapeLibrary.LoadFrom when the application loads.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Mas-Tool
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 5
Joined: Feb 5th, 2010
Re: Custom shape and SaveToString issue
Reply #2 - Mar 23rd, 2010 at 9:11pm
Print Post  
Just perfect !
Many thanks !  Grin
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint