Canvas scrolling before zoomin/out when using mouse-wheel

Hi Walter,

Am trying to use the mousewheel to scroll the canvas and I observe that when I try to zoomout the canvas nodes go up first as the scroll bar moves up and then empty area of canvas starts zooming in, similarly for Zoom-in the canvas scrolls first before actual zoomin, and it zooms an empty area. How can I prevent this scroll of canvas itself before actual zoom starts and zoom is focused on the area where elements exist? I know this works out of box in goxam, but I am not sure what is causing this diversion, if you could throw some pointers that I could verify.?

That’s very odd. Which Diagram events are you listening to, and what do those listeners do?

Have you overridden any Diagram or DiagramPanel methods?

Turns out this was due to a docking layout of devexpress we use in our application. Found the solution from this ticket, it was God sent, else I would never be able to fix this. GoWPF 3.0.3 - Cant zoom out

@vibha

You are welcome :)

@walter

Happy new year :)

Am also trying to zoomin/out on button clicks. For large diagrams am seeing I get stackoverflow exception on 1st click. I do double

newScale = Diagram.Panel.Scale * 1.1;
if (newScale > Diagram.Panel.MaximumScale)
{
newScale = Diagram.Panel.MaximumScale;
}
Diagram.Panel.Scale = newScale;

Maybe your ViewportBoundsChanged listener is modifying the DiagramPanel.Scale improperly? Or some other event handler is doing that?

You’ll have to step through the code to see what might be causing the infinite recursion.

Yeah trying to figure out the same, my ViewportBoundsChanged is empty and not doing anything, in particular only large diagrams are causing this exception , so digging in

I had set Diagram.Panel.MinimumScale in the initialLayoutComplete and that caused a recursion when I button click zoomIn. Moved all panel properties/events to TemplateApplied event, and its fine now.

I see in the sample projects an example for scroll modes, but how can I actually set or implement infinitescrolling in the app? Is it possible?

I don’t think we ever implemented that in GoXam. Sorry.

That’s GoDiagram, no GoXam.

The advantage of GoXam is that you can define your Node templates (and Diagram) in XAML. Most if not all other advantages go to GoDiagram.