Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Visual Studio 2013 Cookbook
Visual Studio 2013 Cookbook

Visual Studio 2013 Cookbook: Understanding the latest features of Visual Studio can speed up and streamline your projects. And there's no better learning tool than this collection of focused recipes that gives you the fast, hands-on experience you need.

eBook
Mex$561.99 Mex$803.99
Paperback
Mex$1004.99
Subscription
Free Trial

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Visual Studio 2013 Cookbook

Chapter 2. Getting Started with Windows Store Applications

In this chapter, we will cover:

  • Getting a Windows Store app developer license

  • Creating a Windows Store app

  • Adding a Windows Store item template to your app

  • Using the Windows Store app simulator

  • Defining capabilities and contracts

  • Analyzing your App's performance

  • Packaging your Windows Store app

  • Validating your Windows Store app

Introduction


The appearance of the Windows Runtime (WinRT) brought forth a lot of attention when it was introduced as part of the shift in focus to Windows 8. Since the general availability of Windows 8-based systems and the OS itself, there is an opportunity to see first hand what the runtime meant. Essentially, Microsoft felt the need to advance the state of Windows application development by providing a new platform that recognized the rise of non-PC-based devices, touch interfaces, and to combine that with a method to obtain safe and secure Windows applications. WinRT abstracts away the underlying hardware, minimizes security risks, and prevents developers from making insecure or poorly performing calls via the traditional Windows API.

What WinRT offers developers familiar with Windows-based tools is the ability to easily create secure apps that run on Windows 8-based systems. Your users benefit from a straightforward shopping, purchasing, and installation process. As a developer, you...

Getting a Windows Store app developer license


In order for your local Windows apps to be run on your local developer machine, you will need a developer license. Note that this license is free and different from a developer account. The license allows you to develop and test Windows Store apps on your local developer machine. The account is used in conjunction with distributing your app through the Windows Store. There is no cost to obtain a license; it is merely used by Microsoft to track who is developing Windows Store apps. Conversely, a fee is charged by Microsoft to obtain a developer account.

A developer license is required because there would be security implications if a malicious Store app was distributed independent of Microsoft's ability to verify its safety. Consequently, each machine or device that you intend to test your app on must have its own developer license.

In this recipe, we will cover obtaining the developer license needed so that you can get started with writing Windows...

Creating a Windows Store app


We'll begin by creating a basic Windows Store app that uses JavaScript/HTML. For this example, we will use the Hub app template.

Getting ready

Ensure that you are running Windows 8.1 in order to have the ability to create a new Windows Store app. You may use Visual Studio Express 2013 for Windows or one of the premium versions of VS2013 (Professional/Premium/Ultimate).

How to do it…

There are several types of app templates available, but we will start with the Hub style as follows:

  1. From Visual Studio's File menu, navigate to New | Project....

  2. A dialog of available project templates will appear. From the Installed templates category, navigate to the JavaScript | Windows Store | Hub App template. A preview of the app layout will appear in the details pane as shown in the following screenshot:

  3. Leave the name as the default and click on OK to create the app.

  4. The project will appear in Solution Explorer and the default.js file will be open in the document area.

  5. Press F5 to...

Adding a Windows Store item template to your app


Unless you're building a "Hello World" app, you're probably going to want to add more code files and assets to your project than are provided with the standard project templates. Since Microsoft wants Windows Store apps to not only offer great functionality, but to also meet the Windows Store design principles, it has provided a number of ready-made item templates for you to use as part of your development effort.

User interface item templates come with a common look and feel and subtle animations, so your app behaves like other Windows Store apps. Contract templates provide you with the boiler plate code and UI for building Windows 8 Contract support into your app.

In this recipe, you'll see how to use an item template to add functionality to a Windows Store app.

Getting ready

Create a new blank Windows Store app using C# by following the steps in the previous recipe, Creating a Windows Store app.

How to do it...

In order to use an item template...

Using the Windows Store app simulator


You may recall that one of the design goals of Windows Store apps was that they should run equally well on a multitude of devices, including tablets and other touch-enabled devices and they should also support a number of different views such as the Snapped and Full views.

As most developers use powerful desktops or high-end laptops for developing software, these machines exceed the capabilities of many portable devices. They also typically lack some of the other features found in portable devices such as GPS, or gyroscopes. To handle the differences between developer machines and the target devices, Microsoft includes a Windows Store app Simulator with Visual Studio that can be used to test your Windows Store apps without the need of a second physical machine to deploy to.

This recipe will show how to use the simulator to assist in developing your own apps.

Getting ready

Create a new C# based Windows Store project using the Split App (XAML) template and...

Defining capabilities and contracts


