For your convenience Apress has placed some of the front
matter material after the index. Please use the Bookmarks
and Contents at a Glance links to access them.
Download from Wow! eBook <www.wowebook.com>
v
Contents at a Glance
About the Author ������������������������������������������������������������������������������ xi
About the Technical Reviewer �������������������������������������������������������� xiii
Acknowledgments ��������������������������������������������������������������������������� xv
Chapter 1: Getting Started ■ �������������������������������������������������������������� 1
Chapter 2: Data, Binding, and Pages ■ �������������������������������������������� 21
Chapter 3: AppBars, Flyouts, and Navigation ■ ������������������������������� 45
Chapter 4: Views and Tiles ■ ����������������������������������������������������������� 69
Chapter 5: App Life Cycle and Contracts ■ �������������������������������������� 95
Index ���������������������������������������������������������������������������������������������� 115
1
Chapter 1
Getting Started
Windows Store apps are an important addition to Microsoft Windows 8, providing the
cornerstone for a single, consistent programming and interaction model across desktops,
tablets, and smartphones. The app user experience is very different from previous
generations of Windows applications: Windows Store apps are full-screen and favor a
style that is simple, direct, and free from distractions.
Windows Store apps represent a complete departure from previous versions of
Windows. There are entirely new APIs, new interaction controls, and a very different
approach to managing the life cycle of applications.
Windows Store apps can be developed using a range of languages, including
JavaScript, Visual Basic, C++, and, the topic of this book, C#. Windows 8 builds on the
familiar to let developers use their existing C# and XAML experience to build rich apps
and integrate into the wider Windows platform. This book gives you an essential jump
start into the world of Windows Store apps; by the end, you will understand how to use
the controls and features that define the core Windows Store app experience.
Note ■ Microsoft uses the term Windows Store App, which I find awkward, and I can’t
bring myself to use it throughout this book. Instead, I’ll refer to Windows apps and, often,
just plain apps. I’ll leave you to mentally insert the official Microsoft names as you see fit.
About This Book
This book is for experienced C# developers who want to get a head start creating apps for
Windows 8. I explain the concepts and techniques you need to get up to speed quickly
and to boost your app development techniques and knowledge
What Do You Need to Know Before You Read This Book?
You need to have a good understanding of C# and, ideally, of XAML. If you have worked
on WPF or Silverlight projects, then you will have enough XAML knowledge to build
Windows apps. Don’t worry if you haven’t worked with XAML before; you can pick it up
as you go, and I give you a very brief overview later in this chapter to get you started. I’ll
be calling out the major XAML concepts as I use them.
CHAPTER 1 ■ GETTING STARTED
2
What Software Do You Need for This Book?
You need two things for Windows app development: a PC running Windows 8 and Visual
Studio 2012. You’ll need to buy a copy of Windows 8 if you get serious about Windows app
development, but if you are just curious, then you can get a 90-day trial from Microsoft
from http://msdn.microsoft.com/en-us/evalcenter. You’ll find what you need by
clicking the Release link in the Windows and Platform Development section.
You are required to create a Microsoft account to get the evaluation, but you’ll need
one of those anyway to get set up as a developer. Microsoft accounts are free to create,
and there are instructions to follow if you don’t already have one.
Tip ■ You can run Windows 8 in a virtual machine, but for the best results I recommend
installing the operating system directly onto a PC.
Visual Studio 2012 is Microsoft’s development environment. The good news is that
Microsoft makes a basic version of Visual Studio available for free, and that’s the version
I’ll be using in this book. It has the catchy name of Visual Studio 2012 Express for Windows 8,
and you can download the installer from www.microsoft.com/visualstudio/11/en-us/
products/express. Several flavors are available, each of which can be used to develop
a specific kind of application. For app development, you will need Visual Studio Express
2012 for Windows 8. The names of the different flavors are confusingly similar, so be sure
to download the right one.
The free version doesn’t have all of the testing and integration features that some
of the paid-for versions of Visual Studio contain, but you don’t need those to create
Windows apps. In all other respects, the free version of Visual Studio is fully featured and
does everything you will need.
Tip ■ Don’t worry if you have a paid-for version of Visual Studio 2012. You won’t need all
of the features in your edition, but all of the instructions and examples in this book will work
without any problems or modification.
Install Visual Studio as you would any other app. Although the software is free, you
will need to activate it, which requires the Microsoft account you created earlier. After
you have gone through the process, you’ll end up with a code that you can use to activate
Visual Studio. You will also need a developer license, which is free as well. When you first
start Visual Studio 2012, you will be prompted to obtain a license; it takes only a second,
and, once again, it requires the Microsoft account you created earlier.