40026A-ENU-StudentHandbook.pdf

64
7/27/2019 40026A-ENU-StudentHandbook.pdf http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 1/64  OFFICIAL MICROSOFT LEARNING PRODUCT 40026A Hands On Lab: Introduction to Windows ® 8 Development – C# ®  

Transcript of 40026A-ENU-StudentHandbook.pdf

Page 1: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 1/64

 

O F F I C I A L M I C R O S O F T L E A R N I N G P R O D U C T

40026AHands On Lab: Introduction to Windows® 8

Development – C#® 

Page 2: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 2/64

ii Hands On Lab: Introduction to Windows® 8 Development – C#®

Information in this document, including URL and other Internet Web site references, is subject to change

without notice. Unless otherwise noted, the example companies, organizations, products, domain names,

e-mail addresses, logos, people, places, and events depicted herein are fictitious, and no association with

any real company, organization, product, domain name, e-mail address, logo, person, place or event is

intended or should be inferred. Complying with all applicable copyright laws is the responsibility of the

user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in

or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical,

photocopying, recording, or otherwise), or for any purpose, without the express written permission of 

Microsoft Corporation.

Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property

rights covering subject matter in this document. Except as expressly provided in any written license

agreement from Microsoft, the furnishing of this document does not give you any license to these

patents, trademarks, copyrights, or other intellectual property.

The names of manufacturers, products, or URLs are provided for informational purposes only and

Microsoft makes no representations and warranties, either expressed, implied, or statutory, regarding

these manufacturers or the use of the products with any Microsoft technologies. The inclusion of a

manufacturer or product does not imply endorsement of Microsoft of the manufacturer or product. Links

may be provided to third party sites. Such sites are not under the control of Microsoft and Microsoft is not

responsible for the contents of any linked site or any link contained in a linked site, or any changes or

updates to such sites. Microsoft is not responsible for webcasting or any other form of transmission

received from any linked site. Microsoft is providing these links to you only as a convenience, and the

inclusion of any link does not imply endorsement of Microsoft of the site or the products contained

therein.

© 2012 Microsoft Corporation. All rights reserved.

Microsoft and the trademarks listed at

http://www.microsoft.com/about/legal/en/us/IntellectualProperty/Trademarks/EN-US.aspx are trademarks of 

the Microsoft group of companies. All other trademarks are property of their respective owners 

Product Number: 40026A

Released: 07/2012

Page 3: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 3/64

 MICROSOFT LICENSE TERMSMICROSOFT INSTRUCTOR-LED COURSEWARE

These license terms are an agreement between Microsoft Corporation (or based on where you live, one of itsaffiliates) and you. Please read them. They apply to your use of the content accompanying this agreement which

includes the media on which you received it, if any. These license terms also apply to Trainer Content and anyupdates and supplements for the Licensed Content unless other terms accompany those items. If so, those termsapply.

BY ACCESSING, DOWNLOADING OR USING THE LICENSED CONTENT, YOU ACCEPT THESE TERMS.IF YOU DO NOT ACCEPT THEM, DO NOT ACCESS, DOWNLOAD OR USE THE LICENSED CONTENT.

If you comply with these license terms, you have the rights below for each license you acquire. 

1.  DEFINITIONS. 

a.   “Authorized Learning Center” means a Microsoft IT Academy Program Member, Microsoft LearningCompetency Member, or such other entity as Microsoft may designate from time to time.

b.   “Authorized Training Session” means the instructor-led training class using Microsoft Instructor-LedCourseware conducted by a Trainer at or through an Authorized Learning Center.

c.   “Classroom Device” means one (1) dedicated, secure computer that an Authorized Learning Center ownsor controls that is located at an Authorized Learning Center’s training facilities that meets or exceeds thehardware level specified for the particular Microsoft Instructor-Led Courseware.

d.   “End User” means an individual who is (i) duly enrolled in and attending an Authorized Training Sessionor Private Training Session, (ii) an employee of a MPN Member, or (iii) a Microsoft full-time employee.

e.   “Licensed Content” means the content accompanying this agreement which may include the MicrosoftInstructor-Led Courseware or Trainer Content.

f.   “Microsoft Certified Trainer” or “MCT” means an individual who is (i) engaged to teach a training sessionto End Users on behalf of an Authorized Learning Center or MPN Member, and (ii) currently certified as aMicrosoft Certified Trainer under the Microsoft Certification Program.

g.   “Microsoft Instructor-Led Courseware” means the Microsoft-branded instructor-led training course thateducates IT professionals and developers on Microsoft technologies. A Microsoft Instructor-LedCourseware title may be branded as MOC, Microsoft Dynamics or Microsoft Business Group courseware.

h.   “Microsoft IT Academy Program Member” means an active member of the Microsoft IT AcademyProgram.

i.   “Microsoft Learning Competency Member” means an active member of the Microsoft Partner Network program in good standing that currently holds the Learning Competency status.

 j.   “MOC” means the “Official Microsoft Learning Product” instructor-led courseware known as MicrosoftOfficial Course that educates IT professionals and developers on Microsoft technologies.

k.   “MPN Member” means an active silver or gold-level Microsoft Partner Network program member in goodstanding.

Page 4: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 4/64

 l.   “Personal Device” means one (1) personal computer, device, workstation or other digital electronic device

that you personally own or control that meets or exceeds the hardware level specified for the particularMicrosoft Instructor-Led Courseware.

m.  “Private Training Session”  means the instructor-led training classes provided by MPN Members forcorporate customers to teach a predefined learning objective using Microsoft Instructor-Led Courseware.

These classes are not advertised or promoted to the general public and class attendance is restricted toindividuals employed by or contracted by the corporate customer.

n.   “Trainer” means (i) an academically accredited educator engaged by a Microsoft IT Academy ProgramMember to teach an Authorized Training Session, and/or (ii) a MCT.

o.   “Trainer Content” means the trainer version of the Microsoft Instructor-Led Courseware and additionalsupplemental content designated solely for Trainers’ use to teach a training session using the MicrosoftInstructor-Led Courseware. Trainer Content may include Microsoft PowerPoint presentations, trainerpreparation guide, train the trainer materials, Microsoft One Note packs, classroom setup guide and Pre-release course feedback form. To clarify, Trainer Content does not include any software, virtual harddisks or virtual machines.

2.  USE RIGHTS. The Licensed Content is licensed not sold. The Licensed Content is licensed on a one copy  per user basis , such that you must acquire a license for each individual that accesses or uses the LicensedContent.

2.1  Below are five separate sets of use rights. Only one set of rights apply to you.

a.  If you are a Microsoft IT Academy Program Member:i.  Each license acquired on behalf of yourself  may only be used to review one (1) copy of the Microsoft

Instructor-Led Courseware in the form provided to you. If the Microsoft Instructor-Led Courseware isin digital format, you may install one (1) copy on up to three (3) Personal Devices. You may notinstall the Microsoft Instructor-Led Courseware on a device you do not own or control.

ii.  For each license you acquire on behalf of an End User or Trainer, you may either:1.  distribute one (1) hard copy version of the Microsoft Instructor-Led Courseware to one (1) End

User who is enrolled in the Authorized Training Session, and only immediately prior to thecommencement of the Authorized Training Session that is the subject matter of the MicrosoftInstructor-Led Courseware being provided, or 

2.  provide one (1) End User with the unique redemption code and instructions on how they canaccess one (1) digital version of the Microsoft Instructor-Led Courseware, or 

3.  provide one (1) Trainer with the unique redemption code and instructions on how they canaccess one (1) Trainer Content,

provided you comply with the following:iii.  you will only provide access to the Licensed Content to those individuals who have acquired a valid

license to the Licensed Content,iv.  you will ensure each End User attending an Authorized Training Session has their own valid licensed

copy of the Microsoft Instructor-Led Courseware that is the subject of the Authorized Training

Session,v.  you will ensure that each End User provided with the hard-copy version of the Microsoft Instructor-

Led Courseware will be presented with a copy of this agreement and each End User will agree thattheir use of the Microsoft Instructor-Led Courseware will be subject to the terms in this agreementprior to providing them with the Microsoft Instructor-Led Courseware. Each individual will be requiredto denote their acceptance of this agreement in a manner that is enforceable under local law prior totheir accessing the Microsoft Instructor-Led Courseware,

vi.  you will ensure that each Trainer teaching an Authorized Training Session has their own validlicensed copy of the Trainer Content that is the subject of the Authorized Training Session,

Page 5: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 5/64

 vii.  you will only use qualified Trainers who have in-depth knowledge of and experience with the

Microsoft technology that is the subject of the Microsoft Instructor-Led Courseware being taught forall your Authorized Training Sessions,

viii. you will only deliver a maximum of 10 hours of training per week for each Authorized TrainingSession that uses a MOC title, and

ix.  you acknowledge that Trainers that are not MCTs will not have access to all of the trainer resources

for the Microsoft Instructor-Led Courseware.

b.  If you are a Microsoft Learning Competency Member: i.  Each license acquired on behalf of yourself  may only be used to review one (1) copy of the Microsoft

Instructor-Led Courseware in the form provided to you. If the Microsoft Instructor-Led Courseware isin digital format, you may install one (1) copy on up to three (3) Personal Devices. You may notinstall the Microsoft Instructor-Led Courseware on a device you do not own or control.

