Objectives - Microsoft
Hands-On LabOrientation, Snapping, and Semantic ZoomLab version: 1.0.0Last updated: DATE \@ "M/d/yyyy" 6/12/2012Contents TOC \h \z \t "Heading 3,2,pp Topic,1,PP Procedure start,3" Overview PAGEREF _Toc326648981 \h 3Exercise 1: Device Orientation PAGEREF _Toc326648982 \h 4Task 1 – Test the Start Page PAGEREF _Toc326648983 \h 4Task 2 – Customize the Group-Detail Page PAGEREF _Toc326648984 \h 6Task 3 – Customize the Item-Detail Page PAGEREF _Toc326648985 \h 10Exercise 2: Snapping PAGEREF _Toc326648986 \h 15Task 1 – Run Contoso Cookbook in Snapped Mode PAGEREF _Toc326648987 \h 16Task 2 – Modify the Snapped Grouped-Items Page PAGEREF _Toc326648988 \h 17Task 3 – Modify the Snapped Group-Detail Page PAGEREF _Toc326648989 \h 18Task 4 – Modify the Snapped Item-Detail Page PAGEREF _Toc326648990 \h 19Exercise 3: Semantic Zoom PAGEREF _Toc326648991 \h 21Task 1 – Add a SemanticZoom Control to the Start Page PAGEREF _Toc326648992 \h 22Task 2 – Test the Results PAGEREF _Toc326648993 \h 24Summary PAGEREF _Toc326648994 \h 24OverviewOne of the hallmarks of a great Metro style app is that it adapts to screens of various sizes, and it handles rotations between landscape mode and portrait mode. It must also respond to snapping, which allows two apps to share the screen and run side by side.Another pertinent topic related to screen size is semantic zoom. Unlike optical zoom, which simply scales content on the screen in response to user stimuli such as pinch gestures, semantic zoom changes the representation of the content to show more or less detail as the user zooms in and out. Semantic zoom lets users navigate long lists of content without excessive amounts of scrolling; users can zoom out, find what they want, and then select it to go directly to the corresponding location.In this lab, you will build upon Lab 1 by adding three important UI-related features to Contoso Cookbook. First, you will customize the layout of the item-detail and group-detail pages when the screen is rotated. Next, you will customize the layout of the item-detail page when the application is snapped. Finally, you will implement semantic zoom in the start page, enabling users to zoom out and see all the recipe groups on a single screen.ObjectivesThis lab will show you how to:Customize the UI when the device is rotatedCustomize the UI when your application is snappedImplement semantic zoomSystem RequirementsYou must have the following items to complete this lab:Microsoft Windows 8 Release PreviewMicrosoft Visual Studio 2012 RCSetupYou must perform the following steps to prepare your computer for this lab:Install Microsoft Windows 8 Release PreviewInstall Microsoft Visual Studio 2012 RCExercisesThis Hands-On Lab comprises the following exercises:Device OrientationSnappingSemantic ZoomEstimated time to complete this lab: 40 to 60 minutes.Exercise 1: Device OrientationWindows 8 is designed to run on a variety of devices, including tablets and other devices that, through the aid of on-board sensors, know whether they are in landscape mode or portrait mode. A page that looks great in landscape mode may need tweaking to look equally great in portrait mode, and vice versa. In this exercise, you’ll modify Contoso Cookbook to adapt to device orientation.Note: You do not have to have a tablet to perform Exercise 1. You can test orientation code in the Windows Simulator, which you can access directly from Visual Studio. To target the simulator, select “Simulator” from the drop-down list below. The next time you launch the application, it will launch in the Windows Simulator.Task 1 – Test the Start PageLet’s begin by examining the application’s start page in landscape mode and portrait mode to determine whether any changes are needed.Open the ContosoCookbook project you created in Lab 1 in Visual Studio. If you didn’t complete Lab 1 or would like to start with a reference copy, you’ll find a completed version of the lab in the starting materials.With the device in landscape mode, Press F5 to run the application in the debugger. You should see the recipes start page shown in Figure 1.Figure SEQ Figure \* ARABIC 1The start page in landscape modeNow rotate the device to portrait mode. Make sure the screen rotates 90 degrees, and that the start page rotates as well, assuming the layout shown in Figure 2.Note: If you’re testing on a tablet and the start page doesn’t rotate, it might be because autorotation is disabled. Some devices, such as the Samsung tablets given to attendees of the September 2011 BUILD conference, have a hardware switch that locks the screen into its current orientation. If you have such a device, make sure that switch is set to autorotation mode. You can also press Win-O to toggle autorotation on and off.If the hardware you are testing on doesn’t support orientation changes, remember that you can use the Windows Simulator instead. To rotate the simulator, click either of the Rotate buttons in the simulator’s right margin.Figure SEQ Figure \* ARABIC 2The start page in portrait modeThanks to the GridView control that renders the recipe items, the start page looks fine in both landscape and portrait modes, so no additional work is required here.Return to the Visual Studio and stop debugging.Task 2 – Customize the Group-Detail PageThe Contoso Cookbook application comprises three pages: the start page, the group-detail page, and the item-detail page. The start page doesn’t require any modification for portrait mode, so let’s move on to the group-detail page – the one that appears when you tap a group title such as “Chinese” or “Italian.”Start the application again and tap “Chinese” to show the Chinese group-detail page. In landscape mode, the page assumes the layout in Figure 3.Figure SEQ Figure \* ARABIC 3The group-detail page in landscape modeNow rotate the device to portrait mode (see Figure 4). Observe that the GridView control that renders most of the content on this page positions the group details (the recipes) to the right of the group header (the group title, image, and description), which leaves a lot of blank space in the lower half of the screen.Figure SEQ Figure \* ARABIC 4The group-detail page in portrait modeReturn to Visual Studio and stop debugging.Open GroupDetailPage.xaml and find the ListView control whose name is “itemListView.”Immediately after that ListView control, add another ListView named “portraitListView:”XAML<!-- Vertical scrolling list only used in portrait mode --><ListView x:Name="portraitListView" AutomationProperties.AutomationId="ItemListView" AutomationProperties.Name="Items In Group" TabIndex="1" Grid.Row="1" Visibility="Collapsed" Padding="86,0,20,60" ItemsSource="{Binding Source={StaticResource itemsViewSource}}" ItemTemplate="{StaticResource Standard500x130ItemTemplate}" SelectionMode="None" IsItemClickEnabled="True" ItemClick="ItemView_ItemClick"> <ListView.Header> <StackPanel> <Image Source="{Binding Image}" Margin="20,-10,18,0" MaxWidth="480" Stretch="UniformToFill" HorizontalAlignment="Left"/> <TextBlock Margin="20,20,18,30" Text="{Binding Description}" Style="{StaticResource BodyTextStyle}"/> </StackPanel> </ListView.Header></ListView>Scroll further down in GroupDetailPage.xaml and find the VisualState element whose name is “FullScreenPortrait.”Inside that VisualState element, remove the following statements:XAML<ObjectAnimationUsingKeyFrames Storyboard.TargetName="itemGridView" Storyboard.TargetProperty="Padding"> <DiscreteObjectKeyFrame KeyTime="0" Value="100,0,90,0"/></ObjectAnimationUsingKeyFrames>Add the following statements after the statements you just deleted:XAML<ObjectAnimationUsingKeyFrames Storyboard.TargetName="itemGridView" Storyboard.TargetProperty="Visibility"> <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/></ObjectAnimationUsingKeyFrames><ObjectAnimationUsingKeyFrames Storyboard.TargetName="portraitListView" Storyboard.TargetProperty="Visibility"> <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/></ObjectAnimationUsingKeyFrames>Note: The ListView you added defines how recipe groups are rendered in portrait mode. The animations you added hide the GridView used in landscape mode and display the ListView when the view state changes to “FullScreenPortrait.” (Metro view state has nothing to do with view state, so don’t let the term conjure up negative images in your mind!) One of the events that precipitates a view-state change is rotating the device from landscape mode to portrait or portrait to landscape. The view state also changes when the application is “snapped.” Snapping is covered in the next exercise.The code that detects view-state changes is hidden away in the base class from which the app’s pages derive. That class – LayoutAwarePage – registers a handler for the main window’s SizeChanged events and uses the runtime’s VisualStateManager to drive changes from one visual state to another.Run the application, tap “Chinese” to display the group-detail page, and rotate the device to portrait mode. Confirm that the page looks like the one in Figure 5.Figure 5The finished portrait-mode layoutReturn to Visual Studio and stop debugging.Task 3 – Customize the Item-Detail PageThe next task is to tweak the item-detail page so that it is equally efficient in its use of space and pleasing to the eye in both landscape and portrait mode.Start the application again and tap a recipe to show the item-detail page. Figure 6 shows how the page looks in landscape mode.Figure 6The item-detail page in landscape modeNow rotate the device to portrait mode (Figure 7). Once more, the layout that works well in landscape mode needs a bit of tweaking for portrait mode.Figure 7The item-detail page in portrait modeReturn to Visual Studio and stop debugging.Open ItemDetailPage.xaml and find the FlipView control named “flipView.”After that FlipView, add another FlipView control named “portraitFlipView:”XAML<!-- FlipView used in portrait mode --><FlipView x:Name="portraitFlipView" AutomationProperties.AutomationId="ItemsFlipView" AutomationProperties.Name="Item Details" Grid.Row="1" Margin="0,-3,20,0" ItemsSource="{Binding Source={StaticResource itemsViewSource}}" Visibility="Collapsed"> <FlipView.ItemTemplate> <DataTemplate> <UserControl Loaded="StartLayoutUpdates" Unloaded="StopLayoutUpdates"> <ScrollViewer x:Name="scrollViewer" Style="{StaticResource VerticalScrollViewerStyle}" Grid.Row="1"> <!-- Vertical StackPanel for item-detail layout --> <StackPanel Orientation="Vertical" Margin="100,0,20,0"> <StackPanel Orientation="Vertical"> <TextBlock FontSize="26.667" FontWeight="Light" Text="{Binding Title}" TextWrapping="Wrap"/> <Image x:Name="image" Width="400" Margin="0,20,0,40" Stretch="Uniform" Source="{Binding Image}" HorizontalAlignment="Left"/> </StackPanel> <StackPanel Orientation="Vertical"> <TextBlock FontSize="26.667" FontWeight="Light" Text="Ingredients" Margin="0,0,0,16"/> <TextBlock FontSize="20" FontWeight="Light" LineHeight="32.5" Text="{Binding Ingredients, Converter={StaticResource ListConverter}}" TextWrapping="Wrap" /> </StackPanel> <StackPanel Orientation="Vertical"> <TextBlock FontSize="26.667" FontWeight="Light" Text="Directions" Margin="0,24,0,16"/> <ScrollViewer Style="{StaticResource VerticalScrollViewerStyle}"> <Grid> <TextBlock FontSize="20" FontWeight="Light" Text="{Binding Directions}" TextWrapping="Wrap" /> </Grid> </ScrollViewer> </StackPanel> </StackPanel> </ScrollViewer> </UserControl> </DataTemplate> </FlipView.ItemTemplate></FlipView>Note: In landscape mode, the three content areas in the item-detail page – the recipe name, image, and description; the ingredients; and the directions – are laid out in columns of a multi-column Grid declared in the data template of the FlipView control named “flipView.” The FlipView you just added is for portrait mode. It uses a vertical StackPanel to stack the content areas on top of each other.Find the VisualState element whose name is “FullScreenPortrait” near the bottom of ItemDetailPage.xaml. (The one you want is NOT the VisualState element with the same name embedded inside the first FlipView control.)Add the following statements to the Storyboard inside the VisualState element to switch from the “flipView” control to the “portraitFlipView” control you just added when the screen rotates to portrait mode:XAML<ObjectAnimationUsingKeyFrames Storyboard.TargetName="flipView" Storyboard.TargetProperty="Visibility"> <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/></ObjectAnimationUsingKeyFrames><ObjectAnimationUsingKeyFrames Storyboard.TargetName="portraitFlipView" Storyboard.TargetProperty="Visibility"> <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/></ObjectAnimationUsingKeyFrames>Start the application and tap a recipe again to show the item-detail page. Rotate the display to portrait mode and verify that it assumes the single-column layout depicted in Figure 8.0Figure 8The modified portrait-mode layoutRotate back to landscape mode and make sure the page reverts to a 3-column layout.Return to Visual Studio and stop debugging.Exercise 2: SnappingSnapping enables Windows 8 users to run two Metro style apps side by side by splitting the screen horizontally. On a touch screen, you can demonstrate snapping by dragging your finger slowly across the screen starting from left edge and pausing momentarily until a snap bar – a vertical bar splitting the screen – appears. (If you don’t have a touch screen, you can press the Windows key and the period key instead.) Figure 9 shows snapping in action. Contoso Cookbook occupies the left 320 pixels of the screen, while Internet Explorer occupies the remaining portion. In this context, Contoso Cookbook is the “snapped app” and Internet Explorer is the “main app” or “filled app.” If desired, the user can drag the snap bar across the screen and reverse the apps’ roles.Figure 9Snapping in actionContoso Cookbook already has some snapping behavior built in, thanks to the XAML that Visual Studio included in the pages it generated for the project. In this exercise, you will apply a simple change to one of those pages to improve the user experience.Note: To see snapping in action, you must be running Metro on a device with a screen resolution of at least 1,366 by 768 pixels. The Windows team chose 1,366 as the minimum because it affords the snapped app a section of the screen that is 320 pixels wide and the main app a section that is 1,024 pixels wide. The extra pixels are consumed by the snap bar. If you’re running on a lower resolution screen, use the Windows Simulator for this exercise and select a simulated screen resolution of at least 1366x768.Task 1 – Run Contoso Cookbook in Snapped ModeIn this task, you will view each of Contoso Cookbook’s three pages when the application is snapped.Press F5 to start the application from Visual Studio. Then go back to the Windows start screen and launch another application such as Internet Explorer. With that application now occupying the screen, place a finger on the left edge of the screen and slowly drag it to the right. When Contoso Cookbook appears under your finger, pause until the snap bar appears. Then lift your finger to snap Contoso Cookbook into place.When Contoso Cookbook only occupies a portion of the screen, how does its start page differ from when it’s displayed full-screen?Tap one of the group names (for example, “Chinese”) on the start page to see the group-detail page in snapped mode. How does it differ from its full-screen equivalent?Tap one of the recipes to see the item-detail page in snapped mode. How does its content and layout compare to when it’s running full screen?Return to Visual Studio and stop debugging.Task 2 – Modify the Snapped Grouped-Items PageThe default snapped layouts provided by Visual Studio were a great start, but you can further customize them if desired. In Contoso Cookbook, we need to modify the snapped item-detail page, because the default layout leaves a lot of empty real estate in the portion of the screen that the page occupies – real estate that could be used to show additional information about the recipe. We also need to make minor adjustments to the grouped-items page and group-detail page. Let’s start with the grouped-items page.Open StandardStyles.xaml in the project’s Common folder and find the DataTemplate named “Standard80ItemTemplate.”Replace that DataTemplate with this one:XAML<DataTemplate x:Key="Standard80ItemTemplate"> <Grid Margin="6"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto"/> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> <Border Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}" Width="80"> <Image Source="{Binding Image}" Stretch="UniformToFill"/> </Border> <StackPanel Grid.Column="1" Margin="10,0,0,0"> <TextBlock Text="{Binding ShortTitle}" Style="{StaticResource ItemTextStyle}" MaxHeight="40"/> <StackPanel Orientation="Horizontal"> <TextBlock Text="Preparation time:" Style="{StaticResource CaptionTextStyle}" /> <TextBlock Text="{Binding PrepTime}" Style="{StaticResource CaptionTextStyle}" Margin="4,0,4,0" /> <TextBlock Text="minutes" Style="{StaticResource CaptionTextStyle}" /> </StackPanel> </StackPanel> </Grid></DataTemplate>Press F5 to launch the application.Snap the application and confirm that it looks like the one pictured in Figure 10.Figure 10The modified grouped-items page in snapped modeReturn to Visual Studio and stop debugging.Task 3 – Modify the Snapped Group-Detail PageThe group-detail page needs some minor tweaking to improve its layout, too. Let’s make those changes and test the results.Open GroupDetailPage.xaml and find the ListView control named “itemListView.”Remove the first TextBlock from the control’s <ListView.Header> element. Also change the left margin on the Image and the remaining TextBlock from 20 to 10. Here is the finished element:XAML<ListView.Header> <StackPanel> <Image Source="{Binding Image}" Margin="10,0,18,0" MaxHeight="160" Stretch="UniformToFill"/> <TextBlock Margin="10,20,18,30" Text="{Binding Description}" Style="{StaticResource BodyTextStyle}"/> </StackPanel></ListView.Header>Press F5 to launch the application.Snap the application. Click the “Chinese” group header and confirm that the group-detail page looks like the one pictured in Figure 11.Figure 11The modified group-detail page in snapped modeReturn to Visual Studio and stop debugging.Task 4 – Modify the Snapped Item-Detail PageThe final task is to modify the snapped item-detail page to improve the layout and include recipe ingredients.Open ItemDetailPage.xaml and add the following FlipView control to the FlipViews that are already there:XAML<FlipView x:Name="snappedFlipView" AutomationProperties.AutomationId="ItemsFlipView" AutomationProperties.Name="Item Details" Grid.Row="1" Margin="0,-3,0,0" ItemsSource="{Binding Source={StaticResource itemsViewSource}}" Visibility="Collapsed"> <FlipView.ItemTemplate> <DataTemplate> <UserControl Loaded="StartLayoutUpdates" Unloaded="StopLayoutUpdates"> <ScrollViewer x:Name="scrollViewer" Style="{StaticResource VerticalScrollViewerStyle}" Grid.Row="1"> <!-- Vertical StackPanel for item-detail layout --> <StackPanel Orientation="Vertical" Margin="20,0,20,0"> <StackPanel Orientation="Vertical"> <TextBlock FontSize="20" FontWeight="Light" Text="{Binding Title}" TextWrapping="Wrap"/> <Image x:Name="image" Width="260" Margin="0,12,0,40" Stretch="Uniform" Source="{Binding Image}" HorizontalAlignment="Left"/> </StackPanel> <StackPanel Orientation="Vertical"> <TextBlock FontSize="20" FontWeight="Light" Text="Ingredients" Margin="0,0,0,16"/> <TextBlock FontSize="16" FontWeight="Light" TextWrapping="Wrap" Text="{Binding Ingredients, Converter={StaticResource ListConverter}}" /> </StackPanel> </StackPanel> </ScrollViewer> </UserControl> </DataTemplate> </FlipView.ItemTemplate></FlipView>Note: This is the second FlipView you’ve added to the item-detail page. The other one handles portrait-mode layout. This one will be used only when the page is snapped.Find the VisualState element named “Snapped” near the bottom of ItemDetailPage.xaml.Add the following elements to the elements already present in the VisualState element’s Storyboard to hide the default FlipView and show the snapped FlipView when the view state changes to “Snapped:”XAML<ObjectAnimationUsingKeyFrames Storyboard.TargetName="flipView" Storyboard.TargetProperty="Visibility"> <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/></ObjectAnimationUsingKeyFrames><ObjectAnimationUsingKeyFrames Storyboard.TargetName="snappedFlipView" Storyboard.TargetProperty="Visibility"> <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/></ObjectAnimationUsingKeyFrames>Start the application again. Snap it so that it occupies the left side of the screen alongside another app. The go to the item-detail page and confirm that the snapped page now shows recipe ingredients, as pictured in Figure 12.Figure 12The modified item-detail page in snapped modeReturn to Visual Studio and stop debugging.Exercise 3: Semantic ZoomMany applications that run on touch screens allow users to zoom in and out using a two-fingered pinching motion. A photo-editing application, for example, might let you zoom in on a photo when two fingers touching the screen move apart, and zoom back out when two fingers touching the screen move together.Most zooms are optical zooms, meaning they simply scale content displayed on the screen. It’s easy enough to include optical zoom in a Metro style app, but Windows 8 also supports semantic zoom. Semantic zoom does not simply scale content up or down; it groups the content to provide a different semantic view. For example, semantic zoom in a mapping application might reveal additional details such as street names and building names as the user zooms in, and remove those details when the user zooms back out.To aid you in implementing semantic zoom, WinRT’s Windows.UI.Xaml.Controls namespace includes a SemanticZoom control. The basic idea is that you provide the control with two views – a zoomed-in view and a zoomed-out view – and the control will switch between the two in response to user input. You don’t have to do the switching yourself, and you don’t have to write gesture-recognition code to take action when two fingers make contact with the screen and move together or apart. If you don’t have a touch screen, you can zoom in and out by holding down the Ctrl key and rolling the mousewheel. Sound appealing? Then let’s put semantic zoom to work.Task 1 – Add a SemanticZoom Control to the Start PageAdding semantic zoom to Contoso Cookbook is as simple as declaring a SemanticZoom control and populating it with views representing the zoomed-in view of the start page and the zoomed-out view.Open GroupedItemsPage.xaml.Find the GridView named “itemGridView.” Delete it and everything inside it.Replace the GridView you just deleted with the following statements:XAML<SemanticZoom Grid.Row="1"> <SemanticZoom.ZoomedInView> <!-- Horizontal scrolling grid used in most view states --> <GridView x:Name="itemGridView" AutomationProperties.AutomationId="ItemGridView" AutomationProperties.Name="Grouped Items" Margin="0,-3,0,0" Padding="116,0,40,46" ItemsSource="{Binding Source={StaticResource groupedItemsViewSource}}" ItemTemplate="{StaticResource Standard250x250ItemTemplate}" SelectionMode="None" IsItemClickEnabled="True" ItemClick="ItemView_ItemClick"> <GridView.ItemsPanel> <ItemsPanelTemplate> <VirtualizingStackPanel Orientation="Horizontal"/> </ItemsPanelTemplate> </GridView.ItemsPanel> <GridView.GroupStyle> <GroupStyle> <GroupStyle.HeaderTemplate> <DataTemplate> <Grid Margin="1,0,0,6"> <Button AutomationProperties.Name="Group Title" Content="{Binding Title}" Click="Header_Click" Style="{StaticResource TextButtonStyle}"/> </Grid> </DataTemplate> </GroupStyle.HeaderTemplate> <GroupStyle.Panel> <ItemsPanelTemplate> <VariableSizedWrapGrid Orientation="Vertical" Margin="0,0,80,0"/> </ItemsPanelTemplate> </GroupStyle.Panel> </GroupStyle> </GridView.GroupStyle> </GridView> </SemanticZoom.ZoomedInView> <SemanticZoom.ZoomedOutView> <GridView x:Name="groupGridView" Margin="116,0,40,46"> <GridView.ItemTemplate> <DataTemplate> <Grid Margin="0,0,24,0"> <Image Source="{Binding Group.GroupImage}" Width="250" Height="500" Stretch="UniformToFill" /> <TextBlock Text="{Binding Group.Title}" Foreground="{StaticResource ListViewItemOverlayForegroundThemeBrush}" Style="{StaticResource TitleTextStyle}" FontSize="28" Margin="12"/> <TextBlock Text="{Binding Group.RecipesCount}" Foreground="{StaticResource ApplicationSecondaryForegroundThemeBrush}" Style="{StaticResource TitleTextStyle}" FontSize="96" Margin="12,64,12,12" HorizontalAlignment="Right"/> </Grid> </DataTemplate> </GridView.ItemTemplate> </GridView> </SemanticZoom.ZoomedOutView></SemanticZoom>Note: You just replaced the GridView that renders items to the start page with a SemanticZoom control containing two GridViews: one representing the zoomed-in view of the start page, and one representing the zoomed-out view. The SemanticZoom control does the switching between the two.Near the bottom of GroupedItemsPage.xaml, find the VisualState element named “Snapped” and add the following statements to the element’s Storyboard to hide the zoomed-out view when the app is snapped:XAML<ObjectAnimationUsingKeyFrames Storyboard.TargetName="groupGridView" Storyboard.TargetProperty="Visibility"> <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/></ObjectAnimationUsingKeyFrames>Open GroupedItemsPage.xaml.cs and add the following statement to the end of the LoadState method:C#this.groupGridView.ItemsSource = this.groupedItemsViewSource.View.CollectionGroups;Task 2 – Test the ResultsNow it’s time to see semantic zoom in action.Run the application and confirm that you see the same start page you’ve seen before.Put two fingers on the screen and move them together (or use the mousewheel and the Ctrl key) to zoom out. Verify that the page changes to the one shown in Figure 13.Figure 13The zoomed-out start pagePut two fingers on the screen again, but this time move them away from each other (or use the mousewheel and the Ctrl key again) to zoom in. What happens to the start page?Zoom out again and tap one of the recipe groups. Verify that you switch back to the zoomed-in view, and that it’s scrolled to the group you selected.Return to Visual Studio and stop debugging.SummaryIn this lab, you made some key UI-related enhancements to Contoso Cookbook. You adapted the layout for rotated displays, customized the layout when the app is snapped, and added semantic zoom to simplify the task of navigating among recipe groups on the start page. And you did all of this while writing remarkably little code.Most of the work in Labs 1 and 2 involved creating the user experience – getting the pages looking just right in all orientations and all modes. Now it’s time to do some work on the back end by adding support for sharing and search. Contoso Cookbook is about to become more tightly integrated with Windows and other Metro style apps. ................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related searches
- objectives of financial management
- primary objectives of financial managers
- finance objectives examples
- educational objectives examples
- marketing objectives vs marketing strategy
- career objectives for direct care
- objectives for resumes in finance
- finance goals and objectives examples
- major objectives of financial management
- quality goals and objectives examples
- sample resume objectives for finance
- example performance objectives for managers