ScatterView Inside ZoomCanvas

May 9, 2011 at 4:31 PM

Hi there,

I placed a ScatterView inside a ZoomCanvas. This works fine until I pan the ZoomCanvas:

The ScatterView keeps its size, and ScatterViewItems cannot be moved outside the ScatterView's boundaries.
So, I can pan around and zoom in/out without problems, but my items cannot use the provided infinite canvas, as they stay within the ScatterView's boundaries.

Any idea how to address this? Many thanks,
Dominik

 

Coordinator
May 9, 2011 at 4:53 PM

That is the expected behavior with the stock ScatterView control. You'll need to either create a custom ScatterView that does not have borders or write some code that increases the ScatterView's size when an SVI gets close to a border.

May 9, 2011 at 5:31 PM

Thanks for the quick reply!

I was experimenting with increasing the ScatterView's size automatically - with a kinda odd effect actually:

The size apparently is increased - I can drag items beyond the original borders. However, everything beyond the original border is clipped (including the ScatterView's background). So, the ScatterView seems to be large enough, but does not show anything outside of its original borders. I also tried setting ClipToBounds to false, without success, though.

Any advice on this issue is highly appreciated. Thanks,
Dominik

Coordinator
May 9, 2011 at 5:45 PM

Try wrapping the ScatterView in a Canvas to fix the clipping issue.

May 9, 2011 at 6:13 PM

Great - did the trick! Thanks!

Aug 18, 2011 at 9:09 PM

Is is possible to share some code to accomplish this feature (adjust size of scatterview so scatterviewitems can use the infinite canvas).

I have no ideo how to implement this.

Thanks.

Aug 20, 2011 at 2:30 PM

Something like this should work:

<controls:ZoomCanvas>
  <Canvas>
    <s:ScatterView>
    </s:ScatterView>
  </Canvas>
</controls:ZoomCanvas>

Aug 21, 2011 at 11:54 PM

I meant the full solution, not only the clipping part.
I'm pretty new to wpf so I would like to know how you increased the scatterview's size automatically, and to what event.

Thanks for the previous reply though.