Hi Stoyo,
Many thanks for such quick reply.
As you described I had placed
diagram.ZoomToRect(GetContentBounds());
SetZoom(diagram.ZoomFactor);
in Window1_Loaded() but the scroll bars are still at the same positions.
Also I had made the change in the 'divide area' handler and checked, again the same behaviour of scroll bars...
In case when the zoom factor for diagram is more than 100 then using the SetZoom() the scroll bars do come at the center but not able to place them at the center in case of initial load.
Please provide some inputs.
And thanks for providing a pointer that the exception can be thrown if the window is not completely loaded. It had solved my problem.
I had moved my code to window loaded and now all is working fine.
Many thanks again....
But please provide some inputs on the scrollbar positon issue.!!!
Thanks,
Priyanka