ii.  For each license you acquire on behalf of an End User or Trainer, you may either:1.  distribute one (1) hard copy version of the Microsoft Instructor-Led Courseware to one (1) End

User attending the Authorized Training Session and only immediately prior to thecommencement of the Authorized Training Session that is the subject matter of the MicrosoftInstructor-Led Courseware provided, or 

2.  provide one (1) End User attending the Authorized Training Session with the unique redemption

code and instructions on how they can access one (1) digital version of the Microsoft Instructor-Led Courseware, or 

3.  you will provide one (1) Trainer with the unique redemption code and instructions on how theycan access one (1) Trainer Content,

provided you comply with the following:iii.  you will only provide access to the Licensed Content to those individuals who have acquired a valid

license to the Licensed Content,iv.  you will ensure that each End User attending an Authorized Training Session has their own valid

licensed copy of the Microsoft Instructor-Led Courseware that is the subject of the AuthorizedTraining Session,

v.  you will ensure that each End User provided with a hard-copy version of the Microsoft Instructor-LedCourseware will be presented with a copy of this agreement and each End User will agree that theiruse of the Microsoft Instructor-Led Courseware will be subject to the terms in this agreement prior toproviding them with the Microsoft Instructor-Led Courseware. Each individual will be required todenote their acceptance of this agreement in a manner that is enforceable under local law prior totheir accessing the Microsoft Instructor-Led Courseware,

vi.  you will ensure that each Trainer teaching an Authorized Training Session has their own validlicensed copy of the Trainer Content that is the subject of the Authorized Training Session,

vii.  you will only use qualified Trainers who hold the applicable Microsoft Certification credential that isthe subject of the Microsoft Instructor-Led Courseware being taught for your Authorized TrainingSessions,

viii. you will only use qualified MCTs who also hold the applicable Microsoft Certification credential that isthe subject of the MOC title being taught for all your Authorized Training Sessions using MOC,

ix.  you will only provide access to the Microsoft Instructor-Led Courseware to End Users, andx.  you will only provide access to the Trainer Content to Trainers.

Page 6: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 6/64

 c.  If you are a MPN Member: 

i.  Each license acquired on behalf of yourself may only be used to review one (1) copy of the MicrosoftInstructor-Led Courseware in the form provided to you. If the Microsoft Instructor-Led Courseware isin digital format, you may install one (1) copy on up to three (3) Personal Devices. You may notinstall the Microsoft Instructor-Led Courseware on a device you do not own or control.

ii.  For each license you acquire on behalf of an End User or Trainer, you may either:

1.  distribute one (1) hard copy version of the Microsoft Instructor-Led Courseware to one (1) EndUser attending the Private Training Session, and only immediately prior to the commencementof the Private Training Session that is the subject matter of the Microsoft Instructor-LedCourseware being provided, or 

2.  provide one (1) End User who is attending the Private Training Session with the uniqueredemption code and instructions on how they can access one (1) digital version of theMicrosoft Instructor-Led Courseware, or 

3.  you will provide one (1) Trainer who is teaching the Private Training Session with the uniqueredemption code and instructions on how they can access one (1) Trainer Content,

provided you comply with the following:iii.  you will only provide access to the Licensed Content to those individuals who have acquired a valid

license to the Licensed Content,iv.  you will ensure that each End User attending an Private Training Session has their own valid licensed

copy of the Microsoft Instructor-Led Courseware that is the subject of the Private Training Session,v.  you will ensure that each End User provided with a hard copy version of the Microsoft Instructor-Led

Courseware will be presented with a copy of this agreement and each End User will agree that theiruse of the Microsoft Instructor-Led Courseware will be subject to the terms in this agreement prior toproviding them with the Microsoft Instructor-Led Courseware. Each individual will be required todenote their acceptance of this agreement in a manner that is enforceable under local law prior totheir accessing the Microsoft Instructor-Led Courseware,

vi.  you will ensure that each Trainer teaching an Private Training Session has their own valid licensedcopy of the Trainer Content that is the subject of the Private Training Session,

vii.  you will only use qualified Trainers who hold the applicable Microsoft Certification credential that isthe subject of the Microsoft Instructor-Led Courseware being taught for all your Private TrainingSessions,

viii. you will only use qualified MCTs who hold the applicable Microsoft Certification credential that is thesubject of the MOC title being taught for all your Private Training Sessions using MOC,

ix.  you will only provide access to the Microsoft Instructor-Led Courseware to End Users, andx.  you will only provide access to the Trainer Content to Trainers.

d.  If you are an End User:For each license you acquire, you may use the Microsoft Instructor-Led Courseware solely for yourpersonal training use. If the Microsoft Instructor-Led Courseware is in digital format, you may access theMicrosoft Instructor-Led Courseware online using the unique redemption code provided to you by thetraining provider and install and use one (1) copy of the Microsoft Instructor-Led Courseware on up tothree (3) Personal Devices. You may also print one (1) copy of the Microsoft Instructor-Led Courseware. You may not install the Microsoft Instructor-Led Courseware on a device you do not own or control.

e.  If you are a Trainer.i.  For each license you acquire, you may install and use one (1) copy of the Trainer Content in theform provided to you on one (1) Personal Device solely to prepare and deliver an AuthorizedTraining Session or Private Training Session, and install one (1) additional copy on another PersonalDevice as a backup copy, which may be used only to reinstall the Trainer Content. You may notinstall or use a copy of the Trainer Content on a device you do not own or control.

Page 7: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 7/64

 

ii.   You may customize the written portions of the Trainer Content that are logically associated withinstruction of a training session in accordance with the most recent version of the MCT agreement.If you elect to exercise the foregoing rights, you agree to comply with the following: (i)customizations may only be used for teaching Authorized Training Sessions and Private TrainingSessions, and (ii) all customizations will comply with this agreement. For clarity, any use of 

 “customize”  refers only to changing the order of slides and content, and/or not using all the slides orcontent, it does not mean changing or modifying any slide or content.

2.2 Separation of Components. The Licensed Content is licensed as a single unit and you may notseparate their components and install them on different devices.

2.3  Redistribution of Licensed Content. Except as expressly provided in the use rights above, you maynot distribute any Licensed Content or any portion thereof (including any permitted modifications) to anythird parties without the express written permission of Microsoft.

2.4  Third Party Programs and Services. The Licensed Content may contain third party programs orservices. These license terms will apply to your use of those third party programs or services, unless otherterms accompany those programs and services.

2.5   Additional Terms. Some Licensed Content may contain components with additional terms,conditions, and licenses regarding its use. Any non-conflicting terms in those conditions and licenses alsoapply to your use of that respective component and supplements the terms described in this agreement.

3.  LICENSED CONTENT BASED ON PRE-RELEASE TECHNOLOGY. If the Licensed Content’s subjectmatter is based on a pre-release version of Microsoft technology (“Pre-release”), then in addition to theother provisions in this agreement, these terms also apply:

a.  Pre-Release Licensed Content. This Licensed Content subject matter is on the Pre-release version of the Microsoft technology. The technology may not work the way a final version of the technology willand we may change the technology for the final version. We also may not release a final version. Licensed Content based on the final version of the technology may not contain the same information asthe Licensed Content based on the Pre-release version. Microsoft is under no obligation to provide youwith any further content, including any Licensed Content based on the final version of the technology. 

b.  Feedback. If you agree to give feedback about the Licensed Content to Microsoft, either directly orthrough its third party designee, you give to Microsoft without charge, the right to use, share andcommercialize your feedback in any way and for any purpose. You also give to third parties, withoutcharge, any patent rights needed for their products, technologies and services to use or interface withany specific parts of a Microsoft software, Microsoft product, or service that includes the feedback. Youwill not give feedback that is subject to a license that requires Microsoft to license its software,technologies, or products to third parties because we include your feedback in them. These rightssurvive this agreement.

c.  Pre-release Term. If you are an Microsoft IT Academy Program Member, Microsoft LearningCompetency Member, MPN Member or Trainer, you will cease using all copies of the Licensed Content onthe Pre-release technology upon (i) the date which Microsoft informs you is the end date for using theLicensed Content on the Pre-release technology, or (ii) sixty (60) days after the commercial release of thetechnology that is the subject of the Licensed Content, whichever is earliest (“Pre-release term”).Upon expiration or termination of the Pre-release term, you will irretrievably delete and destroy all copiesof the Licensed Content in your possession or under your control.

Page 8: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 8/64

 4.  SCOPE OF LICENSE. The Licensed Content is licensed, not sold. This agreement only gives you some

rights to use the Licensed Content. Microsoft reserves all other rights. Unless applicable law gives you morerights despite this limitation, you may use the Licensed Content only as expressly permitted in thisagreement. In doing so, you must comply with any technical limitations in the Licensed Content that onlyallows you to use it in certain ways. Except as expressly permitted in this agreement, you may not:•  access or allow any individual to access the Licensed Content if they have not acquired a valid license

for the Licensed Content,•  alter, remove or obscure any copyright or other protective notices (including watermarks), branding

