Export (0) Print
Expand All
1 out of 2 rated this helpful - Rate this topic

Developing Presentation Layer Surface Applications



The Presentation layer is one of the two development layers of the Microsoft Surface SDK. This layer exposes the same functionality for the general features of Surface as the Core layer, but it is targeted towards a different development model.

The Presentation layer uses Microsoft Windows Presentation Foundation (WPF), which is the standard choice for developing touch-enabled applications because it facilitates many development needs, including custom controls, being touch-enabled by default, and many standard user interface (UI) elements, such as buttons, labels, and scroll bars. With WPF, you can also use custom graphics to create content-rich applications. By building applications with the Presentation layer, you can focus on your application while WPF and pre-built controls handle the common tasks.

The Presentation layer includes a suite of Surface-enabled versions of standard WPF controls. It also supports the use of XAML files for rapid UI development. To minimize how much you have to learn if you have WPF experience, the Presentation layer exposes routed events and attached properties in a way that is consistent with the WPF model for providing you with information about mouse, touch, and stylus input. The Presentation layer also enables a multi-capture system so that one or more touches can be captured by each UI element. For example, on a device made for Surface, up to 50 touches are supported.

By using the Presentation layer, you can create an application UI by using XAML and the Microsoft Expression Blend 4 design software. When you combine the application UI with the corresponding C# code, you can quickly and easily develop touch-enabled applications.

To get started and learn how to create a Surface application that uses the Presentation layer, see WPF Quick Start.

Surface WPF Controls

The Presentation layer of the Surface SDK includes the following touch-enabled WPF controls:

 

Surface-specific controls Components of other controls Base classes for custom controls

SurfaceWindow

SurfaceButton

SurfaceInkCanvas

SurfaceSlider

SurfaceScrollViewer

SurfaceListBox

SurfaceTextBox

SurfacePasswordBox

SurfaceCheckBox

SurfaceRadioButton

ElementMenu

LibraryBar

LibraryContainer

LibraryStack

ScatterView

ScatterViewItem

TagVisualizer

TagVisualization

SurfaceScrollBar

SurfaceThumb

SurfaceRepeatButton

SurfaceToggleButton

SurfaceListBoxItem

Control

ContentControl

UserControl

ItemsControl

TipTip
The ScatterView and SurfaceListBox controls are the most versatile controls that are available to you. For more information about these controls, see ScatterView Control and SurfaceListBox Control.

When to Use the Presentation Layer

Use the Presentation layer when your Surface application does not require high-end graphics, such as complex 3-D animation. Use the Presentation layer when you want to take advantage of built-in Surface controls that enable you to rapidly create a sophisticated application.

Designing by Using Expression Blend 4

Expression Blend is an application that helps you create layout. You export all layout work that you complete in Expression Blend as a XAML file, which is the same file format that WPF-based Surface applications use to define UI. You can access Surface-enabled custom controls in Expression Blend by opening a Surface project that was already created in Microsoft Visual C# 2010 (or Microsoft Visual Studio 2010) using the Surface project templates.

Blend - Asset Library and custom controls

Selecting Surface controls in Expression Blend

To locate and access Surface-enabled custom controls in Expression Blend

  1. In Visual C# 2010 (or Visual Studio 2010), create a Surface project by using the Surface Application (WPF) template, and then save the project.

  2. Open Expression Blend, click the Projects tab, and then click Open Project on the Welcome Screen.

    Alternatively, click Open Project/Solution on the File menu.

  3. Navigate to your saved project, select your project's solution file (*.sln), and click Open.

  4. In the Projects panel, open any .xaml file in Design view.

    TipTip
    Many tools and toolbars of Expression Blend are enabled only when a .xaml file is opened in Design or Split view. This is because the tools are meant to help you create your application visually on the artboard.

  5. On the toolbar on the left side of the screen, click the double arrows (labeled 1 in the preceding illustration).

    The Assets flyout appears.

    TipTip
    The Assets flyout can also appear as a panel that can be docked to the user interface of Expression Blend. To open the Assets panel, check Assets in the Window menu. Drag the title bar of the panel to change its docked position.

  6. Surface controls are included in the full list of controls that appear when you click All under Controls. To view only Surface controls, expand Locations, and then click Microsoft.Surface.Presentation.dll (labeled 2 in the preceding illustration).

  7. Select the Surface control that you want to add to your application, and then drag on the artboard to create it.

The changes that you make on the artboard are automatically reflected in the XAML code. For more information about working with Expression Blend, press F1 to open the Expression Blend User Guide, or see Expression Blend 4.

Did you find this information useful? Please send us your suggestions and comments.

© Microsoft Corporation. All rights reserved.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.