Mdn 1012Win8dg.Pdf
Total Page:16
File Type:pdf, Size:1020Kb
Untitled-2 1 8/30/12 11:54 AM THE MICROSOFT JOURNAL FOR DEVELOPERS OCTOBER 15, 2012 VOL 27 NO 10A magazine Special Issue Windows 8 Reimagining App Development COLUMNS with the Windows Runtime EDITOR’S NOTE Jason Olson ........................................................................................ 20 All Eyes on Windows 8 Michael Desmond, page 4 Under the Hood with .NET and the Windows Runtime MODERN APPS The Windows Store App Lifecycle Shawn Farkas ...................................................................................... 28 Rachel Appel, page 6 Windows Runtime Components in a .NET World WINDOWS AZURE INSIDER Jeremy Likness ................................................................................... 34 Windows 8 and Windows Azure: Convergence in the Cloud Writing Silverlight and WPF Apps Bruno Terkaly and with Windows Runtime XAML in Mind Ricardo Villalobos, page 12 Pete Brown ......................................................................................... 42 Using the MVVM Pattern in Windows 8 Laurent Bugnion ................................................................................. 48 Introducing C++/CX and XAML Andy Rich ........................................................................................... 56 Porting Desktop Applications to the Windows Runtime Diego Dagum ..................................................................................... 64 Managing Memory in Windows Store Apps David Tepper ...................................................................................... 74 Data Binding in a Windows Store App with JavaScript Chris Sells and Brandon Satrom .......................................................... 82 Authoring Windows Store Apps in Blend Christian Schormann ........................................................................... 90 Compatible with Microsoft® Visual Studio® 2012 Shape up your Windows UI Untitled-5 2 9/14/12 3:15 PM infragistics.com/ 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-5 3 9/14/12 3:16 PM OCTOBER, 15 2012 VOLUME 27 NUMBER 10A WINDOWS 8 magazine BJÖRN RETTIG Director MOHAMMAD AL-SABT 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 SENIOR CONTRIBUTING EDITOR Dr. James McCaffrey CONTRIBUTING EDITORS Rachel Appel, Dino Esposito, Kenny Kerr, Julie Lerman, Ted Neward, Charles Petzold, David S. Platt, Bruno Terkaly, Ricardo Villalobos 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 National Account Manager/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 13 times a year, monthly with a special issue in October 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 MSDNmag@1105service. com 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-6 1 9/12/12 1:54 PM EDITOR’S NOTE MICHAEL DESMOND All Eyes on Windows 8 Welcome to the Windows 8 special edition of MSDN Magazine. app-focused explorations of C# and C++ memory-management As many of you have no doubt noticed, we haven’t had a lot to techniques, security practices in JavaScript and design guidance say about the newest Microsoft OS and the underlying Windows for creating more-eff ective Windows Store app UIs. Runtime (WinRT). Th at’s about to change—starting right now. One reason for all the excitement, says Jason Olson, senior You’re holding in your hands an unprecedented extra issue of program manager working on the Windows Runtime, is that MSDN Magazine, focused entirely on Windows 8, the Windows Microsoft has pitched the proverbial big tent with the Windows Runtime and the development of Windows Store apps. Th e Windows Runtime. Right off the bat, developers working with C++, C#, 8 special edition is packed with hands-on tutorials, from Jason Olson’s Visual Basic and JavaScript can get to work creating Windows Store informative, technical dive into the Windows Runtime and how it apps. Th at’s a huge and diverse community of developers. enables Windows Store app development in C++, C#/Visual Basic and “I’m very excited—this is a big value-add for the Windows JavaScript, to Christian Schormann’s walk through using Expression Runtime itself,” Olson says of language support in the Windows Blend to create Windows Store apps built using HTML and XAML. Runtime. “Many different types of developers can continue In between, you’ll fi nd great resources, such as David Tepper’s leveraging their skills and assets when building Windows Store exploration of memory management in the Windows Runtime, apps on Windows 8.” and Shawn Farkas’ guide showing how managed .NET developers Olson, in his feature (“Reimagining App Development with the can call WinRT APIs from their Windows Store applications, and Windows Runtime,” p. 20), also details the value of hybrid apps Diego Dagum’s look at porting C++ MFC applications to the under the Windows Runtime. He writes: Windows Runtime. “Th ere are no boundaries. As a JavaScript developer, you aren’t Th ere’s more where that came from, including the debut of two limited to JavaScript libraries. As a C#/Visual Basic developer, you new columns that will be appearing regularly in MSDN Magazine aren’t limited to .NET libraries. And as a C++ developer, you aren’t going forward. Rachel Appel’s Modern Apps column works the limited to C/C++ libraries.” expanding waterfront of Windows Store and rich client application As Olson told me in an interview, “Developers can take full development, kicking off with an informative look at the Windows advantage of the ‘language choice’ ability in the Windows Runtime Store app lifecycle and how it can be managed for optimal perfor- to take advantage of many diff erent types of code assets they have mance and effi ciency. You might recognize Appel from her work as access to, regardless of whether the asset is native code, managed a columnist on the MSDN Magazine Web site, where she wrote the code or JavaScript code.” Web Dev Report. And that,