Page Index Toggle Pages: 1 [2]  Send TopicPrint
Hot Topic (More than 10 Replies) Possible deserialization Issue (Read 12218 times)
Paul Eden
Full Member
***
Offline



Posts: 128
Joined: Aug 15th, 2007
Re: Possible deserialization Issue
Reply #15 - May 15th, 2009 at 1:05pm
Print Post  
Hi


Any updates on this one?


Many thanks

Paul
  
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Possible deserialization Issue
Reply #16 - May 15th, 2009 at 1:54pm
Print Post  
Hi,

We couldn't find any way to handle that automatically. We can add SerializeControl and DeserializeControl events you could handle to implement serialization yourself, or otherwise define the styles as application resources.

Stoyan
  
Back to top
 
IP Logged
 
Paul Eden
Full Member
***
Offline



Posts: 128
Joined: Aug 15th, 2007
Re: Possible deserialization Issue
Reply #17 - May 21st, 2009 at 12:19pm
Print Post  
The events could be useful - I'm hoping to not need them, but even if I don't others may gain benefit from them.

Still on the subject of serialization, if I put a business object that implements the ISerializable interface in the tag of a container node (as an example) then saving the diagram will fire the GetObjectData method.
If I create a DiagramNode and set the UIEelement to a custom UserControl that implements the same interface, the GetObjectData method does not fire (neither does the deserialization constructor). Do I need to implement a diferent interaface if i require custom serialization on my controls or is ther an issue here?

Many thanks.

Paul
  
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Possible deserialization Issue
Reply #18 - May 21st, 2009 at 1:07pm
Print Post  
The control calls the ISerializable interface when saving tags, but uses XamlWriter to save controls. We could add some support for ISerializable of hosted controls too, with some option to let you choose the type of serialization mechanism to use.

Stoyan
  
Back to top
 
IP Logged
 
Paul Eden
Full Member
***
Offline



Posts: 128
Joined: Aug 15th, 2007
Re: Possible deserialization Issue
Reply #19 - Jun 25th, 2009 at 2:58pm
Print Post  
Sorry to keep dragigng this one out - shifting prioreties etc...

Above you mention that you use XMLSerialzer for tags - is this any property on a UserControl that is called Tag, or is there more to it than that?

Thanks

Paul

After further experimentation, I gather only the Tag property on the DiagramNode is serialized in this way; it doesn't check to see if hosted controls have a Tag property?
« Last Edit: Jun 25th, 2009 at 4:18pm by Paul Eden »  
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Possible deserialization Issue
Reply #20 - Jun 26th, 2009 at 5:40am
Print Post  
The control uses ISerializable to save DiagramItem.Tag and TableNode.Cell.Tag values. It doesn't do that for the Tag property of hosted controls, though I suppose the XamlWriter might do that as a fallback when there is no type converter available for the Tag type.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send TopicPrint