Infinite Scrolling in Canvas

Sep 12 2011 4:00 PM
Hi,
 
I am working on canvas and need to implement infinite scrolling towards the top and bottom.
 
I have a grid which contains the scrollviewer whose content is the custom canvas. The canvas contains some custom objects which have been drawn over the canvas and bears the drag and drop functionality.
 
When I drag any object towards right/bottom, scroll bars appear and gives space to put the object.
However, this functionality is not there for top/left scrolling. So, when a object is dragged towards left/top and it reaches the end, the canvas is not resized in order to accomodate the new position of object.
I know, its because canvas has a origin as 0,0 and width and height as infinite.
Currently, user has to 'Select All' all the displayed objects in the canvas and drag towards the right/bottom in order to create a new object towards left/top of it.
 
Searched and found this link http://www.eggheadcafe.com/software/aspnet/32319058/wpf--scroll-canvas-to-objects-beyon-top-or-left-side.aspx[] of some help, unfortunately unable to mimic the behavior in my application.
Is the use of MeasureOverride() and ArrangeOverride() method appropriate in this situation? Please share any good link for explanation of these API's.
 
The best example for infinite scrolling towards right/bottom is Excel sheet. I am looking for the same behavior for left and top.
 
Please let me know for any clarifications.
 
Thanks in advance!!!