O'Reilly logo

Windows Application Development Cookbook by Marcin Jamro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Arranging controls in a scrollable view

As already mentioned, the StackPanel control does not automatically allow you to scroll its content. For this reason, when the screen is not big enough, some parts could just disappear. Of course, such a situation should not occur. For this reason, in this recipe, you will learn how to use ScrollViewer to scroll the photo gallery created as a collection of images, presented in StackPanel.

Getting ready

To step through this recipe, you only need the automatically generated project.

How to do it...

To arrange controls in a scrollable view to form a simple photo gallery, perform the following steps:

  1. Add four images (named Gallery1.jpg, Gallery2.jpg, Gallery3.jpg, and Gallery4.jpg) to the Assets directory, as explained ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required