or identifications contained in the Licensed Content,•  modify or create a derivative work of any Licensed Content,•  publicly display, or make the Licensed Content available for others to access or use,•  copy, print, install, sell, publish, transmit, lend, adapt, reuse, link to or post, make available or

distribute the Licensed Content to any third party,•  work around any technical limitations in the Licensed Content, or•  reverse engineer, decompile, remove or otherwise thwart any protections or disassemble the

Licensed Content except and only to the extent that applicable law expressly permits, despite thislimitation.

5.  RESERVATION OF RIGHTS AND OWNERSHIP. Microsoft reserves all rights not expressly granted to

you in this agreement. The Licensed Content is protected by copyright and other intellectual property lawsand treaties. Microsoft or its suppliers own the title, copyright, and other intellectual property rights in theLicensed Content.

6.  EXPORT RESTRICTIONS. The Licensed Content is subject to United States export laws and regulations. You must comply with all domestic and international export laws and regulations that apply to the LicensedContent. These laws include restrictions on destinations, end users and end use. For additional information,see www.microsoft.com/exporting.

7.  SUPPORT SERVICES. Because the Licensed Content is “as is”, we may not provide support services for it.

8.  TERMINATION. Without prejudice to any other rights, Microsoft may terminate this agreement if you fail

to comply with the terms and conditions of this agreement. Upon termination of this agreement for anyreason, you will immediately stop all use of and delete and destroy all copies of the Licensed Content inyour possession or under your control.

9.  LINKS TO THIRD PARTY SITES. You may link to third party sites through the use of the LicensedContent. The third party sites are not under the control of Microsoft, and Microsoft is not responsible forthe contents of any third party sites, any links contained in third party sites, or any changes or updates tothird party sites. Microsoft is not responsible for webcasting or any other form of transmission receivedfrom any third party sites. Microsoft is providing these links to third party sites to you only as aconvenience, and the inclusion of any link does not imply an endorsement by Microsoft of the third partysite.

10.  ENTIRE AGREEMENT. This agreement, and any additional terms for the Trainer Content, updates and

supplements are the entire agreement for the Licensed Content, updates and supplements.

11.   APPLICABLE LAW. a.  United States. If you acquired the Licensed Content in the United States, Washington state law governs

the interpretation of this agreement and applies to claims for breach of it, regardless of conflict of lawsprinciples. The laws of the state where you live govern all other claims, including claims under stateconsumer protection laws, unfair competition laws, and in tort.

Page 9: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 9/64

 b.  Outside the United States. If you acquired the Licensed Content in any other country, the laws of that

country apply.

12.  LEGAL EFFECT. This agreement describes certain legal rights. You may have other rights under the lawsof your country. You may also have rights with respect to the party from whom you acquired the LicensedContent. This agreement does not change your rights under the laws of your country if the laws of your

country do not permit it to do so.

13.  DISCLAIMER OF WARRANTY. THE LICENSED CONTENT IS LICENSED "AS-IS" AND "AS AVAILABLE."  YOU BEAR THE RISK OF USING IT. MICROSOFT AND ITS RESPECTIVE AFFILIATES GIVES NO EXPRESS WARRANTIES, GUARANTEES, OR CONDITIONS. YOU MAY HAVE ADDITIONAL CONSUMER RIGHTS UNDER YOUR LOCAL LAWS WHICH THIS AGREEMENTCANNOT CHANGE. TO THE EXTENT PERMITTED UNDER YOUR LOCAL LAWS, MICROSOFT ANDITS RESPECTIVE AFFILIATES EXCLUDES ANY IMPLIED WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. 

14.  LIMITATION ON AND EXCLUSION OF REMEDIES AND DAMAGES. YOU CAN RECOVER FROMMICROSOFT, ITS RESPECTIVE AFFILIATES AND ITS SUPPLIERS ONLY DIRECT DAMAGES UPTO US$5.00. YOU CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL,

LOST PROFITS, SPECIAL, INDIRECT OR INCIDENTAL DAMAGES. 

This limitation applies too  anything related to the Licensed Content, services, content (including code) on third party Internet

sites or third-party programs; ando  claims for breach of contract, breach of warranty, guarantee or condition, strict liability, negligence,

or other tort to the extent permitted by applicable law.

It also applies even if Microsoft knew or should have known about the possibility of the damages. Theabove limitation or exclusion may not apply to you because your country may not allow the exclusion orlimitation of incidental, consequential or other damages.

Please note: As this Licensed Content is distributed in Quebec, Canada, some of the clauses in thisagreement are provided below in French.

Remarque : Ce le contenu sous licence étant distribué au Québec, Canada, certaines des clausesdans ce contrat sont fournies ci-dessous en français.

EXONÉRATION DE GARANTIE. Le contenu sous licence visé par une licence est offert « tel quel ». Touteutilisation de ce contenu sous licence est à votre seule risque et péril. Microsoft n’accorde aucune autre garantieexpresse. Vous pouvez bénéficier de droits additionnels en vertu du droit local sur la protection duesconsommateurs, que ce contrat ne peut modifier. La ou elles sont permises par le droit locale, les garantiesimplicites de qualité marchande, d’adéquation à un usage particulier et d’absence de contrefaçon sont exclues.

LIMITATION DES DOMMAGES-INTÉRÊTS ET EXCLUSION DE RESPONSABILITÉ POUR LES

DOMMAGES. Vous pouvez obtenir de Microsoft et de ses fournisseurs une indemnisation en cas de dommagesdirects uniquement à hauteur de 5,00 $ US. Vous ne pouvez prétendre à aucune indemnisation pour les autresdommages, y compris les dommages spéciaux, indirects ou accessoires et pertes de bénéfices.Cette limitation concerne:

•  tout ce qui est relié au le contenu sous licence, aux services ou au contenu (y compris le code)figurant sur des sites Internet tiers ou dans des programmes tiers; et.

•  les réclamations au titre de violation de contrat ou de garantie, ou au titre de responsabilitéstricte, de négligence ou d’une autre faute dans la limite autorisée par la loi en vigueur.

Page 10: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 10/64

 Elle s’applique également, même si Microsoft connaissait ou devrait connaître l’éventualité d’un tel dommage. Sivotre pays n’autorise pas l’exclusion ou la limitation de responsabilité pour les dommages indirects, accessoiresou de quelque nature que ce soit, il se peut que la limitation ou l’exclusion ci-dessus ne s’appliquera pas à votreégard.

EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous pourriez avoir d’autres droits

prévus par les lois de votre pays. Le présent contrat ne modifie pas les droits que vous confèrent les lois de votrepays si celles-ci ne le permettent pas.

Revised June 2012

Page 11: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 11/64

Hands On Lab: Introduction to Windows® 8 Development – C#® xi 

AcknowledgmentsMicrosoft Learning would like to acknowledge and thank the following for their contribution towards

developing this Hands-on Lab. Their effort at various stages in the development has ensured that you

have a good classroom experience.

Ishai Ram – Lead Content Developer 

Ishai is the Vice President of SELA Group. He has over 20 years of experience as a professional trainer and

consultant on computer software and electronics.

Baruch Toledano – Content Developer

Baruch is a Project Manager at SELA Group. He has extensive experience in producing Microsoft Official

Courses. He is a Lecturer at SELA College and as such gains an additional understanding of the classroom

experience.

Elad Shaham - Subject Matter Expert

Elad is a Senior Consultant at SELA. Elad is an expert in client side architecture and has led the

development of core and applicative client side infrastructure in several projects. Recently, Elad is leading

cutting edge technology projects revolving around Windows 8 and Windows Phone.

Amit Raz - Subject Matter Expert

Amit Raz is a Consultant at SELA. He specializes in WPF and Silverlight, and has 8 years of experience in

various .NET technologies. Amit also specializes in mobile platforms such as Windows Phone and is very

experienced in creating UI/UX guided applications.

Erez Harari - Subject Matter Expert

Erez Harari (MCT, MCPD, and MCTS) is the CTO of SELA Canada, continuing the role of Senior Architect

and Consultant he performed at SELA Group for the past four years, while specializing in both Server side

and Client side technologies. Erez has an in-depth knowledge and understanding of the Microsoft .NET

infrastructure and the .NET architecture. Erez likes developing games for the Windows Phone 7, Kinect

and the upcoming Windows 8.

Alon Levi - Subject Matter Expert

Alon is a Senior Consultant at SELA. He specializes in smart UI applications with cutting edge technologies

such as Windows 8 Metro Applications, WPF, MVVM, Prism and MEF. Alon has vast experience in system

architecting and design and has a deep understanding of how client applications behave.

SELA Team – Content Contributors

Roman Bryansker, Gennady Birenberg, Uri Gorodetsky

Page 12: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 12/64

xii Hands On Lab: Introduction to Windows® 8 Development – C#®

Contents

Lab 1: Introduction to Windows 8 Platform

Before you begin 1-2 

Lab Setup 1-2 Exercise 1: Using the Start screen 1-3

Exercise 2: Running Apps Using Tiles 1-5

Exercise 3: Using the Charms Bar 1-6

Lab 2: Working with Metro Style Guidelines

Before you begin 2-2 

Lab Setup 2-2 

Exercise 1: Exploring Metro Style Apps 2-3

Lab 3: Implementing Metro Style Apps with XAML and C#

