Hands-on experiment
Experiment 2: direction, sticking and semantic scaling
September 2012
Brief introduction
One feature of the excellent Windows application Store application is that it adapts to different sizes of screens and handles the rotation between landscape and portrait modes. It must also respond with a sticker that allows two applications to share the screen and run side-by-side.
Another feature related to screen size is semantic scaling. Unlike visual scaling, it simply scales the content on the screen by responding to user interactions such as shrink gestures, and when the user zooms in or out, semantic scaling modifies the content rendering to show more or less detail.
In this experiment, you will add three important user interfaces related to Contoso cookbook on the basis of experiment 1. First, when the screen rotates, you customize the layout of the item-Detail and group-detail pages. Then, when the application is attached, you will customize the item-Detail page. Finally, you will implement semantic scaling in the Start page and view all recipes groups on a single screen.
Goal
This experiment will show you how to:
Customize the user interface when the device is rotated.
Customize the user interface when the application is posted.
Implementation of semantic scaling.
System Requirements
You need the following software to complete this experiment:
Microsoft Windows 8
Microsoft Visual Studio 2012
Set up
You must perform the following steps to prepare the computer for this lab:
Install Microsoft Windows 8.
Install Microsoft Visual Studio 2012.
Practice
This hands-on experiment includes the following exercises:
Device direction
Stick on
Semantic scaling
Estimated time of completion of this experiment: 40-60 minutes.
Exercise 1: Device orientation
Windows 8 is designed to run on a variety of devices, including tablets and other devices. Through onboard sensors, these devices know whether they are in landscape or portrait mode. A page that is displayed well in landscape mode may need to be adjusted to display well in portrait mode, and vice versa.
Note: You do not have to perform exercise 1 with a tablet computer. You can test the direction code in the Windows emulator, which can be accessed directly in Visual Studio. To select the emulator as the target, select Simulator from the Drop-down list in the following illustration. The next time you start the application, it will start in the Windows emulator.
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/net/