Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Diagram does not zoom if placed inside a DiagramView (Read 2290 times)
bogdip
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 70
Joined: Sep 8th, 2008
Diagram does not zoom if placed inside a DiagramView
Oct 17th, 2014 at 9:58am
Print Post  
Hello,

I need to ZoomIn/Out, custom set the ZoomFactor but it seems it doesn't work if the Diagram is placed inside a DiagramView.
Instead, if I place it inside a ScrollViewer, the zooming works fine.

I attach a simple sample.

Is there a way to use the DiagramView and also use the zooming?


Thanks,
Bogdan
  

WPFDiagramInsideWinForm_001.rar (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram does not zoom if placed inside a DiagramView
Reply #1 - Oct 17th, 2014 at 10:17am
Print Post  
Hi,

Set the DiagramView.ZoomFactor property instead of Diagram's one.

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


I love YaBB 1G - SP1!

Posts: 70
Joined: Sep 8th, 2008
Re: Diagram does not zoom if placed inside a DiagramView
Reply #2 - Oct 18th, 2014 at 3:21pm
Print Post  
Thanks, it did the trick. Too bad that ZoomIn or ZoomOut self descriptive methods can't be used in this case.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram does not zoom if placed inside a DiagramView
Reply #3 - Oct 20th, 2014 at 7:47am
Print Post  
You could add them as extensions methods:

Code
Select All
static class DiagramViewExtensions
{
	static public void ZoomIn(this DiagramView view)
	{
		if (view.ZoomFactor < 10)
			view.ZoomFactor += 1;
		else if (view.ZoomFactor < 20)
			view.ZoomFactor += 5;
		else
			view.ZoomFactor += 10;
	}

	static public void ZoomOut(this DiagramView view)
	{
		if (view.ZoomFactor > 20)
			view.ZoomFactor -= 10;
		else if (view.ZoomFactor > 10)
			view.ZoomFactor -= 5;
		else if (view.ZoomFactor > 1)
			view.ZoomFactor -= 1;
	}
} 



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


I love YaBB 1G - SP1!

Posts: 70
Joined: Sep 8th, 2008
Re: Diagram does not zoom if placed inside a DiagramView
Reply #4 - Oct 20th, 2014 at 11:16am
Print Post  
Yes, it helps, thanks.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint