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

Creating control templates


In today's world, professionals want to use a wide array of controls such as Button, TextBox, Slider, and so on. In many cases, you don't want to reinvent the wheel but just use the basic control in a way that fits your design. How many times did you want to have a round button? Or a control that does the exact same action as a slider but looks completely different? To answer these kinds of issues the concept of templates was introduced. Templating, as the name implies, allows you to completely change the way a control looks without sacrificing its behavior. To template a control, you first need a control. Let's create a new Silverlight application project, name it Chapter3-Templates and leave all the default options. Once the project is ready, add a button to the page using the following code:

<Button Width="100" Height="100" Content="Round" Click="Button_Click"> </Button>

Switch over to the code behind file (MainPage.xaml.cs), and add the following...