Book Image

Microsoft .NET Framework 4.5 Quickstart Cookbook

By : Jose Luis Latorre
Book Image

Microsoft .NET Framework 4.5 Quickstart Cookbook

By: Jose Luis Latorre

Overview of this book

With about ten years since its first release, Microsoft's .NET Framework 4.5 is one of the most solid development technologies to create casual, business, or enterprise applications. It has evolved into a very stable framework and solid framework for developing applications, with a solid core, called the CLR (Common Language Runtime) Microsoft .NET Framework 4.5 includes massive changes and enables modern application and UI development."Microsoft .Net Framework 4.5 Quickstart Cookbook" aims to give you a run through the most exciting features of the latest version. You will experience all the flavors of .NET 4.5 hands on. The “How-to” recipes mix the right ingredients for a final taste of the most appetizing features and characteristics. The book is written in a way that enables you to dip in and out of the chapters.The book is full of practical code examples that are designed to clearly exemplify the different features and their applications in real-world development. All the chapters and recipes are progressive and based on the fresh features on .NET Framework 4.5.The book will begin by teaching you to build a modern UI application and improve it to make it Windows 8 Modern UI apps lifecycle model-compliant. You will create a portable library and throttle data source updating delays. Towards the end of the book, you will create you first Web API.
Table of Contents (19 chapters)
Microsoft .NET Framework 4.5 Quickstart Cookbook
Credits
About the Author
Acknowledgment
About the Reviewers
www.PacktPub.com
Preface
Index

Introduction


We are clearly speaking of a new, modern, and touch-friendly kind of application with the Windows Store apps style.

Windows Store app style application development, for the latest Windows 8 platform, is a very important part of this release of the .NET Framework 4.5.

We will explore Windows Runtime managed development in our development recipes. We also have the power of a very simple, well designed, and lightweight base class library API at our disposal (C# and VB) for developing Windows Store apps. This is called Windows Runtime, more commonly known as WinRT.

The following image clarifies the overall structure and components that we will have to use for developing Windows Store apps:

Portable libraries are there to help us port our existing code into multi-targeting scenarios such as Windows Store apps, Windows Phone, Silverlight, desktop, or X-box code with a strong focus on Model-View-ViewModel (MVVM). MVVM is an architectural design pattern designed for modern user interface (UI) development, very commonly used in XAML development. This will allow us to share the Model and ViewModel code with only the need for rewriting the UI and the application model, apart from the device integration.

Windows Store apps are designed for tablet devices and touch interaction, mainly for consumers. However, the good old desktop is still there and we can develop classic Windows applications, now called desktop apps, through the desktop mode.

Both of these execution and development modes coexist and are here for different scenarios. This chapter focuses on Windows Store apps development.

The Windows 8 app programming model basically:

  • Implements the new Windows Store app style

  • Provides a simple programming model for developers

  • Provides WinRT, which provides a natural .NET-like interaction with Windows APIs

  • Provides a Silverlight-like XAML UI model to develop with

  • Is sandboxed, providing self-contained secure applications

  • Is designed to be asynchronous, which if well applied, makes our applications fast and fluid

WinRT provides projections that expose the API to the different development environments. With this we can use WinRT from the .NET Framework 4.5.

The UI can be created with XAML (or HTML and CSS if we prefer), which is rendered with DirectX 11.1 (also known as Direct2D), so that we have a high performing UI. We can also implement the interface using DirectX.

So the good news is that the development is very straightforward and easy if we have some experience in Silverlight, Windows Presentation Foundation (WPF), or Windows Phone. If not, it will only be easy.

Note that the Base Class Library (BCL) used by WinRT is not the full desktop version but a reduced set, very similar to the Silverlight types.

There are also some very important Windows Store app principles to keep in mind. We will explore the following principles through the recipes in this book:

  • Windows Store app style design: Focus on the content, minimalism, and emphasis on typography

  • Fast and fluid: Fast user interactions and transitions that are intuitive and executed without delays (performance)

  • Touch first: Simple and consistent touch interaction language

  • Scale beautifully: Windows Store apps are readily executed on tablets with less than 10-inch and up to 27-inch screens

  • Support for multiple states: Full screen, portrait, landscape, or snapped

  • Using the right contracts: Contracts provide a way for Windows Store apps to collaborate, allowing the user to search or share content between applications

  • Live tiles: Useful information appears on the app's tile on the start screen while the app is not in execution

  • Settings and data roam to the cloud: Users get the same experience regardless of where they sign in from

It's your turn; go ahead and explore our recipes! They will help you explore progressively how to implement the different flavors of this new era of Windows Store apps. Let's get started!