AutoScroller for Silverlight ScrollViewer

This is a small project I released as open source some time ago. It facilitates programmatic scrolling of a ScrollViewer in Silverlight.

ScrollViewer is a sealed class. Applying the functionality to it via a separate class seems like a neat approach.

Below is an example of its application. The functionality is applied by default in the example. Clicking the off button shows the default behaviour of the ScrollViewer. For convenience, this example is included in the source code download.

[silverlight: autoscrollviewer.xap]

The first three buttons on the right set the mode property of the AutoScroller. The ‘New Rectangle’ button adds a shape that may be dragged around the canvas, to demonstrate the autoscrolling functionality.
Automatic scrolling can be set directly also via the ScrollLeft, ScrollUp, SrollRight, ScrollDown properties. Lastly, there are properties to set the scrolling speed and the size of the canvas area that triggers the scrolling in Mode.Drag and Mode.Auto.

Download:

AutoScroller DLL
AutoScroller Source Code

12 Replies to “AutoScroller for Silverlight ScrollViewer”

  1. This snouds like a great project to test the publicized capabilities for the new Silverlight. Good luck. I can’t wait to see this. It snouds like you’ll need some extra time on your hands to knock this one out.

    1. Thanks 🙂 I intend to put something online in the next few weeks, which will include what I’ve discussed in this blog. I’m very happy with the Silverlight framework.

      1. (received via email)I saw your blog post regarding ginettg into Silverlight. Let me know if there’s anything I can do to help out I know it can be frustrating to get rolling, but it’s pretty nice when you do.Regarding the development platforms, Blend and Visual Studio should not be looked at as separate environments so much as complementary tool sets. Yes, you can make apps in both, but I couldn’t see working with only one or the other. Blend’s strength is the graphical portion of layout, storyboard creation, object development, etc., while Visual Studio is (obviously) where the work gets done.I did use both tools in my book, but spent the majority of time in code. Still, I find Blend to be fairly intuitive and good at what it does.Feel free to drop me a line if you have any questions.Jeff Paries

        1. Hi Jeff. I’ve been using Silverlight since the first beta of SL2. I remember there being the occasional hiccup early on alright, but I wouldn’t have called it frustrating personally. I think it has really matured since then in any case. I find it a very nice framework to work with overall.

          I agree that Blend and Visual Studio are complimentary tools. Indeed, it would have been difficult to get by without using Blend before SL4/VS2010. [That was when they implemented proper XAML rendering and interaction in the VS designer.] However nowadays, with the sort of stuff I do, I just stay in VS more often than not.

          1. I went to the Orange County event and I recommend pelpoe to attend the Silverlight Design Days.The labs were very detailed and I learned a lot from them.We also were treated like Kings with free food and drinks all day. Didier

        2. Hi,I have worked with large dastabae oriented applications, but there was not much performance problem. The only thing is every time you want to connect to DB you have to make a WCF service call.

    2. (my response to Jeff, via email)I think part of my foistraturn with Silverlight also stems from the fact that I have to buy Expression Blend (which is expensive!). I really like Visual Web Developer Express, which I use for a bunch of ASP.NET and C# apps, but there doesn’t seem to be an option for using Expression Blend without shelling out $500. I use Visual Studio 2008 at my office, and I can guarantee they won’t be spending more money unless I can really prove it’s worth the cost.

      1. Hi Kunal,Explanation is very nice. I have downloaded and test the code. Its peflectry working for Button style setter but not for Listbox. I tried to debug the binding; MyCollection is null; I have assigned the collection of Person to MyCollection.

  2. Pingback: WindowsDevNews.com
    1. This Visual Search is kind of frustrating beascue you can’t search anything: you can just browse some Bing categories ! I guess most people will not understand what’s the real added value here except a nice scrolling animation ?

  3. Hi Peter,

    I tried to use this dll while dragging an item in listbox, and listbox is within scrollviewer. Autoscroll works fine while mouse reaches at bottom of listbox but when dragging listbox item it did not work as shows exception when i tried to set AutoScroller mode Drag.

    Can you please help me.

    Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *