1
votes

I have a custom canvas control which sits inside a scrollviewer - I have implemented drag, drop and move for items on the canvas and overridden MeasureOverride so that when I move an item around on the canvas its size reflects the changes so if I move the item beyond the visible portion of the canvas it will resize to accommodate the moved item and scrollbars will show appropriately.

However if I then bring the item into view by using the scrollbars then start to move the item back out again the scrollbars go a bit haywire.

It's a rather poor explanation of the problem I afraid but I am not sure how else to put it but hopefully it will contain enough info for somebody to point me in the right direction.

1

1 Answers

1
votes

Yes you are right, more explanation of problem is required. Although I was also in a situation where I faced a lot of issues with Canvas and scroll-viewer, look at this question for problems I faced and how I solved that -

ScrollBars are not visible after changing positions of controls inside a Canvas

I had to use base.InvalidateMeasure() explicitly after each operation to refresh the canvas and make the scrollbars visible.