The Microsoft Surface SDK contains several types of samples, including quick start tutorials, how-to topics, and extractable Microsoft Visual Studio 2010 projects for sample applications.
- XNA Quick Start (located in the Developing Core Layer Surface Applications section)
- WPF Quick Start (located in the Developing Presentation Layer Surface Applications section)
"How Do I…?" Examples
The following topics are short, very specific examples that answer frequently asked questions about programming for Surface.
Topics That Use the Core Layer and the XNA Framework
Topics That Use the Presentation Layer (WPF)
- Adding a ScatterViewItem Control Programmatically
- Adding Video to a ScatterViewItem Control
- Capturing Raw Images When Using WPF
- Combining a User Control with a ScatterViewItem Control
- Creating a Continuously Panning List
- Creating a Custom Shape for a ScatterViewItem Control
- Creating and Displaying Tag Visualizations
- Customizing the Disabled Effect of a LibraryBarItem Control
- Data Binding a ScatterView Control
- Grouping Data of a LibraryBar Control
- Implementing a Custom Removal Behavior for Tag Visualizations
- Manipulating Shapes
- Moving UI Elements with Touch
- Customizing Control Styles
- Reducing CPU Usage
Sample Application Projects
The sample applications that come with the Surface SDK show several different programming techniques in a complete application. You can use these applications as a starting point for more complete applications or just as examples of best practices in Surface programming. For information about obtaining the sample files, see Extracting and Installing the Surface Samples.
Samples That Use the Core Layer and the XNA Framework
- Finger Fountain draws small images for every contact at every frame. This sample emphasizes multiple touches and shows how to use the Microsoft XNA APIs.
- Framework provides an extensive sample framework that helps you create controls by using the Core layer. The code in this sample eliminates inconsistent behavior among Core-based applications by using the Model-View-Controller (MVC) design pattern.
- Cloth is an XNA-based application that demonstrates how to use the Core Interaction Framework.
- RawImage Visualizer shows how to use the RawImage APIs for XNA applications. This sample displays captured normalized (8 bit per pixel) images that are flipped vertically.
- XNA Scatter demonstrates how to use the manipulations and inertia APIs to move graphical user interface (GUI) components around in a Surface application in a natural and intuitive way.
Samples That Use the Presentation Layer (WPF)
- Controls Box shows how to build simple application behaviors from touch-enabled controls that the Presentation layer provides, such as updating a text box when a user touches a button.
- Data Visualizer shows contact properties that are exposed in the Presentation layer (such as x, y, height, width, major axis, minor axis, and orientation) and how you can read and use these properties in a Surface application.
- Grand Piano demonstrates how to integrate sound into Surface applications based on the Presentation layer.
- Item Compare represents a simple tool that lets a user compare and contrast the properties of two "items" (tagged objects).
- Photo Paint uses the SurfaceInkCanvas control to implement drawing and painting over pictures and video.
- ScatterPuzzle shows an implementation of the ScatterView and SurfaceListBox controls to create a simple puzzle game. The ScatterView and SurfaceListBox controls automatically provide some powerful features related to Surface.
- Shopping Cart shows how to implement drag-and-drop functionality in a retail application.
- Tag Visualizer Events shows how to incorporate hit-testing in the TagVisualizer control to let user interface (UI) elements react when tagged objects move over them.
© Microsoft Corporation. All rights reserved.