Windows 8 provides Windows Store apps with the ability to communicate with any other app on the computer without prior knowledge of what those apps might be through a concept called Contracts. A Contract is an operating system level interface that consumers or providers of information implement. The operating system then keeps track of which apps support which contracts and coordinates the information between apps using those contracts.

Window 8, as part of its focus on improving the trust level in the apps it runs, expects Windows Store apps to communicate the capabilities they need. A Capability is a permission or access right that a Windows Store app requires for it to run correctly, for example, an app that requires Internet access or local network permissions. There is a range of capabilities that the operating system can provide to Windows Store apps. An app that doesn't request capabilities from the operating system will be provided minimum level...

Analyzing your App's performance


Visual Studio 2013 has added additional app performance and diagnostic tools over what was found in VS2012. The Performance and Diagnostics menu provides the following tools:

  • CPU Sampling: This tests what parts of your app are CPU intensive.

  • Energy Consumption: This runs your app to determine how much power it consumes. It is a useful guide to maximize battery life when your app is being run on a portable device.

  • XAML UI Responsiveness: Ensuring your app feels fast to users is critical to its adoption. This tool helps you monitor where your app may need optimization.

Getting ready

For this example, we will continue to use the SplitApp project created in the Using the Windows Store app simulator recipe.

How to do it…

The following are steps to analyze your app's performance:

  1. With SplitApp open, open the Performance and Diagnostics screen. For Visual Studio Express, this is found under the menu Debug | Performance and Diagnostics. For the paid editions (Professional...

Packaging your Windows Store app


For Windows 8 to correctly load and run a Windows Store app, it must be packaged in a particular format. The information contained in the package includes the capabilities and contracts that your app uses as well as information on the app user tile, the splash screen, and more.

This recipe will show you what you need to do to package your Windows Store app so that it is ready for the world to use.

Getting ready

Open the SplitApp project that you created in the Using the Windows Store app simulator recipe.

How to do it...

Perform the following steps for packaging your Windows Store app:

  1. Open the Package.appxmanifest file from Solution Explorer.

  2. Examine the fields in the Application UI tab. Add a space to the Display Name field so that it reads as Split App instead of SplitApp.

  3. Add a useful description in the Description field. For example, A sample app using the Split layout.

  4. Moving to the Visual Assets tab, under the Tile section, confirm the Show name field is...

Validating your Windows Store app


Every app submitted to the Windows Store will be validated by Microsoft before being listed. Part of that validation process involves running the app through an automatic certification tool that Microsoft has included with Visual Studio. You should check that your app passes the certification tool before beginning the Windows Store submission process.

Getting ready

Ensure the SplitApp project you were using in the Packaging your Windows Store app recipe is working correctly and has been deployed.

For the certification process to work, your deployed version must be in the Release mode.

How to do it...

The following steps need to be performed in order to validate your Windows Store app:

  1. From the Windows Start screen, launch the Windows App Cert Kit. The app will prompt for elevation and then start a wizard as shown in the following screenshot:

  2. Select the Validate Windows Store App option. The tool will search for Windows Store apps installed on your machine and list...

Left arrow icon Right arrow icon
Download code icon Download Code

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Mar 17, 2014
Length: 332 pages
Edition :
Language : English
ISBN-13 : 9781782171973
Vendor :
Microsoft
Category :
Languages :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Mar 17, 2014
Length: 332 pages
Edition :
Language : English
ISBN-13 : 9781782171973
Vendor :
Microsoft
Category :
Languages :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just Mex$85 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just Mex$85 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total Mex$ 2,256.98
Visual Studio 2013 Cookbook
Mex$1004.99
Visual Studio 2013 and .NET 4.5 Expert Cookbook
Mex$1251.99
Total Mex$ 2,256.98 Stars icon

Table of Contents

9 Chapters
Discovering Visual Studio 2013 Chevron down icon Chevron up icon
Getting Started with Windows Store Applications Chevron down icon Chevron up icon
Web Development – ASP.NET, HTML5, CSS, and JavaScript Chevron down icon Chevron up icon
.NET Framework 4.5.1 Development Chevron down icon Chevron up icon
Debugging Your .NET Application Chevron down icon Chevron up icon
Asynchrony in .NET Chevron down icon Chevron up icon
Unwrapping C++ Development Chevron down icon Chevron up icon
Working with Team Foundation Server 2013 Chevron down icon Chevron up icon
Languages Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.2
(13 Ratings)
5 star 53.8%
4 star 23.1%
3 star 15.4%
2 star 0%
1 star 7.7%
Filter icon Filter
Top Reviews

Filter reviews by




A. Zubarev Apr 18, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Oh Visual Studio! A very fast evolving product, who does not use it when developing on a Microsoft platform?I used the one 1st in my life that came in late 90s, it if I remember correctly it offered 3-4 projects.Today, after it went through such an evolution Visual Studio has reached an enormous heights. From ETL to reports, from DirectX to tests, from database projects to Windows Store App development, and what not?A book on Visual Studio makes a lot of sense.Gladly Packt has one off its sleeve that is called Cookbook, in my view these books simply avoid wasting your time. Yet this book is quite universal, if you wish, it will take you through basics as opening a developers` account, or if you do not want to walk baby steps you can jump straight to very advanced topics as say the TPL Dataflow, WPF, Bootstrap and more.I felt the book can be sliced and diced like a multidimensional cube, back and forth without any particular order and all would still make sense. Feel free to pick only the parts you need or like.I enjoyed reading on Python with .Net integration, turned out it is simple.WCF is something I will be doing soon at work, so this book will be revisited gain.The book is full of graphics, coloreful, high quality graphics, very well structured examples, and full of insight, discusses improvements and suggest on best practices.The book also covers working with a workflow, graphics, it was even fun to refresh my C++ skills in Visual Studio 2013 retrospective.In terms of closing, it makes sense to have a printed copy or two, the book must be kept on a bookshelf ready to be borrowed by colleagues. Having it in the eBook format is as helpful as you can search it whenever you need some reference or a refresh. On another note, I wish the book could cover more material as BI, Database, F# development,I am giving this book the maximum mark possible.
Amazon Verified review Amazon
CaroleCronan Jul 09, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Excellent
Amazon Verified review Amazon
Rae J. Owen Apr 03, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Great book very helpful.
Amazon Verified review Amazon
Sergio Costa May 25, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
There’s a lot on this book, not just for those who already know and use Visual Studio and want to learn what’s new with the 2013 version, but also for those that never used it before or are even new to .Net programming. If you are a new .Net programmer, I don’t recommend you get as your first programming book, of course, but I do recommend you get it sometime along your way through your .Net path as a developer. If you are a seasoned developer, you will find a lot of stuff you probably already know but you’ll also certainly be surprised with some nice tips and get to learn a lot of new features shipped with VS2013.I definitely recommend you check Visual Studio 2013 Cookbook whenever you can. If you're serious about developing with Visual Studio, this is a great book to get and you'll certainly find something new to learn.
Amazon Verified review Amazon
Matthew Rowan Apr 28, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Why would you buy a Visual Studio 2013 book instead of just using the Internet to find what you need? Simple, time and content. The amount of new features and ways to do things in this version is substantial. Mining the Internet you are sure to miss many gems that could make a large difference to your day-to-day work. Going through this book you will benefit that a team of people has done the work for you. Ensuring they have included everything and the content is correct for your easy perusal.Chapter 1 gives a very good overview of the new additions to the main tool you use each day.Chapter 2 gives a very good starting place for Windows 8.1 development. It will get you past the new stuff quickly to allow you to get into the code.Chapter 3 goes over Web Development with MVC 5 and the new One ASP.NET model.Chapter 4 uses some I'm not dead yet WPF ("WPF remains the recommended choice for developing desktop applications on the Windows platform. Visual Studio 2013 itself is a WPF application", p 118) WF, WCF and .NET application development.Chapter 5 Debugging EnhancementsChapter 6 Asynchrony in .NETChapter 7 C++, I skimmed this one, but the C++ developer should be thrilled, and it makes me want to learn DirectX.Chapter 8 Team Foundation Server features from a users perspective. Great features that many developers aren't utilizing that can very much help day-to-day. If you are managing a TFS server though, you'll want more than what is provided here.Chapter 9 is on languages TypeScript, Python and IronPython. TypeScript I knew and understand, but I have no idea about Python, and don't really want to, but it's good to know it's available if that's your flavour of choice.Appendix contains recipes on Installers, Submitting Windows Store apps, Visual Studio Add-ins and extensions, and creating your own snippets.The "There's more..." sections littered throughout are valuable on there own, revealing many power user features I was unaware of. The recipe format of the books make it a great reference to have on-hand. Going to the relevant recipe within the book will be a faster and more reliable process than going online.I intended to flick through this book quickly and dive in on a couple of chapters. I however could not help but go through it all. The capabilities we have available to us, just from Visual Studio is amazing. Going over it all I can't help but think of all the possibilities and opportunities. Now I must get back to coding.Review also posted on my blog [...]Disclaimer: I was provided a complimentary electronic copy of this book by the publisher. In no way was I directed on the content of my review. Opinions are mine alone.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.