Before you begin 3-2 

Lab Setup 3-2 

Exercise 1: Creating a Grid Application 3-3

Exercise 2: Creating a Split Application 3-4

Exercise 3: Using the WinRT Library 3-5

Lab 4: Integrating with Windows 8 Experiences

Before you begin 4-2 

Lab Setup 4-2 

Exercise 1: Integrating Search Contract 4-3

Exercise 2: Integrating Share Contract 4-5

Exercise 3: Integrating Settings Contract 4-9

Lab 5: Implementing Tiles and Notifications

Before you begin 5-2 

Lab Setup 5-2 

Exercise 1: Using Live Tiles in a Metro Style App 5-3

Exercise 2: Using Toast Notifications in a Metro Style App 5-5

Lab 6: Deploying to the Windows Store

Before you begin 6-2 Lab Setup 6-2 

Exercise 1: Exploring the Windows Store 6-3

Exercise 2: Exploring a Trial Version to a Metro Style App 6-4

Page 13: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 13/64

About This Hands-on Lab xiii 

About This Hands-on LabThis section provides you with a brief description of the Hands-on Lab, audience, suggested prerequisites,

and Hands-on Lab objectives.

Hands-on Lab DescriptionThis three hour Hands-On Lab (HOL) will introduce developers to the tools and techniques for creating

Window 8 (Metro) applications using C#/XAML. It will outline The Windows 8 platform, Metro-Style

guidelines, Windows 8 contracts, tiles and notifications, and the Windows store. 

Audience

This course is intended for professional developers that come from the .NET client side world and have

familiarity with C# and XAML. Developers should have 1-2 years of experience in their field. 

Student Prerequisites

This Hand-On Lab requires that you meet the following prerequisites:

  Modern graphical interfaces

  Object Oriented Programming knowledge

  Simple data access (CRUD) knowledge

  General understanding of the Visual Studio IDE

Hands-on Lab Objectives

After completing this Hands-on Lab, students will be able to:

  Use the Windows 8 Start screen

  Run apps using tiles

  Use the Charms bar

  Examine Metro style apps and their design

  Create a Grid Application

  Create a Split Application

  Explore how the WinRT Library is used

  Explore how Search Contract is integrated

  Explore how Share Contract is integrated

  Explore how Settings Contract is integrated

  Explore how Live Tiles in a Metro style app are used

  Explore how Toast Notifications in a Metro style app are used

  Explore the Microsoft Store

  Create a trial version to a Metro style app

Page 14: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 14/64

xiv About This Hands-on Lab

Hands-on Lab Outline

This section provides an outline of the Hands-on Lab:

Lab 1, “Introduction to Windows 8 Platform", in this lab you will explore the various Windows 8 features

and see how to work with them.

Lab 2, “Working with Metro-Style Guidelines", in this lab you will explore the Metro-Style guidelines and

learn to apply them to apps.

Lab 3, “Implementing Metro Style Apps with C#/XAML", in this lab you will explore how to create Metro

Style Apps using C# and XAML, and JavaScript. You will learn how to create a grid application and how to

use the WinRT library

Lab 4, “Integrating with Windows 8 experiences", in this lab, you will explore how the built-in contracts

such as Search, Share, Settings are integrated. Lab 5, "Implementing Tiles and Notifications", in this lab you will explore how Tiles and Notifications that

let users personalize their Start screen are implemented. Lab 6, "Deploying to the Windows Store", in this lab, you will explore the Microsoft Store, and work on

creating a trial version of a Metro Style App. 

Hands-on Lab Materials  Lab Manual: A succinct Lab guide that provides all the information needed to successfully complete the lab.

  To provide additional comments or feedback on the Hands-on Lab, send e-mail to

[email protected]. To inquire about the Microsoft Certification Program, send e-mail

to [email protected].

  NOTE: The Hands-on Lab exercises guide you through few sample apps in Windows 8 SDK, and explain how

some of the features have been implemented. You won't CREATE an app in this Hands-on Lab. Rather You will

OPEN some of the sample code and SEE how a particular feature has been implemented. This by no means is

an exhaustive training that will help you build applications from scratch.

Page 15: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 15/64

About This Hands-on Lab xv 

Virtual Machine EnvironmentThis section provides the information for setting up the classroom environment to support the business

scenario of the Hands-on Lab.

Virtual Machine Configuration

In this course, you will use Microsoft® Hyper-V™ to perform the labs.

Important At the end of each lab, you must close the virtual machine and must not save

any changes. To close a virtual machine without saving the changes, perform the following

steps:

1. On the virtual machine, on the Action menu, click Close.

2. In the Close dialog box, in the What do you want the virtual machine to do? list, click

Turn off and delete changes, and then click OK .

The following table shows the role of each virtual machine used in this course:

Virtual machine Role

Base12B-W8-CP.vhd Base

Base11A-WS08R2SP1 Base

MT12-SEA-DEV11-CP.vhd Middle Tier

MT12-W8-CL1-Office2010SP1-CP.vhd Middle Tier

MT11-MSL-TMG1.vhd Middle Tier

UT12-SEA-DEV12-CP.vhd Upper Tier

40026A-Allfiles.vhd Lab Files

Software Configuration

The following software is installed on each VM:

  Microsoft Windows 8 

  Microsoft Visual Studio 2012 

Course FilesThere are files associated with the labs in this course. The lab files are located in the folder

E:\Allfiles\Mod0X\Labfiles on the student computers.

Classroom Setup

Each classroom computer will have the same virtual machine configured in the same way.

Page 16: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 16/64

xvi About This Hands-on Lab

Course Hardware Level

To ensure a satisfactory student experience, Microsoft Learning requires a minimum equipment

configuration for trainer and student computers in all Microsoft Certified Partner for Learning Solutions

(CPLS) classrooms in which Official Microsoft Learning Product courseware are taught.

The classroom computers require the following hardware configuration:

  Hardware Level 7

  64 bit Intel Virtualization Technology (Intel VT) or AMD Virtualization (AMD-V) processor (2.8 Ghz

dual core or better recommended)

  Dual 500 GB hard disks 7200 RPM SATA or faster (striped)

  16 GB RAM

  DVD (dual layer recommended)

  Network adapter

  Dual SVGA monitors 17” or larger supporting 1440X900 minimum resolution

  Microsoft Mouse or compatible pointing device

  Sound card with amplified speakers

In addition, the instructor computer must be connected to a projection display device that supports1280X1024 pixels, 16 bit colors.

Page 17: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 17/64

1-1

Lab 1

Introduction to Windows 8 Platform

Contents:

Lab Overview 1-2 

Lab Setup 1-2 

Exercise 1: Using the Start screen 1-3 

Exercise 2: Running Apps Using Tiles 1-5 

Exercise 3: Using the Charms Bar 1-6 

Page 18: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 18/64

1-2 Introduction to Windows 8 Platform

Lab Overview

Estimated time to complete this lab

20 minutes

ObjectivesThe lab objectives:

  Use the Windows 8 Start screen

  Run apps using tiles

  Use the Charms bar

Lab SetupLog on to the virtual machine named SEA-DEV11 as Admin with the password Pa$$w0rd 

Page 19: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 19/64

Hands On Lab: Introduction to Windows® 8 Development - C# 1-3

Exercise 1: Using the Start screen

Overview

In this exercise, you will learn about the new features included on the Windows 8 Start screen and also

how to use the Start screen by modifying its appearance.

.

  Task 1: Moving App Groups

1.  In Windows 8, press the Windows key to go to the Start screen.

Note: The Windows key displays or hides the Start screen.

Note: The Start screen includes Tiles, which come in two forms: narrow and wide. Tiles are

the gateway to apps. They can interact with the user as live tiles and they are used to draw

attention to the app. 

2.  To reveal all the apps included in the Start screen, use the scrollbar to scroll left and right.

3.  To organize and name Tile groups, click the magnifier icon located near the scrollbar in the right

bottom corner, opening a grouping view.

Note: Using the grouping view, you can organize and name groups of apps. 

4.  Click the first Tile group and drag it after the second Tile group.

5.  Click anywhere on the screen.

Note: You can see that the group has changed its place. 

  Task 2: Naming an App Group

1.  Click the magnifier icon located near the scrollbar in the right bottom corner.

2.  To open the app bar, right click on a group.

3.  Click the Name Group button located inside the app bar.

4.  In the Flyout’s textbox, type the group name, Group 1, and then click the Name button.

Note: Flyouts are part of Metro style UI. They are used for interaction with the users.

5.  Click anywhere on the screen.

Note: You can see the group has a name. 

  Task 3: Exploring the All Apps Screen

1.  Press the right mouse button to illustrate the app bar with the All Apps button.

2.  To display the All Apps screen, click the All Apps button displaying all the available apps.

Page 20: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 20/64

1-4 Introduction to Windows 8 Platform

Note: In the All Apps screen, you are able to see all the apps available to run. 

Results: The Start screen appearance changes.

Page 21: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 21/64

Hands On Lab: Introduction to Windows® 8 Development - C# 1-5

Exercise 2: Running Apps Using Tiles

Overview

In this exercise, you run the Music app, and then explore the app and its behavior to become more

familiar with Metro style. 

  Task 1: Running an App

1.  Press the Windows key.

2.  Click the Music tile.

3.  In the Music Beta Program Agreement screen, click I Accept.

Note: If you are prompted with a screen to sign in with a Microsoft account, just press the

Close button.

4.  In the Spotlight group, click one item, displaying the artist details.

Note: Metro style apps are very natural to use. An example of this is when you click on a

spotlight item, it displays the artist details. 

5.  Use the scrollbar to display all the artist details.

Note: You can see that the Start screen’s look and feel resembles the app’s look and feel.

6.  Click the left arrow button located in the top left corner of the screen.

Note: The left arrow button is the Metro style UI back button.

7.  To display the Music app bar, right-click the right mouse button.

Note: The app can run Music, and the app bar can help to play the music with the

command buttons you see. 

Results: The Music app appears.

Page 22: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 22/64

1-6 Introduction to Windows 8 Platform

Exercise 3: Using the Charms Bar

Overview

In this exercise, you will become familiar with the charms bar and learn how to use the charms bar by

using its search contract to search for an artist in the Music app. 

  Task 1: Searching Inside an App Using the Charms Bar

1.  In the Music app, move the mouse pointer over the screen’s right bottom corner to display the

Charms menu.

2.  Click Search Charm.

Note: Charms are contract apps used to integrate functionality to the operating system.

3.  Type “owl” in the Search box, and if there is an Internet connection, items such as Owl City, are

displayed.

4.  Click on the first item to run its details inside the Music app.

5.  Press the Windows key.

6.  Move the mouse pointer over the screen’s right bottom corner displaying the Charms menu.

Note: Using contracts can help users to interact with the apps in a better way because apps

can expose functionality through the operating system integration. 

Results: The Music app displays results according to the search query.

Page 23: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 23/64

2-1

Lab 2

Working with Metro Style Guidelines

Contents:

Lab Overview 2-2 

Lab Setup 2-2 

Exercise 1: Exploring Metro Style Apps 2-3 

Page 24: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 24/64

2-2 Working with Metro Style Guidelines

Lab Overview

Estimated time to complete this lab

20 minutes

ObjectivesThe lab objectives:

  Examine Metro style apps and their design

Lab SetupLog on to the virtual machine named SEA-DEV11 as Admin with the password Pa$$w0rd.

Page 25: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 25/64

Hands On Lab: Introduction to Windows® 8 Development - C# 2-3

Exercise 1: Exploring Metro Style Apps

Overview

In this exercise, you will explore the Finance the Video apps. Exploring these applications will help you

understand the concepts of the Metro style UI. 

  Task 1: Exploring the Finance App

1.  Press the Windows key.

2.  Click the Finance Tile.

3.  Explore the app start screen.

Note: You can see that there is no chrome in the app and that the app captures the entire

screen. The content is the main issue so, when you scroll to the right, you can see that it almost

“jumps” into your eyes. 

4.  Click the information button (circle with an 'i' inside it), located on the app start screen.

Note: You see a flyout that gives additional information about the image in the app start

screen. Flyouts are part of the Metro style UI. 

5.  Click the right mouse button to reveal the app bar.

Note: App bars are part of the Metro style UI. They are a means of interaction and are used

instead of menus.

6.  In the app bar, click the News button.

Note: The News view shows business news. You can see that it is also implemented with

Metro style UI, chromeless with the content in the front.

7.  Click the back button, located in the left top corner of the screen.

Note: The back button is part of the Metro style UI guidelines. Its location is crucial. It

always appears in the left top corner in apps implemented with a left to right direction. In apps

implemented with a right to left direction, the button appears in the right top corner. 

8.  Scroll to the right and locate the WATCHLIST section. In this section, press on one of the squares to

go into a more detailed view about the stock.

Note: This is an example of a Spoke, which is used as the base to drill down to see an item’s

details. 

9.  Move the mouse to the right bottom corner of the screen to reveal the charms bar.

Page 26: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 26/64

2-4 Working with Metro Style Guidelines

10.  Click the Search charm.

11.  In the search textbox, type MSFT.

12.  Click the MSFT suggested item.

Note: Charms can be also used outside the scope of the app. After clicking the item, youare moved to MSFT details view.

13.  Press the Windows key.

14.  Take a look at the Finance tile.

Note: The tile shows finance information. This is another Metro style UI, which is called live

tiles. Live tiles help draw user attention to apps that aren’t running. 

  Task 2: Exploring the Video App

1.  Click the Video Tile.

2.  In the Video Beta Program Agreement window, click I Accept.

3.  If you are prompted with a screen to sign in with a Microsoft account, just press the Close button.

4.  Explore the Video app.

Note: As in the previous exercise, the Video app follows the Metro style UI concepts. 

5.  Scroll to the movies marketplace and press the Show More tile.

6.  Explore the marketplace.

Note: You can see the screen is divided into groups such as Featured, Top, Genres, and

Studios. The groups act like traditional tabs, but they follow the Metro style concept that doesn’t

include chrome. The list shown in each of the groups was created by a ListView control, which is

also responsible for the animation you see. 

7.  Click the back button to return to the app start screen.

8.  If your screen resolution is higher than 1366x768, move the mouse to the top of the screen. The

mouse should change from a cursor to a hand. Click the left mouse button and drag the app to the

left side of the screen to move to Snap view. Drag the separator to the right to return to full screen.

Note: Snap view enables you to run two apps simultaneously. Each app gets a share of the

screen. Snap view is only available on screen resolutions higher than 1366x768 

Results: No result.

Page 27: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 27/64

3-1

Lab 3

Implementing Metro Style Apps with XAML and C#

Contents:

Lab Overview 3-2 

Lab Setup 3-2 

Exercise 1: Creating a Grid Application 3-3 

Exercise 2: Creating a Split Application 3-4 

Exercise 3: Using the WinRT Library 3-5 

Page 28: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 28/64

3-2 Implementing Metro Style Apps with XAML and C#

Lab Overview

Estimated time to complete this lab

40 Minutes 

ObjectivesThe lab objectives:

  Create a Grid Application

  Create a Split Application

  Use the WinRT Library

Lab SetupLog on to the virtual machine named SEA-DEV11 as Admin with the password Pa$$w0rd.

Page 29: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 29/64

Hands On Lab: Introduction to Windows® 8 Development - C# 3-3

Exercise 1: Creating a Grid Application

Overview

In this exercise, you use the Grid Application project template to create a Metro style grid app. 

  Task 1: Creating a Grid App1.  On the Start screen, click the Visual Studio 2012 Tile.

2.  In case prompted by Developer License dialog Click I Agree.

3.  Type an e-mail address and password in the Windows Security dialog.

4.  On the Visual Studio Start screen, click the File menu, then click New, and finally click Project.

5.  In the New Project dialog, click Templates, and then search for the Visual C# menu item and click it.

Note: With XAML/C#, there are 3 different project templates to build Metro style apps.

6.  Click the Grid Application project, and then click OK .

7.  Press F5 to run the application.

8.  In the grid app, click items to display their details and, to return to the grid main screen, click the

Back button.

Results: You have a simple Metro style grid app.

Page 30: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 30/64

3-4 Implementing Metro Style Apps with XAML and C#

Exercise 2: Creating a Split Application

Overview

In this exercise, you have the chance to use the Split Application project template to create a Metro style

split app. 

  Task 1: Creating a Split App

1.  To move back to Visual Studio, move the mouse to the left top corner and click on the small screen

indicating Visual Studio.

Note: This demonstrates that Windows 8 uses all the screen corners for interaction.

2.  To stop running the previous created app, press Shift+F5.

3.  Click the File menu, click New, and then click Project.

4.  In the New Project dialog box, click Templates, and then search for and click Visual C#.

5.  Click the Split Application project, and then click OK .

6.  To run the application, press F5.

7.  In the split app, click items to display their details. In each item, click the listed sub-items displaying

item details on the screen’s right side.

Note: This is Metro style app visualization. This time it is a split app, which splits its screen

to display master-details behavior. 

Results: You make a simple Metro style split app. 

Page 31: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 31/64

Hands On Lab: Introduction to Windows® 8 Development - C# 3-5

Exercise 3: Using the WinRT Library

Overview

In this exercise, you explore the "EverydayWidgets" app to become familiar with WinRT and its controls.  

  Task 1: Exploring the “EverydayWidget” Demo1.  Open the EveryDayWidgets folder in the E:\Allfiles\Mod03\Labfiles folder.

2.  Double-click the BasicControls.sln file to open the solution.

3.  Choose the Microsoft Visual Studio 2012 icon.

4.  Press F5 to run the app.

5.  Select Miscellaneous Controls from the Select scenario combo box. Examine the controls shown in

the demo screen.

6.  Select Button Controls from the Select scenario combo box. Examine the controls shown in the

demo screen. Pay attention to the toggle switch.

7.  Select Progress controls from the Select scenario combo box. Examine the configurations shown inthe demo screen.

8.  Redo steps 4, 5 and 6 for other controls in the combo box.

9.  Use Alt+Tab to move back to Visual Studio and then stop debugging the application.

10.  Double-click the ScenarioOutput3.xaml file.

11.  Look at the declaration of the slider control named Slider1 

