-
Book Overview & Buying
-
Table Of Contents
Windows Application Development Cookbook
By :
A smartphone or a tablet can be placed in various orientations, such as with the screen faced down, up, or rotated. Fortunately, it is possible to easily get to know which orientation is currently being used and to adjust the design of the page if necessary. In this recipe, you will learn how to use the SimpleOrientationSensor class to get such information.
As an example, you will create a simple page with information about the current orientation. Of course, such content will be updated automatically as soon as the reading has changed.
To step through this recipe, you only need the automatically generated project.
To prepare an example presenting an information about the current orientation of the device, perform the following steps:
MainPage.xaml file as follows...