How can I add scrolling support in the AnimatedCanvas sample

Views for WPF Forum

Posted 9 years ago by Craig - Varigence, Inc.
Version: 10.1.0522
Avatar
I've been looking at the AnimatedCanvas sample in the Actipro sample browser and am wondering how scrolling support could be added. I tried various ways of wrapping the canvas in a ScrollViewer, but I've hit various exceptions.

Is there a way it can be done? Does AnimatedCanvas have any built in scrolling capability that I'm somehow missing?

Thanks,

-Craig

Comments (1)

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Craig,

The AnimatedCanvas doesn't have any scrolling capability, but should work fine in a ScrollViewer. Something like the following code works fine:

<ScrollViewer>
<views:AnimatedCanvas>
<Button views:AnimatedCanvas.Left="25" views:AnimatedCanvas.Top="25" Content="TopLeft" />
<Button views:AnimatedCanvas.Right="25" views:AnimatedCanvas.Top="25" Content="TopRight" />
<Button views:AnimatedCanvas.Right="25" views:AnimatedCanvas.Bottom="25" Content="BottomRight" />
<Button views:AnimatedCanvas.Left="25" views:AnimatedCanvas.Bottom="25" Content="BottomLeft" />
</views:AnimatedCanvas>
</ScrollViewer>

If you are getting exceptions, then please put together a small sample project and email it over to our support address. Once we have that project, we can look into the issue. Make sure to remove any executables from the zip archive.

If you are trying to use the AnimatedCanvas in a ListBox, then you would have to set a MinWidth/MinHeight on it. By default, it will only take as much space as it's given, which in the case of the ListBox would be enough to fill the ListBox.


Actipro Software Support

The latest build of this product (v2019.1 build 0681) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.