Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to save ZoomFactor when Diagram is saved (Read 1388 times)
chris
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 57
Joined: Feb 1st, 2008
How to save ZoomFactor when Diagram is saved
Jun 10th, 2009 at 10:21pm
Print Post  
Hi Stoyan,

I try to ZoomIn/ZoomOut the Diagram and save it to xml file. But when I get it back, the Diagram is restored to the original size and the ScrollViewer position is not correct.

How can I save the ZoomFactor when Diagram is saved to xml file and bring it back without changing ScrollViewer position?

The code I used to ZoomIn/Out is from the following link:
http://mindfusion.eu/Forum/YaBB.pl?board=wpfdg_disc;action=display;num=123755029...

Thanks a lot!
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to save ZoomFactor when Diagram is saved
Reply #1 - Jun 11th, 2009 at 4:58am
Print Post  
Hi Chris,

When saving, you could use the SaveToXml(XmlDocument) method and add elements for the zoom and scroll values to the XML document. When reading, call LoadFromXml(XmlDocument) and read the zoom and scroll values from your custom elements.

If you have a version with source code, you might look for the internal DiagramView_SaveToXml / LoadFromXml methods and make them public - they save the Zoom, Scroll and Behavior properties in addition to the diagram data.

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