Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Can I get the event after the Diagram has been refreshed? (Read 1444 times)
chowy
Junior Member
**
Offline


I Love MindFusion!

Posts: 72
Joined: May 8th, 2017
Can I get the event after the Diagram has been refreshed?
Oct 30th, 2018 at 8:27am
Print Post  
When I zoom the diagram, I need to get the user's viewable range instead of the visible range of the Diagram(the ruler's range by diagram coordinates). I need the coordinates of the ruler's top left point after zooming on the Diagram. I use the ZoomChanged event, but the coordinates obtained are incorrect, which is the coordinates before the zoom change. So, on the visual tree, I want to get the event after the Diagram is refreshed.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3447
Joined: Oct 19th, 2005
Re: Can I get the event after the Diagram has been refreshed?
Reply #1 - Oct 30th, 2018 at 10:35am
Print Post  
The ruler repaints its scales from ScrollChanged event raised by its internal ScrollViewer, so you should be in sync if you get scroll position from same event -

Code
Select All
void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
	var sv = (ScrollViewer)Utilities.FindAncestor(diagram, typeof(ScrollViewer));
	sv.ScrollChanged += new ScrollChangedEventHandler(sv_ScrollChanged);
}

void sv_ScrollChanged(object sender, ScrollChangedEventArgs e)
{
	Debug.WriteLine(diagram.ScrollX + ":" + diagram.ScrollY);
} 



Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint