Book Image

Windows Phone 7 Silverlight Cookbook

By : Jonathan Marbutt, Robb Schiefer
Book Image

Windows Phone 7 Silverlight Cookbook

By: Jonathan Marbutt, Robb Schiefer

Overview of this book

Silverlight has revolutionized development using Microsoft technologies. It is an excellent tool for mobile application development. The XAML-based markup and familiar C# code are the perfect combination for building apps efficiently and with minimum hassle.Packed full of recipes containing comprehensive instructions for the tasks required to build modern compelling smartphone apps using Silverlight.Starting with application design and architecture, you will quickly move on to more technical features and APIs you can implement to make your app stand out. You will use the Camera API to scan barcode, location services to pinpoint the user’s GPS coordinates and accelerometer to provide feedback based on movement of the phone. All of these features can be provided in a slick user interface through the power of Silverlight. Animations, behaviors and XAML provide all you need and more.
Table of Contents (18 chapters)
Windows Phone 7 Silverlight Cookbook
Credits
Foreword
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Orienting your app


Certain functions on a handheld device are better suited for viewing in landscape mode versus portrait mode. Windows Phone, like its competitors, can automatically change the display's orientation depending on the orientation of the phone. By default, a new Windows Phone project only supports portrait mode.

The automatic handling of orientation is a feature which is built into many of the standard phone controls. In most cases, the control will rotate to the proper orientation and resize to fit the screen. Many times, developers are not required to handle orientation changes at all. There are cases, however, when the UI would be more functional with a more drastic change in the layout. Windows Phone provides developers with the hooks they need to manually handle orientation changes when necessary.

In this recipe, we will create a simple web browser application which allows the user to enable automatic orientation handling or lock the orientation to portrait or landscape...