Book Image

MCTS: Microsoft Silverlight 4 Development (70-506) Certification Guide

By : Johnny Tordgeman
Book Image

MCTS: Microsoft Silverlight 4 Development (70-506) Certification Guide

By: Johnny Tordgeman

Overview of this book

Microsoft Silverlight is a powerful development platform for creating engaging, interactive applications for many screens across the Web, desktop, and mobile devices. Silverlight is also a great (and growing) Line-Of-Business platform and is increasingly being used to build data-driven business applications. Silverlight is based on familiar .NET languages such as C# which enables existing .NET developers to get started developing rich internet applications almost immediately. "MCTS: Microsoft Silverlight 4 Development (70-506) Certification Guide" will show you how to prepare for and pass the (70-506): TS: Microsoft Silverlight 4 Development exam.Packed with practical examples and Q&As, MCTS: Microsoft Silverlight 4 Development (70-506) Certification Guide starts by showing you how to lay out a user interface, enhance the user interface, implement application logic, work with data and interact with a host platform amongst others.
Table of Contents (15 chapters)
MCTS: Microsoft Silverlight 4 Development (70-506) Certification Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface

Handling application-level events


Silverlight allows us to handle application-level events. They are the Startup, Exit, and UnhandledException events. These events can be used to hook into the application lifecycle. All of these events are found in the App.xaml.cs file.

The Application_Startup event is fired as soon as the application is initiated, meaning right after the XAP file is loaded to the user's computer and inspected by the Silverlight runtime engine. By default the Application_Startup event is used to load the default visual page into view. Other use of this event is to perform different initialization tasks, such as processing initialization parameters or setting application-wide resources or properties. For example, if you pass InitParams from the Silverlight HTML object to the application, you'll have to process them inside this event with code as follows:

IDictionary<string, string> iParams = e.InitParams;

The Application_UnhandledException event enables us to handle...