IT tutorials
 
Mobile
 

Windows Phone 8 : Phone-Specific Controls (part 1) - Panorama Control

2/14/2013 5:58:21 PM
- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
So far all the controls you’ve seen have existed in other versions of XAML (e.g. WPF, Silverlight and Windows 8). But some controls are specifically for use on the phone. The two most obvious are the Pivot and Panorama controls that allow you to create multipanel controls in a cohesive way. First we’ll discuss the Panorama control.

Panorama Control

The Panorama control creates a virtual canvas of several panels that the user can scroll into view as she wants. The Panorama control allows you to build these virtual canvases out of one or more panels. You can see an example of a panorama application in Figure 1.

Figure 1. Panorama application

Image

The Panorama control requires that you add a reference to the Microsoft.Phone.Controls assembly. Likewise, you must import the new namespace into your XAML document, as shown here:1

1 Note that the namespace has a line break in it before the “assembly” part of the namespace. This is for illustration. In your XAML, the entire contents of the namespace should have no line breaks.

<phone:PhoneApplicationPage
  x:Class="MyFirstPanorama.MainPage"
  xmlns:ctrls="clr-namespace:Microsoft.Phone.Controls;
               assembly=Microsoft.Phone.Controls"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

Once you have the new namespace you can use the Panorama and PanoramaItem elements to create the panorama:

<Grid x:Name="LayoutRoot"
        Background="Transparent">
    <ctrls:Panorama Title="my panorama">
      <ctrls:PanoramaItem Header="first">
        <Grid>
          <ListBox />
        </Grid>
      </ctrls:PanoramaItem>
      <ctrls:PanoramaItem Header="second">
        <Grid>
          <ListBox Width="500" />
        </Grid>
      </ctrls:PanoramaItem>
    </ctrls:Panorama>
  </Grid>

The Panorama element supports a Title attribute, which is used to display text that goes across the entire Panorama control. Inside the Panorama control you can use one or more PanoramaItem elements. Each PanoramaItem element represents one second in the panorama. The PivotItem’s Header property controls what is shown above each PanoramaItem section. You can see the panorama in Figure 2.

Figure 2. Panorama explained

Image

The Panorama element’s Title property is labeled #1 in Figure 2. You can see that the title is shown across all the panes, so it is never shown in its entirety. The two panorama items in the design are shown as individual panes. The area labeled #2 shows the first PanoramaItem element and the area labeled #3 shows the second PanoramaItem. Notice that the next panorama item is hinted at on the right side of the screen.

Panoramas commonly have a background image that slides behind the panorama as the user moves from one panorama item to the next. To get that behavior, you can set the Background element of the panorama using an ImageBrush. For example, you would use the following code to paint the background with an image in the .xap file:

<ctrls:Panorama Title="my panorama">
  <ctrls:Panorama.Background>
    <ImageBrush ImageSource="/back.jpg"
                Opacity=".2" />
  </ctrls:Panorama.Background>
...

While panorama sections (e.g., PanoramaItem elements) are meant to take up most of a single screen on the phone, other sections can be larger than a single screen. You can see that the section labeled #1 in Figure 3 is larger than a single screen, while the section labeled #2 is sized for a single page. This is consistent with the design paradigm for the phone.

Figure 3. Landscape sections

Image

To use landscape sections, you must make a couple of changes. By default, a panorama section will take up most of a single page. To get the larger panes you must both size the PanoramaItem’s contents to be as large as necessary (using the Width attribute) as well as set the orientation of the PanoramaItem to Landscape, as shown with the second PanoramaItem in the code that follows:

<ctrls:Panorama Title="my panorama">
  <ctrls:Panorama.Background>
    <ImageBrush ImageSource="/back.jpg"
                Opacity=".2" />
  </ctrls:Panorama.Background>
  <ctrls:PanoramaItem Header="first">
    <Grid>
      <ListBox />
    </Grid>
  </ctrls:PanoramaItem>
  <ctrls:PanoramaItem Header="second"
                      Orientation="Horizontal">
    <Grid Width="750">
      <ListBox />
    </Grid>
  </ctrls:PanoramaItem>
  <ctrls:PanoramaItem Header="third">
    <Grid>
      <ListBox Width="750" />
    </Grid>
  </ctrls:PanoramaItem>
</ctrls:Panorama>

The design guidelines specify that you should have no more than four or five sections in your Panorama controls; fewer than that if you are using landscape sections. The general rule of thumb is to have the entire panorama less than 2,000 pixels wide, though the smaller it is the easier it will be for users to understand the intent.
 
Others
 
- BlackBerry Tablet Applications : Exploring the APIs - Busy Indicator
- BlackBerry Tablet Applications : Exploring the APIs - Multi-Touch
- BlackBerry Tablet Applications : Exploring the APIs - Microphone
- Android : Getting Fancy with Lists - Inflating Rows Ourselves
- Android : Getting Fancy with Lists - A Dynamic Presentation
- Android : Getting Fancy with Lists - Getting to First Base
- Windows Phone 7 : Getting Started with XNA - Displaying Text
- Windows Phone 7 : Getting Started with XNA - Useful Sprite Effects
- iphone Programming : Integrating Your Application - Using the Address Book
- iphone Programming : Integrating Your Application - Media Playback
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us