Mdn 0512Dg.Pdf
Total Page:16
File Type:pdf, Size:1020Kb
Duplicate Code Detection & Consolidation with CodeRush CodeRush helps you create and maintain source code with optimum efÄ ciency. Consume-Ä rst declaration, powerful templates, smart selection tools, intelligent code analysis, innovative navigation and an unrivalled collection of refactorings all work together to increase your productivity dramatically. Download the 30-day free trial to experience the next generation of developer productivity tools at www.DevExpress.com © 1998-2012 Developer Express Inc. ALL RIGHTS RESERVED. All trademarks or registered trademarks are property of their respective owners. Untitled-7 1 4/10/12 4:57 PM THE MICROSOFT JOURNAL FOR DEVELOPERS MAY 2012 VOL 27 NO 5 Creating Media Apps for Windows Phone COLUMNS Mark Hopkins .......................................................................... 22 CUTTING EDGE Understanding the Power Develop HTML5 Windows Phone Apps of WebSockets with Apache Cordova Dino Esposito, page 6 Colin Eberhardt ........................................................................ 28 FORECAST: CLOUDY 5 Reasons to Start Working Using HTML5 to Create Mobile Experiences with Windows Azure Brandon Satrom ....................................................................... 46 Joseph Fultz, page 14 TEST RUN What’s New for Mobile Development Dive into Neural Networks in ASP.NET MVC 4 James McCaffrey, page 72 Keith Burnell ............................................................................ 52 THE WORKING PROGRAMMER Introducing the Navigation Talk to Me, Part 3: Meet the Therapist for ASP.NET Web Forms Framework Ted Neward, page 78 Graham Mendick ..................................................................... 56 CLIENT INSIGHT Managing Complexity in Advanced JsRender Templating Features T4 Code-Generation Solutions John Papa, page 82 Peter Vogel .............................................................................. 62 DON’T GET ME STARTED The Myth of Informed Consent Multimodal Communication with Kinect David Platt, page 88 Leland Holmquest .................................................................... 68 Start a Revolution Refuse to choose between desktop and mobile. With the brand new NetAdvantage for .NET, you can create awesome apps with killer data visualization today, on any platform or device. Get your free, fully supported trial today! www.infragistics.com/NET Infragistics Sales US 800 231 8588 • Europe +44 (0) 800 298 9055 • India +91 80 4151 8042 • APAC (+61) 3 9982 4545 Copyright 1996-2012 Infragistics, Inc. All rights reserved. Infragistics and NetAdvantage are registered trademarks of Infragistics, Inc. The Infragistics logo is a trademark of Infragistics, Inc. All other trademarks or registered trademarks are the respective property of their owners. Untitled-8 2 4/10/12 5:13 PM Compatible with Microsoft® Visual Studio® 11 Beta Untitled-8 3 4/10/12 5:14 PM MAY 2012 VOLUME 27 NUMBER 5 magazine MITCH RATCLIFFE Director LUCINDA ROWLEY Editorial Director/[email protected] PATRICK O’NEILL Site Manager MICHAEL DESMOND Editor in Chief/[email protected] DAVID RAMEL Technical Editor SHARON TERDEMAN Features Editor WENDY HERNANDEZ Group Managing Editor KATRINA CARRASCO Associate Managing Editor SCOTT SHULTZ Creative Director JOSHUA GOULD Art Director CONTRIBUTING EDITORS Dino Esposito, Joseph Fultz, Kenny Kerr, Julie Lerman, Dr. James McCaffrey, Ted Neward, John Papa, Charles Petzold, David S. Platt Henry Allain President, Redmond Media Group Doug Barney Vice President, New Content Initiatives Michele Imgrund Sr. Director of Marketing & Audience Engagement Tracy Cook Director of Online Marketing ADVERTISING SALES: 508-532-1418/[email protected] Matt Morollo VP/Group Publisher Chris Kourtoglou Regional Sales Manager William Smith National Accounts Director Danna Vedder Microsoft Account Manager Jenny Hernandez-Asandas Director, Print Production Serena Barnes Production Coordinator/[email protected] Neal Vitale President & Chief Executive Offi cer Richard Vitale Senior Vice President & Chief Financial Offi cer Michael J. Valenti Executive Vice President Christopher M. Coates Vice President, Finance & Administration Erik A. Lindgren Vice President, Information Technology & Application Development David F. Myers Vice President, Event Operations Jeffrey S. Klein Chairman of the Board MSDN Magazine (ISSN 1528-4859) is published monthly by 1105 Media, Inc., 9201 Oakdale Avenue, Ste. 101, Chatsworth, CA 91311. Periodicals postage paid at Chatsworth, CA 91311-9998, and at additional mailing offi ces. Annual subscription rates payable in US funds are: U.S. $35.00, International $60.00. Annual digital subscription rates payable in U.S. funds are: U.S. $25.00, International $25.00. Single copies/back issues: U.S. $10, all others $12. Send orders with payment to: MSDN Magazine, P.O. Box 3167, Carol Stream, IL 60132, email [email protected] or call (847) 763-9560. POSTMASTER: Send address changes to MSDN Magazine, P.O. Box 2166, Skokie, IL 60076. Canada Publications Mail Agreement No: 40612608. Return Undeliverable Canadian Addresses to Circulation Dept. or XPO Returns: P.O. Box 201, Richmond Hill, ON L4B 4R5, Canada. Printed in the U.S.A. Reproductions in whole or part prohibited except by written permission. Mail requests to “Permissions Editor,” c/o MSDN Magazine, 4 Venture, Suite 150, Irvine, CA 92618. Legal Disclaimer: The information in this magazine has not undergone any formal testing by 1105 Media, Inc. and is distributed without any warranty expressed or implied. Implementation or use of any information contained herein is the reader’s sole responsibility. While the information has been reviewed for accuracy, there is no guarantee that the same or similar results may be achieved in all environments. Technical inaccuracies may result from printing errors and/or new developments in the industry. Corporate Address: 1105 Media, Inc., 9201 Oakdale Ave., Ste 101, Chatsworth, CA 91311, www.1105media.com Media Kits: Direct your Media Kit requests to Matt Morollo, VP Publishing, 508-532-1418 (phone), 508-875-6622 (fax), [email protected] Reprints: For single article reprints (in minimum quantities of 250-500), e-prints, plaques and posters contact: PARS International, Phone: 212-221-9595, E-mail: [email protected], www.magreprints.com/ QuickQuote.asp List Rental: This publication’s subscriber list, as well as other lists from 1105 Media, Inc., is available for rental. For more information, please contact our list manager, Merit Direct. Phone: 914-368-1000; E-mail: [email protected]; Web: www.meritdirect.com/1105 All customer service inquiries should be sent to [email protected] or call 847-763-9560. Printed in the USA Untitled-11 1 4/6/12 12:43 PM EDITOR’S NOTE MICHAEL DESMOND MSDN Magazine Welcomes Script Junkie Unless you’ve been living under a rock the past two years, you’ve the Script Junkie homepage at msdn.microsoft.com/magazine/ee729207. Or noticed that Microsoft has gotten behind HTML5-based applica- just look for the link on the MSDN Magazine homepage. tion development in a big way. And it’s no surprise—we’ve been What does the transition mean for you? More than anything, busy producing a steady diet of features, columns and Web articles it ensures that developers will continue to enjoy access to timely focused on HTML5, JavaScript and CSS3. how-to articles from respected and established Script Junkie authors Th is month includes another installment in our ongoing HTML5 like Tim Kulp, Emily Lewis and Addy Osmani. What’s more, the feature series by Brandon Satrom, “Using HTML5 to Create Mobile move helps introduce Script Junkie to the larger community of Experiences.” He explores two pillars of responsive Web design— MSDN Magazine subscribers and site visitors. Our Web metrics fl uid grids and fl exible images. Also in this issue you’ll fi nd Colin have shown strong reader interest in HTML5-themed features Eberhardt’s feature on developing native HTML5 applications for and columns, and we expect Script Junkie will be valued by MSDN Windows Phone, using the open source Apache Cordova mobile Magazine readers who are anxious to explore new topics and development framework. challenges in script-based Web development. In February we launched the Client Insight column specifi cally Are there specific topics or issues you’d like to see covered at to address growing interest in rich client frameworks and tech- Script Junkie? E-mail me at mmeditor@microsoft .com. nologies, including HTML5 and XAML-based Silverlight and Windows Presentation Foundation (WPF). Written by John Papa, So Long and Thanks for All the Fish the column this month digs deeper into the JsRender JavaScript No, the dolphins aren’t leaving the planet (at least, not yet). But library and explores scenarios such as rendering external tem- I’m sad to say that MSDN Magazine Editorial Director Kit George plates, changing context with the {{for}} tag and using complex has moved on, assuming a new role with the Bing team that he expressions. described as “too good to refuse.” Yes, there’s plenty of HTML5 and related coverage in each issue of Kit’s had a hand in a lot of the changes you’ve seen in the MSDN Magazine. And there’s more of that to be found on the MSDN magazine—and especially the Web site—over the past year and a Magazine Web site, including Rachel Appel’s popular Web Dev Report half. He campaigned for the addition of unique online editorial column. Her latest piece off ers helpful tips for working with CSS, and content,