Microsoft Surface Lab #2: Surface Controls



Similar documents
Microsoft Surface Software Development Kit

Hands-On Lab. Building a Data-Driven Master/Detail Business Form using Visual Studio Lab version: Last updated: 12/10/2010.

Windows Presentation Foundation Tutorial 1

Shipment Label Header Guide

Sample Table. Columns. Column 1 Column 2 Column 3 Row 1 Cell 1 Cell 2 Cell 3 Row 2 Cell 4 Cell 5 Cell 6 Row 3 Cell 7 Cell 8 Cell 9.

Document Revision Date: August 14, Create a New Data Protection Policy in the Symantec.cloud Management Portal

Creating Fill-able Forms using Acrobat 8.0: Part 1

ComponentOne. Windows for WPF

WPF Shapes. WPF Shapes, Canvas, Dialogs 1

Introduction to C#, Visual Studio and Windows Presentation Foundation

NVCC Alexandria Campus

Access 2007 Creating Forms Table of Contents

Create Charts in Excel

Creating Web Pages with Microsoft FrontPage

CREATING EXCEL PIVOT TABLES AND PIVOT CHARTS FOR LIBRARY QUESTIONNAIRE RESULTS

Microsoft Excel 2010 Charts and Graphs

Why Use OneNote? Creating a New Notebook

Data Visualization. Prepared by Francisco Olivera, Ph.D., Srikanth Koka Department of Civil Engineering Texas A&M University February 2004

Microsoft FrontPage 2003

Maximizing the Use of Slide Masters to Make Global Changes in PowerPoint

Using Microsoft Word. Working With Objects

Microsoft Office PowerPoint Identify components of the PowerPoint window. Tutorial 1 Creating a Presentation

Microsoft Office PowerPoint Creating a new presentation from a design template. Creating a new presentation from a design template

Excel 2007: Basics Learning Guide

Schoolwires Staff Website Reference Guide

Appendix A How to create a data-sharing lab

Download and Installation Instructions. Visual C# 2010 Help Library

How to Build a SharePoint Website

Hands-On Lab. Building Applications in Silverlight 4 Module 8: Advanced OOB and MEF. Event Administrator Dashboard

Catalog Creator by On-site Custom Software

Layout Tutorial. Getting Started

Step 1: Download and install the CudaSign for Salesforce app

Making Content Editable. Create re-usable templates with total control over the sections you can (and more importantly can't) change.

Microsoft Publisher 2010 What s New!

ECDL. European Computer Driving Licence. Spreadsheet Software BCS ITQ Level 2. Syllabus Version 5.0

Formulas, Functions and Charts

Appspace 5.X Reference Guide (Digital Signage) Updated on February 9, 2015

Trial version of GADD Dashboards Builder

Excel -- Creating Charts

Search help. More on Office.com: images templates

Application Note. Building a Website Using Dreamweaver without Programming. Nan Xia. MSU ECE 480 Team 5

Windows Presentation Foundation (WPF) User Interfaces

SQL Server 2005: Report Builder

In this session, we will explain some of the basics of word processing. 1. Start Microsoft Word 11. Edit the Document cut & move

Creating a Form. A form is something that is created allowing users to enter information in a more visual manner than a datasheet view.

Advanced Outlook Tutorials

What is Microsoft PowerPoint?

A simple three dimensional Column bar chart can be produced from the following example spreadsheet. Note that cell A1 is left blank.

Click on various options: Publications by Wizard Publications by Design Blank Publication

Microsoft Picture Manager. Picture Manager

OBJECTIVE1: Understanding Windows Forms Applications

Data Visualization. Brief Overview of ArcMap

Quest Web Parts for SharePoint

Scientific Graphing in Excel 2010

Message Classification user guide

Relationships in WPF Applications

Entering the example employee satisfaction survey in Survey Crafter Professional s Survey Designer window

Introduction to Visual Basic

Microsoft Office PowerPoint 2013

Create a Poster Using Publisher

Designing Reports in Access

POWERPOINT BASICS: MICROSOFT OFFICE 2013

Layout Tutorial. Chapter 10: Getting Started

I ntroduction. Accessing Microsoft PowerPoint. Anatomy of a PowerPoint Window

PowerPoint: Graphics and SmartArt

Analyzing Excel Data Using Pivot Tables

MS Excel Template Building and Mapping for Neat 5

Beginning of the Semester Checklist - 1

Brock University Content Management System Training Guide

Developing Website Using Tools

A SharePoint Developer Introduction. Hands-On Lab. Lab Manual SPCHOL306 Using Silverlight with the Client Object Model VB

Open icon. The Select Layer To Add dialog opens. Click here to display

Printing Solutions for Word Printing Solutions for Word Printing Solutions for Word Printing Solutions for Word 2003

Layout Tutorial. Chapter 10: Getting Started

No web design or programming expertise is needed to give your museum a world-class web presence.

National RTAP Marketing Transit Toolkit Customizing Templates in Microsoft Publisher

Creating a PowerPoint Poster using Windows

Microsoft Expression Web

Avery DesignPro 2000 User Guide

Joomla Article Advanced Topics: Table Layouts

Designing and Implementing Forms 34

PASTPERFECT-ONLINE DESIGN GUIDE

WIX: Building a Website with a Template. Choosing a Template First you will need to choose a template from the Create section of the Wix website.

Creating Basic HTML Forms in Microsoft FrontPage

Working with SQL Server Integration Services

PowerPoint 2007 Basics Website:

Cricut Design Space Reference Guide & Glossary

Microsoft PowerPoint 2010 Handout

ACS Version Check Layout Design

Virto SharePoint Gantt Chart App for Office 365 Release User and Installation Guide

Dashcode User Guide. (Retired Document)

MODULE 2: SMARTLIST, REPORTS AND INQUIRIES

Handout: Creating Forms in Word 2010

Excel Pivot Tables. Blue Pecan Computer Training Ltd - Onsite Training Provider :: :: info@bluepecan.co.

Sweet Home 3D user's guide

Excel 2003 Tutorial I

Office365 at Triton College

Transcription:

CS320 Tangible User Interface Wellesley College Fall 2013 Microsoft Surface Lab #2: Surface Controls Surface Controls As we discussed in class the Microsoft Surface was designed to integrate easily with WPF in terms of input events (where the most basic level of Surface input is Contact events including ContactDown, ContactUp, and ContactChanged) and user interface controls so that almost every Surface control has a direct WPF equivalent. Surface controls include: SurfaceWindow SurfaceButton SurfaceToggleButton SurfaceCheckBox SurfaceRadioButton SurfaceSlider SurfaceScrollViewer SurfaceListBox SurfaceInkCanvas ScatterView SurfaceTextBox SurfacePasswordBox SurfaceMenu and SurfaceContextMenu SurfaceLibraryContainer, SurfaceLibraryContainerBarView, SurfaceLibraryContainerStackView SurfaceDragDrop ElementMenuItems A detailed description and sample code for each of these controls is available in Chapter 5 of Developing for the Microsoft Surface and online in the MSDN library. Task 1: working with basic controls Open SurfaceText1 in Visual C# Express. This sample application was developed to illustrate the use of several basic Surface controls. Open the Microsoft Surface Simulator, then run the application and explore its use. Stop the debugging. Open SurfaceWindow1.xaml. What is the child element of SurfaceWindow? Open the xaml file, what controls are used in this application, to what events they respond? Fill in the following table:

Surface Control (type and name) e.g. SurfaceButton button1 Event Handler OnClick Modify the xaml code so that when the SurfaceButton is selected from the list, three vertically stacked SurfaceButtons appear. In the xaml file, add an event handler for each SurfaceButton so that clicking each of the buttons result in a different response. In the cs file implement the event handlers. Your event handlers should implement the following functionality: changing the color of a button s background, changing a button s text, and displaying a notification message. Task 2: Tag Visualization and Tag Visualizer 1) On the Project menu in Visual C# click Add New Item. In the Categories list, click Surface. In the Templates list, Click TagVisualization (WPF). Name the TagVisualization object. A new TagVisualization layout file (i.e. xaml) is created with an accompanying code file (i.e. cs). 2) Modify the TagVisualization xaml file: Add Height = 96 and Width = 150 as properties, add a Label to the Grid Object. Set Basic as the default content of the label, name the label VisualizationLabel. 3) Modify the TagVisualization.cs file: Add a new public method called UpdateVisualization that accepts a string as an argument. The method displays the string as the content of VisualizationLabel. 4) Open SurfaceText1.xaml. Add a Tag Visualizer element to the SurfaceWindow. The Tag Visualizer should contain the Grid element. Add two TagVisualizer definitions, each specifies a particular tag value. For each tag value specify a Source (a xaml file to be displayed) and an event handler for the VisualizationCreated event. When you are finished your xaml file should look like this:

5) Open SurfaceText1.xaml.cs and create two methods corresponding to each event handler specified in the TagVisuailzation definitions (in SurfaceText1.xaml). Your event handling methods should have two parameters: object sender, and TagVisualizationEventArgs e. Your complete methods should be similar to the following code Now run the program using the Simulator. Use the tag input tool to test your application. You can set the value of the tag input to 0xc1 and to 0xc2. Close the project when you are done. Task 3: Working with Scatter View One of the rich and most commonly used Surface control is the ScatterView Control. Items that are added to the scatter view control are automatically enabled for advanced manipulations such as dragging, rotating, and resizing. To explore ScatterView, open the project MyFirstSurfaceApplication. Open SurfaceWindow.xaml. Scroll through the xaml file until you locate the ScatterView tag with the Name property set to My Photos. You will see that in this tag we use a template for displaying images from a data bound collection. Data binding connects data to specific controls. Here the Microsoft Surface SDK will automatically create a separate ScatterViewItem for each image in the bound collection and add of the items to the ScatterView.

Open the SurfaceWindow1.xaml.cs file. In the constructor for the SurfaceWindow1 class you can see the following instruction. This instruction binds the photo files collection to ScatterView, generates the individual ScatterViewItems and adds them to the ScatterView. For this instruction to work correctly you must verify the string photosfiles is set to a valid path. Verify the path and then uncomment this instruction and then run the application. Take some time to try and move the images around. Stop the application and comment back this instruction. Next, we are going to manually create ScatterViewItems and add an Image object into the ScatterViewItem. First, still in the constructor for the SurfaceWindow1 class find the following instruction and uncomment it. Then find the CreateScatterViewItems method which is located further on in the SurfaceWindow1.xaml.cs file. In this method we are explicitly creating ScatterViewItems and adding Image objects into the ScatterViewItems. We also set the border brush color and thickness of each ScatterViewItem. Study the following code and then run the application.

Explore other properties of ScatterViewItems. Modify the method so that all ScatterViewItems will appear in a pile in the center of the surface screen (the dimensions of the surface screen are 1024x768). What property do you need to change? The last two instructions in the CreateScatterViewItems method add two event listeners to ScatterViewItems. Next, add two methods to the this file that implements the corresponding event handlers so that the color of a ScatterViewItem changes to red when the item is activated and changes back to beige when the item is deactivated. Each of these methods takes two arguments: object sender and RoutedEventArgs e.