<Slider x:Name="Slider1" Width="130" Margin="60,0,0,0" VerticalAlignment="Center"/>

12.  Double-click the ScenarioOutput2.xaml file.

13.  Look at the toggle switch control declaration.

<ToggleSwitch Grid.Row="1" VerticalAlignment="Center" Width="130"Margin="0,0,0,0" OffContent="{Binding Text,

ElementName=OffContent}"

OnContent="{Binding Text, ElementName=OnContent}"Header="{Binding Text, ElementName=HeaderText}"

HorizontalAlignment="Left"/>

14.  Double-click the ScenarioOutput1.xaml file.

15.  Look at the different progress controls declared inside the page. For example, the following code:

<ProgressBar x:Name="ProgressBar1" IsIndeterminate="{Binding IsChecked,

ElementName=ActiveCB2}"

Width="100"Value="{Binding Text, ElementName=Value,

Converter={StaticResource StringToDoubleConverter}}"

ShowPaused="{Binding IsChecked, ElementName=PausedCB}"

ShowError="{Binding IsChecked, ElementName=ErrorCB}"/>

Results: You will become familiar with WinRT and its controls

Page 32: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 32/64

3-6 Implementing Metro Style Apps with XAML and C#

Page 33: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 33/64

4-1

Lab 4

Integrating with Windows 8 Experiences

Contents:

Lab Overview 4-2 

Lab Setup 4-2 

Exercise 1: Integrating Search Contract 4-3 

Exercise 2: Integrating Share Contract 4-5 

Exercise 3: Integrating Settings Contract 4-9 

Page 34: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 34/64

4-2 Integrating with Windows 8 Experiences

Lab Overview

Estimated time to complete this lab

30 minutes

ObjectivesThe lab objectives:

  Integrate Search Contract

  Integrate Share Contract

  Integrate Settings Contract

Lab SetupLog on to the virtual machine named SEA-DEV11 as Admin with the password Pa$$w0rd.

Page 35: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 35/64

Hands On Lab: Introduction to Windows® 8 Development - C# 4-3

Exercise 1: Integrating Search Contract

Overview

In this exercise, you will explore the search demo app, which includes the integration of a search contract

inside a Metro style app.

  Task 1: Exploring the Search Demo

1.  Open the Search folder located in the E:\Allfiles\Mod04\Labfiles folder.

2.  Double-click the SearchExtensionSample.sln file to open the solution.

3.  Press F5 to run the app.

4.  Move the mouse to the right-bottom corner of the screen to open the charms bar.

5.  Select the Search charm.

6.  Type the word “query” and click the magnifier button (or press Enter). You get an output message

on screen that a search was activated with the query: query.

7.  From the Select scenario combo box, press the Suggestions from an app-defined list item.

8.  Move the mouse to the right-bottom corner of the screen to open the charms bar.

9.  Select the Search charm.

10.  Type q in the search textbox and explain to the students that the options they can choose from are

based upon previous search terms (queries) and that the option "Quebec City" originates from the

running app.

11.  Press Alt+Tab to return to Visual Studio® and then stop debugging the application.

12.  Double-click the package.appxmanifest file, located in the project.

13.  Click the Declarations tab and show the students that the app is declared as exposing a search

contract.

14.  Double-click the App.Xaml.cs file, located in the project.

15.  Look at the OnSearchActivated method, which includes the wire to the activated event and check

that activation was made by the search:

async protected override void OnSearchActivated(SearchActivatedEventArgs args)

