Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Load Diagram (Read 2892 times)
Amosius
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 75
Joined: Sep 2nd, 2010
Load Diagram
Nov 8th, 2010 at 3:32pm
Print Post  
Hello,

i have two different Diagram objects:
Code
Select All
Diagram currentdiagram;
Diagram loadeddiagram; 


I always work with currentdiagram, unless i would like to change currentdiagram to a loaded Diagram (i don't use the included save/load functions).

Now i would like to change my Diagram in my DiagramView from currentdiagram to loadeddiagram.

I tried:
Code
Select All
xamldiagram.datacontext = loadeddiagram; 

and i tried
Code
Select All
currentdiagram = loadeddiagram; 



How can i change my diagram?

Amosius
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Load Diagram
Reply #1 - Nov 8th, 2010 at 3:41pm
Print Post  
Hi,

If you are showing the diagram inside DiagramView, set view.Diagram = loadeddiagram. If you don't actually need to show more than one views of the same diagram, better use a ScrollViewer instead of DiagramView, and set ScrollViewer.Content = loadeddiagram.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Amosius
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 75
Joined: Sep 2nd, 2010
Re: Load Diagram
Reply #2 - Nov 10th, 2010 at 8:09pm
Print Post  
Hi Stoyan,

i changed DiagramView to ScrollViewer.

To load and change the diagram i use now the following code:
Code
Select All
currentdiagram = loadeddiagram;
scrollviewer.Content = currentdiagram; 



I get the loaded Diagram, but this one has not the properties of the diagram in xaml and therefore the behavior is different.

Do i have to set the properties manually again or can i use something like an "reload"?

Amosius
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Load Diagram
Reply #3 - Nov 11th, 2010 at 7:31am
Print Post  
Hi Amosius,

The diagram does not save styles, templates and event handlers in files, so you cannot reload everything just by using the save and load methods. Perhaps you could make loadeddiagram to be an exact copy of currentdiagram in the Xaml file, but keep it hidden, and then the load method will only change the diagrams' content.

Stoyan
  
Back to top
 
IP Logged
 
Amosius
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 75
Joined: Sep 2nd, 2010
Re: Load Diagram
Reply #4 - Nov 11th, 2010 at 3:13pm
Print Post  
Hi Stoyo,

it worked. Thx again.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint