ebook img

Pro Silverlight 3 in C# PDF

834 Pages·2009·25.57 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Pro Silverlight 3 in C#

cyan yellOW MagenTa Black PanTOne 123 c BOOks fOR PROfessIOnals By PROfessIOnals® The eXPeRT’s VOIce® In sIlVeRlIghT Companion eBook Available Full Color Inside Pro Silverlight 3 in C# Pro Dear Reader, Silverlight is a revolutionary browser plug-in that allows developers to create S rich client applications that run inside the browser. Like Adobe Flash, Silverlight supports event handling, two-dimensional drawing, video playback, network- ing, and animation. Unlike Flash, Silverlight is tailored to .NET developers. i Most impressively, Silverlight applications execute pure C# code. Pro l The most exciting part of Silverlight is its cross-platform muscle. Unlike v Author of ordinary .NET applications, Silverlight applications run seamlessly in non- Pro WPF in C# 2008 Microsoft browsers (like Firefox) and on non-Microsoft platforms (like Mac OS e Pro ASP.NET 3.5 in C# 2008 X). Essentially, Silverlight is a scaled-down, browser-hosted version of .NET— (with Mario Szpuszta) and that’s made it the most hotly anticipated technology that Microsoft’s Silverlight 3 Beginning ASP.NET 3.5 in released in years. r C# 2008 In this book, you’ll master Silverlight from the ground up. No Silverlight l Pro Silverlight 2 in C# 2008 experience is required—but if you’ve worked with Silverlight 2, you’ll appreci- i ate the “What’s New” boxes that point out new features at the start of every Your Brain: The Missing chapter. By the end of this book, you’ll have a solid understanding of the com- g Manual plete Silverlight platform, and you’ll be able to build anything from a slick busi- ness front-end to a browser-based game. h in C# Welcome aboard! t Matthew MacDonald MCSD, Microsoft Silverlight MVP 3 THE APRESS ROADMAP i n Beginning Pro Pro Business Applications Companion eBook Silverlight 3 Silverlight 3 in C# with Silverlight 3 C Create cross-platform .NET applications for the browser Accelerated Silverlight Pro Silverlight 3 # Silverlight 3 Recipes for the Enterprise See last page for details on $10 eBook version Full Color Inside M Matthew MacDonald SOURCE CODE ONLINE a c www.apress.com (cid:41)(cid:51)(cid:34)(cid:46)(cid:0)(cid:25)(cid:23)(cid:24)(cid:13)(cid:17)(cid:13)(cid:20)(cid:19)(cid:16)(cid:18)(cid:13)(cid:18)(cid:19)(cid:24)(cid:17)(cid:13)(cid:24) D (cid:21)(cid:20)(cid:25)(cid:25)(cid:25) o n a US $49.99 l d Shelve in Web Development User level: (cid:25) (cid:23)(cid:24)(cid:17)(cid:20)(cid:19)(cid:16) (cid:18)(cid:18)(cid:19)(cid:24)(cid:17)(cid:24) Intermediate - Advanced this print for content only—size & color not accurate trim = 7" x 9.125" spine = 1.90625" 832 page count Pro Silverlight 3 in C# ■ ■ ■ Matthew MacDonald i ii Pro Silverlight 3 in C# Copyright © 2009 by Matthew MacDonald All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher. ISBN-13 (pbk): 978-1-4302-2281-8 ISBN-13 (electronic): 978-1-4302-2382-5 Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1 Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. Lead Editor: Ewan Buckingham Technical Reviewer: Damien Foggon Editorial Board: Clay Andres, Steve Anglin, Mark Beckner, Ewan Buckingham, Tony Campbell, Gary Cornell, Jonathan Gennick, Michelle Lowman, Matthew Moodie, Jeffrey Pepper, Frank Pohlmann, Ben Renow-Clarke, Dominic Shakeshaft, Matt Wade, Tom Welsh Coordinating Editor: Anne Collett Copy Editor: Heather Lang and Tiffany Taylor Associate Production Director: Kari Brooks-Copony Production Editor: Brigid Duffy Compositor: Nancy Wright Indexer: John Collin Artist: April Milne Cover Designer: Anna Ishchenko Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail orders- [email protected], or visit http://www.springeronline.com. For information on translations, please e-mail [email protected], or visit http://www.apress.com. Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use. eBook versions and licenses are also available for most titles. For more information, reference our Special Bulk Sales—eBook Licensing web page at http://www.apress.com/info/bulksales. The information in this book is distributed on an “as is” basis, without warranty. Although every precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work. The source code for this book is available to readers at http://www.apress.com. You will need to answer questions pertaining to this book in order to successfully download the code. iii For my family iv Contents at a Glance ■ About the Author.............................................................................................................xxii ■ About the Technical Reviewer........................................................................................xxii ■ Acknowledgments.........................................................................................................xxiv ■ Introduction.....................................................................................................................xxv ■ Chapter 1: Introducing Silverlight......................................................................................1 ■ Chapter 2: XAML...............................................................................................................33 ■ Chapter 3: Layout..............................................................................................................61 ■ Chapter 4:Dependency Properties and Routed Events.................................................107 ■ Chapter 5: Elements........................................................................................................135 ■ Chapter 6: The Application Model..................................................................................183 ■ Chapter 7: Navigation.....................................................................................................227 ■ Chapter 8: Shapes and Geometries................................................................................253 ■ Chapter 9: Brushes, Transforms,and Bitmaps...............................................................291 ■ Chapter 10: Animation....................................................................................................325 ■ Chapter 11: Sound, Video, and Deep Zoom....................................................................387 ■ Chapter 12: Styles and Behaviors..................................................................................425 ■ Chapter 13: Templates and Custom Controls................................................................449 ■ Chapter 14: Browser Integration....................................................................................491 ■ Chapter 15: ASP.NET Web Services................................................................................517 ■ Chapter 16: Data Binding................................................................................................541 ■ Chapter 17: Data Controls..............................................................................................585 ■ Chapter 18: Isolated Storage..........................................................................................635 ■ Chapter 19: Multithreading.............................................................................................657 ■ Chapter 20: Networking..................................................................................................679 ■ Index................................................................................................................................727 v Contents ■ About the Author.............................................................................................................xxii ■ About the Technical Reviewer.......................................................................................xxiii ■ Acknowledgments.........................................................................................................xxiv ■ Introduction.....................................................................................................................xxv Understanding Silverlight................................................................................................................9 Silverlight System Requirements.............................................................................................................12 Silverlight vs. Flash...................................................................................................................................12 Silverlight and WPF...................................................................................................................................14 The Evolution of Silverlight.......................................................................................................................15 About This Book............................................................................................................................17 What You Need to Use This Book.............................................................................................................17 The Silverlight Toolkit...............................................................................................................................18 Code Samples............................................................................................................................................19 Feedback...................................................................................................................................................19 The Last Word................................................................................................................................19 ■ Chapter 1: Introducing Silverlight......................................................................................1 Silverlight Design Tools..................................................................................................................1 Visual Studio vs. Expression Blend............................................................................................................2 Understanding Silverlight Websites...........................................................................................................3 Creating a Stand-Alone Silverlight Project.....................................................................................4 Creating a Simple Silverlight Page.................................................................................................7 Adding Event Handling Code......................................................................................................................9 Testing a Silverlight Application..............................................................................................................11 Creating an ASP.NET-Hosted Silverlight Project..........................................................................12 ASP.NET Controls That Render Silverlight Content..................................................................................16 Mixing ASP.NET Controls and Silverlight Content...................................................................................17 Silverlight Compilation and Deployment......................................................................................17 Compiling a Silverlight Application..........................................................................................................17 Deploying a Silverlight Application..........................................................................................................19 Silverlight Core Assemblies......................................................................................................................21 vii ■ CONTENTS Silverlight Add-On Assemblies.................................................................................................................22 Assembly Caching.....................................................................................................................................23 The HTML Entry Page....................................................................................................................25 Sizing the Silverlight Content Region.......................................................................................................27 Silverlight Parameters..............................................................................................................................27 Alternative Content...................................................................................................................................29 Creating a Friendly Install Experience.....................................................................................................29 The Mark of the Web.................................................................................................................................30 The Last Word................................................................................................................................31 ■ Chapter 2: XAML...............................................................................................................33 XAML Basics..................................................................................................................................34 XAML Namespaces...................................................................................................................................34 Core Silverlight Namespaces..............................................................................................................35 Design Namespaces............................................................................................................................36 Custom Namespaces...........................................................................................................................37 The Code-Behind Class.............................................................................................................................38 Naming Elements.................................................................................................................................39 Properties and Events in XAML.....................................................................................................39 Simple Properties and Type Converters...................................................................................................41 Complex Properties...................................................................................................................................42 Attached Properties..................................................................................................................................44 Nesting Elements......................................................................................................................................45 Events........................................................................................................................................................48 The Full Eight Ball Example......................................................................................................................49 XAML Resources............................................................................................................................50 The Resources Collection.........................................................................................................................50 The Hierarchy of Resources......................................................................................................................51 Accessing Resources in Code...................................................................................................................53 Organizing Resources with Resource Dictionaries.................................................................................54 Element-to-Element Binding.........................................................................................................56 One-Way Binding.......................................................................................................................................56 Two-Way Binding......................................................................................................................................57 The Last Word................................................................................................................................59 ■ Chapter 3: Layout..............................................................................................................61 The Layout Containers...................................................................................................................61 The Panel Background..............................................................................................................................63 Borders......................................................................................................................................................65 Simple Layout with the StackPanel..............................................................................................66 Layout Properties......................................................................................................................................68 Alignment..................................................................................................................................................69 viii

Description:
;Pro Silverlight 3 in C# КНИГИ ; ПРОГРАММИНГ Название: Pro Silverlight 3 in C# Автор: Matthew MacDonald Издательство: Apress ISBN: 1430223812 Год: 2009 Формат: pdf Размер: 25,5 Страниц: 834 Язык: английскийFull-color graphi
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.