{base.OnSearchActivated(args);

await EnsureMainPageAsync(args);

((MainPage)Window.Current.Content).UpdateTitle(

args.QueryText);

16. 

Double click on MainPage.xaml.cs 17.  Show the students Scenario2ProvideAppDefinedSuggestions method, which includes the check

against an array and includes some suggested data:

private void Scenario2ProvideAppDefinedSuggestions(string queryText,

SearchPaneSuggestionsRequest request)

{string[] suggestionList = {"Shanghai", "Istanbul", "Karachi", "Delhi",

"Mumbai", "Moscow", "São Paulo", "Seoul", "Beijing", "Jakarta", "Tokyo", "Mexico

City", "Kinshasa", "New York City", "Lagos", "London", "Lima", "Bogota", "Tehran","Ho Chi Minh City", "Hong Kong", "Bankok", "Dhaka", "Cairo", "Hanoi", "Rio de

Janeiro", "Lahore", "Chonquing", "Banglore", "Tianjin", "Baghdad", "Riyadh",

Page 36: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 36/64

4-4 Integrating with Windows 8 Experiences

"Singapore", "Santiago", "Saint Petersburg", "Surat", "Chennai", "Kolkata", "Yangon",

"Guangzhou", "Alexandria", "Shenyang", "Hyderabad", "Ahmedabad", "Ankara","Johannesburg", "Wuhan", "Los Angeles", "Yokohama", "Abidjan", "Busan", "Cape Town",

"Durban", "Pune", "Jeddah", "Berlin", "Pyongyang", "Kanpur", "Madrid", "Jaipur",

"Nairobi", "Chicago", "Houston", "Philadelphia", "Phoenix", "San Antonio", "SanDiego", "Dallas", "San Jose", "Jacksonville", "Indianapolis", "San Francisco",

"Austin", "Columbus", "Fort Worth", "Charlotte", "Detroit", "El Paso", "Memphis",

"Baltimore", "Boston", "Seattle Washington", "Nashville", "Denver", "Louisville","Milwaukee", "Portland", "Las Vegas", "Oklahoma City", "Albuquerque", "Tucson",

"Fresno", "Sacramento", "Long Beach", "Kansas City", "Mesa", "Virginia Beach",

"Atlanta", "Colorado Springs", "Omaha", "Raleigh", "Miami", "Cleveland", "Tulsa","Oakland", "Minneapolis", "Wichita", "Arlington", " Bakersfield", "New Orleans",

"Honolulu", "Anaheim", "Tampa", "Aurora", "Santa Ana", "St. Louis", "Pittsburgh",

"Corpus Christi", "Riverside", "Cincinnati", "Lexington", "Anchorage", "Stockton","Toledo", "St. Paul", "Newark", "Greensboro", "Buffalo", "Plano", "Lincoln",

"Henderson", "Fort Wayne", "Jersey City", "St. Petersburg", "Chula Vista", "Norfolk",

"Orlando", "Chandler", "Laredo", "Madison", "Winston-Salem", "Lubbock", "BatonRouge", "Durham", "Garland", "Glendale", "Reno", "Hialeah", "Chesapeake",

"Scottsdale", "North Las Vegas", "Irving", "Fremont", "Irvine", "Birmingham",

"Rochester", "San Bernardino", "Spokane", "Toronto", "Montreal", "Vancouver",

"Ottawa-Gatineau", "Calgary", "Edmonton", "Quebec City", "Winnipeg", "Hamilton"};foreach (string suggestion in suggestionList)

{

if (suggestion.StartsWith(queryText,StringComparison.CurrentCultureIgnoreCase))

{

// Add suggestion to Search Pane

request.SearchSuggestionCollection.AppendQuerySuggestion(suggestion);

}

// Break since the Search Pane can show at// most 5 suggestions

if (request.SearchSuggestionCollection.Size

>= MainPage.SearchPaneMaxSuggestions)

{break;

}

}

if (request.SearchSuggestionCollection.Size >0)

{ScenarioSearchQuery.Text = "Suggestions

provided for query: " + queryText;

}else

{

ScenarioSearchQuery.Text = "No suggestionsprovided for query: " + queryText;

}

Note: Notice the call for the appendQuerySuggestion function, which is responsible to

add a query suggestion to the searchSuggestionCollection object that the app returns.

Results: You will be able to search within an application.

Page 37: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 37/64

Hands On Lab: Introduction to Windows® 8 Development - C# 4-5

Exercise 2: Integrating Share Contract

Overview

In this exercise, you will explore the share demo app, which includes integration of a share contract inside

a Metro style app.

  Task 1: Exploring the Share Demo

1.  Open the Share folder located in the E:\Allfiles\Mod04\Labfiles folder.

2.  Open the Target folder and double-click the ShareTarget.sln file to open the solution.

3.  Press F5 to run the app.

4.  Press Alt+Tab to return to Visual Studio and then Shift+F5 to stop running the app.

Note: These operations add the share target app to the share contracts that are available.

5. 

Double-click on the package.appxmanifest file, which is located in the project.6.  Click on the Declarations tab to show the students that the app is declared as exposing a share

contract and that the data is configured.

7.  Double-click on the MainPage.xaml.cs file, which is located in the project.

8.  Notice that the activated function is checking whether a share was performed and is acting

accordingly:

public async Task ActivateAsync(ShareTargetActivatedEventArgs args)

{

if (args.Kind ==Windows.ApplicationModel.Activation.ActivationKind.ShareTarget)

{

this.shareOperation = args.ShareOperation;dataPackageTitle.Text = this.shareOperation.Data.Properties.Title +

Environment.NewLine;

dataPackageDescription.Text =

this.shareOperation.Data.Properties.Description + Environment.NewLine;if (!String.IsNullOrEmpty(this.shareOperation.QuickLinkId))

{

selectedQuicklinkId.Text += this.shareOperation.QuickLinkId +Environment.NewLine;

}

else{

quicklinkError.Visibility = Visibility.Visible;

}if (this.shareOperation.Data.Contains(StandardDataFormats.Uri))

{

Uri uri = await this.shareOperation.Data.GetUriAsync();if (uri != null)

{

contentValue.Text = "Uri: " + uri.AbsoluteUri +Environment.NewLine;

}

}if (this.shareOperation.Data.Contains(StandardDataFormats.Text))

{

string text = await this.shareOperation.Data.GetTextAsync();if (text != null)

{

Page 38: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 38/64

4-6 Integrating with Windows 8 Experiences

contentValue.Text += "Text: " + text + Environment.NewLine;

}}

if

(this.shareOperation.Data.Contains(StandardDataFormats.StorageItems)){

IReadOnlyList<IStorageItem> storageItems = null;

storageItems = awaitthis.shareOperation.Data.GetStorageItemsAsync();

string fileList = String.Empty;

for (int index = 0; index < storageItems.Count; index++){

fileList += storageItems[index].Name;

if (index < storageItems.Count - 1)

{fileList += ", ";

}

}contentValue.Text += "StorageItems: " + fileList +

Environment.NewLine;

}

if (this.shareOperation.Data.Contains(dataFormatName))

{ string receivedStrings = await

this.shareOperation.Data.GetTextAsync(dataFormatName);contentValue.Text += "Custom format data" + Environment.NewLine;

JsonObject customObject = null;

if (JsonObject.TryParse(receivedStrings, out customObject))

{if (customObject.ContainsKey("type"))

{

if (customObject["type"].GetString() =="http://schema.org/Book")

{

// This sample expects the custom format to be oftype http://schema.org/Book

receivedStrings = "Type: " +

customObject["type"].Stringify();

JsonObject properties =customObject["properties"].GetObject();

receivedStrings += Environment.NewLine + "Image: " +properties["image"].Stringify()

+ Environment.NewLine + "Name: " +

properties["name"].Stringify()+ Environment.NewLine + "Book Format:

" + properties["bookFormat"].Stringify()

+ Environment.NewLine + "Author: " +properties["author"].Stringify()

+ Environment.NewLine + "Number of

Pages: " + properties["numberOfPages"].Stringify()+ Environment.NewLine + "Publisher: "

+ properties["publisher"].Stringify()

+ Environment.NewLine + "Date

Published: " + properties["datePublished"].Stringify()+ Environment.NewLine + "In Language:

" + properties["inLanguage"].Stringify()

+ Environment.NewLine + "ISBN: " +properties["isbn"].Stringify();

}

}

}contentValue.Text += receivedStrings;

}

if (this.shareOperation.Data.Contains(StandardDataFormats.Html))

{

Page 39: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 39/64

Hands On Lab: Introduction to Windows® 8 Development - C# 4-7

string htmlFormat = await

this.shareOperation.Data.GetHtmlFormatAsync();string htmlFragment =

HtmlFormatHelper.GetStaticFragment(htmlFormat);

contentValue.Text += "HTML: " + Environment.NewLine;this.webView.Visibility = Visibility.Visible;

this.webView.NavigateToString("<html><body>" + htmlFragment +

"</body></html>");}

if (this.shareOperation.Data.Contains(StandardDataFormats.Bitmap))

{this.imageLabel.Visibility = Visibility.Visible;

imageHolder.Visibility = Visibility.Visible;

IRandomAccessStreamReference imageReceived = await

this.shareOperation.Data.GetBitmapAsync();IRandomAccessStreamWithContentType stream = await

imageReceived.OpenReadAsync();

BitmapImage bitmapImage = new BitmapImage();bitmapImage.SetSource(stream);

imageHolder.Source = bitmapImage;

}

}

Window.Current.Content = this;Window.Current.Activate();

}

9.  Go back to Windows Explorer and open E:\Allfiles\Mod04\Labfiles\Share folder.

10.  Open the Source folder and double-click on the ShareSource.sln file in order to open the solution.

11.  Press F5 to run the app.

12.  Click on the Set button to set the data package.

13.  Click on the Yes, share with friends button to open the share pane.

14.  In the share pane, click on the Share Target Sample App to activate sharing between the source and

the target apps.

Note: The share target app is activated and shows its page inside the share pane.

15.  Click on the Report Completed button to finish the share.

16.  Press Alt+Tab to return to Visual Studio and then Shift+F5 to stop running the app.

17.  Double-click the MainPage.xaml.cs file, which is located in the project.

18.  Look at the ShareSourceLoad method, which wires the Datarequested event handler:

public void ShareSourceLoad()

{ DataTransferManager datatransferManager;

datatransferManager = DataTransferManager.GetForCurrentView();

datatransferManager.DataRequested += new

TypedEventHandler<DataTransferManager, DataRequestedEventArgs>(this.DataRequested);}

async void DataRequested(DataTransferManager sender, DataRequestedEventArgs

e){

e.Request.Data.Properties.Title = this.dataPackageTitle;

e.Request.Data.Properties.Description = this.dataPackageDescription;

if (this.dataPackageThumbnail != null){

Page 40: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 40/64

4-8 Integrating with Windows 8 Experiences

e.Request.Data.Properties.Thumbnail = this.dataPackageThumbnail;

}switch (this.scenarioId)

{

case ScenarioId.Text:e.Request.Data.SetText(this.dataPackageText);

break;

case ScenarioId.Uri:e.Request.Data.SetUri(this.dataPackageUri);

break;

case ScenarioId.Image:e.Request.Data.SetBitmap(this.imageStreamRef);

break;

case ScenarioId.StorageItems:

e.Request.Data.SetStorageItems(this.storageItems);break;

case ScenarioId.ImageDelayedRendering:

e.Request.Data.SetDataProvider(StandardDataFormats.Bitmap,OnDeferredImageRequestedHandler);

break;

case ScenarioId.HTML:

e.Request.Data.SetData(StandardDataFormats.Html,

this.dataPackageText);break;

case ScenarioId.CustomData:string dataFormat = this.dataFormatInputBox7.Text;

e.Request.Data.SetData(dataFormat, this.dataPackageText);

break;

case ScenarioId.CustomError:e.Request.FailWithDisplayText(this.customErrorMessage);

break;

default:e.Request.FailWithDisplayText("Invalid Share scenario

selected.");

break;}

}

19.  Look at the ScenarioID.Text case inside the DataRequested EventHandler, used in the scenario

shown earlier:

…switch (this.scenarioId)

{

case ScenarioId.Text:e.Request.Data.SetText(this.dataPackageText);

break;

}

Results: You are able to share data between applications.

Page 41: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 41/64

Hands On Lab: Introduction to Windows® 8 Development - C# 4-9

Exercise 3: Integrating Settings Contract

Overview

In this exercise, you will explore the settings demo app, which includes integration of a settings contract

inside a Metro style app.

  Task 1: Exploring the AppSettings Demo

1.  Open the Settings folder located in the E:\Allfiles\Mod04\Labfiles folder.

2.  Double-click the ApplicationSettings.sln file to open the solution.

3.  Press F5 to run the app.

4.  Click the Show settings charm button to open the charms bar, you will see only the default

Permissions command.

5.  From the Select scenario combo box, press the Add settings Commands to the settings charm item.

6.  Click the Add settings commands.

7.  Notice that both a General command and a Help command were added to the settings charm.

8.  Click the Show settings charm button to open the charms bar, which now holds the Help settings.

9.  Click the Help link in the charm bar to reveal the General settings.

10.  Click the back button in the General settings to return to the settings charm.

11.  Press Alt+Tab to return to Visual Studio and then stop debugging the application.

12.  Double-click the ScenarioInput2.xaml.cs file, located in the project folder.

13.  Look at the code declaration that adds the General and Help commands to the settings pane:

SettingsCommand generalCommand = new SettingsCommand("generalSettings", "General",

new UICommandInvokedHandler(onSettingsCommand));

args.Request.ApplicationCommands.Add(generalCommand);SettingsCommand helpCommand = new SettingsCommand("helpPage", "Help", new

UICommandInvokedHandler(onSettingsCommand));

args.Request.ApplicationCommands.Add(helpCommand);

Note: The code exists in the ScenarioInput2_CommandsRequested method.

14.  Look at the call for the SettingsPane.Show method, which is used to show the settings pane:

SettingsPane.Show();

Note: The previous line of code exists in the scenario2Show_Click method, which is an

event handler for the scenario2Show button click event.

15.  Double-click the HelpControl.xaml file, in the project folder.

16.  The HelpControl.Xaml is a simple user control used as a settings page.

Results: You can display Application Settings using the Settings Contract

Page 42: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 42/64

4-10 Integrating with Windows 8 Experiences

Page 43: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 43/64

5-1

Lab 5

Implementing Tiles and Notifications

Contents:

Lab Overview 5-2 

Lab Setup 5-2 

Exercise 1: Using Live Tiles in a Metro Style App 5-3 

Exercise 2: Using Toast Notifications in a Metro Style App 5-5 

Page 44: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 44/64

5-2 Implementing Tiles and Notifications

Lab Overview

Estimated time to complete this lab30 Minutes

ObjectivesThe lab objectives are:

  Integrate live tiles into a Metro style app

  Integrate toast notifications into a Metro style app

Lab SetupLog on to the virtual machine named SEA-DEV11 as Admin with the password Pa$$w0rd.

Page 45: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 45/64

Hands On Lab: Introduction to Windows® 8 Development - C# 5-3

Exercise 1: Using Live Tiles in a Metro Style App

Overview

In this exercise, you will explore the live tiles demo, including live tile integration inside a Metro style app.

  Task 1: Explore the LiveTiles Demo1.  In the E:\Allfiles\Mod05\LabFiles\Coding Live Tiles folder, double-click on the Tiles.sln file.

2.  To run the app, press F5.

3.  To move to the Start screen, press the Windows key.

4.  Scroll to the right until locating the tile with Windows SDK Tiles C#.

Note: This tile was created for the app when the app started running for the first time.

5.  To return back to the app view, click the tile  app.

6.  Click the button labeled Send tile notification with text.

7.  To open the Start screen, press the Windows key.

8.  Scroll to the right until locating the tile with Windows SDK Tiles C#.

Note: You have just sent a text notification to the tile.

9.  To return back to the app view, click the app tile.

10.  To explore other tiles possibilities, select scenarios from the Select scenario box.

 Task 2: Explore the LiveTiles Demo Code

1.  To move back to Visual Studio®, press Alt+Tab and then stop debugging the application.

2.  In Solution Explorer, open the SendTextTile.xaml.cs file.

3.  Look at the UpdateTileWithText_Click method that creates the tile text notification:

private void UpdateTileWithText_Click(object sender, RoutedEventArgs e)

{// Note: This sample contains an additional project,

NotificationsExtensions.

// NotificationsExtensions exposes an object model for creatingnotifications, but you can also modify the xml

// of the notification directly using

TileUpdateManager.GetTemplateContent(TileTemplateType)

// create the wide templateITileWideText03 tileContent = TileContentFactory.CreateTileWideText03();

tileContent.TextHeadingWrap.Text = "Hello World! My very own tilenotification";

// Users can resize tiles to square or wide.

// Apps can choose to include only square assets (meaning the app's tilecan never be wide), or

// include both wide and square assets (the user can resize the tile to

square or wide).

// Apps cannot include only wide assets.// Apps that support being wide should include square tile notifications

since users

// determine the size of the tile.

Page 46: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 46/64

5-4 Implementing Tiles and Notifications

// create the square template and attach it to the wide template

ITileSquareText04 squareContent =TileContentFactory.CreateTileSquareText04();

squareContent.TextBodyWrap.Text = "Hello World! My very own tile

notification";tileContent.SquareContent = squareContent;

// send the notification

TileUpdateManager.CreateTileUpdaterForApplication().Update(tileContent.CreateNotifica

tion());

OutputTextBlock.Text = MainPage.PrettyPrint(tileContent.GetContent());

}

Results: You will learn how tiles work in Windows 8

Page 47: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 47/64

Hands On Lab: Introduction to Windows® 8 Development - C# 5-5

Exercise 2: Using Toast Notifications in a Metro StyleApp

Overview

In this exercise, students explore the toast notifications app, which includes integrating toast notificationsinside a Metro style app.

  Task 1: Explore the Toasts Demo

4.  In the E:\Allfiles\Mod05\LabFiles\Toast Notifications folder, double-click the ToastsSampleCS.sln

file.

5.  To run the app, press F5.

6.  To demonstrate a toast notification, click ToastText01. The toast notification disappears after a few

seconds.

7.  To demonstrate other toast notifications, click other buttons.

8.  In the Select scenario box, select Using package images with text.

9.  To demonstrate a toast notification including an image, click ToastImageAndText01.

  Task 2: Explore the Toasts Demo Code

10.  To move back to Visual Studio, press Alt+Tab and then stop debugging the application.

11.  In Solution Explorer, open the project root, and then open the MainPage.xaml.cs file.

12.  Look at the following code, which is located inside the Scenario1DisplayToast method:

IToastText01 templateContent = ToastContentFactory.CreateToastText01();

templateContent.TextBodyWrap.Text = "Body text that wraps";

Note: These lines create the toast notification with the notification text.

13.  Look at the following code, which is located inside the scenario1DisplayToast function:

// Create a toast, then create a ToastNotifier object to show// the toast

ToastNotification toast = toastContent.CreateNotification();

// If you have other applications in your package, you can specify theAppId of

// the app to create a ToastNotifier for that application

ToastNotificationManager.CreateToastNotifier().Show(toast);

Note: These lines create the notification and display them to the user.

Results: You will send various toast notifications through the demo app.

Page 48: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 48/64

5-6 Implementing Tiles and Notifications

Page 49: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 49/64

6-1

Lab 6

Deploying to the Windows Store

Contents:

Lab Overview 6-2 

Lab Setup 6-2 

Exercise 1: Exploring the Windows Store 6-3 

Exercise 2: Exploring a Trial Version to a Metro Style App 6-4 

Page 50: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 50/64

6-2 Deploying to the Windows Store

Lab Overview

Estimated time to complete this lab

20 minutes

ObjectivesThe lab objectives are:

  Use and get to know the Window Store and its categories

  Use license configuration

Lab SetupLog on to the virtual machine named SEA-DEV11 as Admin with the password Pa$$w0rd.

Page 51: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 51/64

Hands On Lab: Introduction to Windows® 8 Development - C# 6-3

Exercise 1: Exploring the Windows Store

Overview

In this demonstration, you will become familiar with the new Windows Store.

  Task 1: Discovering the New Window Store1.  Press the Windows key.

Note: The Windows key displays or hides the Start screen.

2.  Find the Store tile. Normally, if the tile has not been moved to another position, it should be the top

left tile. In case you don’t find it easily, use the search app, writing “store” (no focus is needed into the

search field).

3.  Once the Windows store is open, navigate using the scrollbar. Explain to students that the store is

divided into groups such as Games, Social, Entertainment, etc. and there is a main group called

Spotlight, which contains recommended apps and among others Top Free and New Releases.

4.  Join a Top Free group and talk about how these are recommended applications, with the highest

ranking in the market.

5.  Click the back button and find “Cut the Rope” in the Game group. Click this tile.

6.  Review each section of the page, explaining how the applications get stars. Also explain the

importance of writing an expressive description of the app.

7.  Click the Details group and examine each item.

8.  Click the Reviews group and describe the importance of this.

9.  Click the “Install” button and wait. After the installation process begins, you are redirected to the

Windows Store main display. Pay attention to the Progress Bar at the top of the screen.

10.  Press the Windows key and find the new game installed at the end of the tile list.

Note: Of course, you can open the game and demonstrate the game for a while.

Results: Downloaded and installed the app "Cut the Rope"

Page 52: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 52/64

6-4 Deploying to the Windows Store

Exercise 2: Exploring a Trial Version to a Metro StyleApp

Overview

In this exercise, you will use the license configuration file to change the price of the app and change thetrial mode property of the app.

  Task 1: Exploring a Trial Version

1.  On the Start screen, right click the Visual Studio® 2012 Tile and choose Run as administrator.

Note: If it is Visual Studio’s first run, it might prompt a dialog display. If you see the

dialog, click OK .

2.  In the File menu choose open and navigate to ContosoCookBook folder located in

E:\Allfiles\Mod06\Labfiles folder.

3.  Double-click on the ContosoCookbook.sln file to open the solution.

4.  Right click on the solution in the solution explorer and select Clean Solution. 

5.  Right click on the solution in the solution explorer and select Build Solution. 

6.  Press F5 to launch the application.

Note: Where an error occurs blocking the app execution, repeat steps 4-6.

7.  Display the charms bar and tap the Settings charm.

8.  Tap About in the settings menu to display the about page.

9.  Confirm that a purchase button appears in the about page, and that the purchase price is $12.99.

10.  Return to Visual Studio and stop debugging.

11.  Open the license.xml file located in the Data folder and change the purchase price in the <Price>

element in the <App> section from $12.99 to $8.99.

12.  Launch the app again and go to the about page. Be sure to check the price shown on the purchase

button now, and emphasize this to the students.

13.  Return to Visual Studio once more and stop debugging.

14.  Open license.xml again and change the price back to $12.99. Also change <IsTrial> from true to

false.

15.  Launch the app and go to the about page. Verify that the purchase button is gone and that you

now see the “Valid until Saturday, December 31, 2022”.

16.  Return to Visual Studio and stop debugging.

Results: You have the opportunity to explore the license configuration.

Page 53: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 53/64

Notes

Page 54: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 54/64

Notes

Page 55: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 55/64

Notes

Page 56: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 56/64

Notes

Page 57: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 57/64

Notes

Page 58: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 58/64

Notes

Page 59: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 59/64

Notes

Page 60: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 60/64

Notes

Page 61: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 61/64

Notes

Page 62: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 62/64

Notes

Page 63: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 63/64

Notes

Page 64: 40026A-ENU-StudentHandbook.pdf

7/27/2019 40026A-ENU-StudentHandbook.pdf

http://slidepdf.com/reader/full/40026a-enu-studenthandbookpdf 64/64

Notes