This training kit is designed for developers who plan to take the Microsoft Certified ITProfessional (MCITP) Exam 70-502, as well as for developers who need to know howto develop Microsoft Windows Presentation Foundation (WPF)–based applicationsusing Microsoft .NET Framework 3.5. We assume that before using this training kit,you already have a working knowledge of Windows, Microsoft Visual Basic or C# (orboth), and Extensible Application Markup Language (XAML).
Nội dung trích xuất từ tài liệu:
Microsoft .NET Framework 3.5 - Windows Presentaion FoundationPUBLISHED BYMicrosoft PressA Division of Microsoft CorporationOne Microsoft WayRedmond, Washington 98052-6399Copyright © 2008 by Matthew StoeckerAll rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by any meanswithout the written permission of the publisher.Library of Congress Control Number: 2008929780Printed and bound in the United States of America.1 2 3 4 5 6 7 8 9 QWE 3 2 1 0 9 8Distributed in Canada by H.B. Fenn and Company Ltd.A CIP catalogue record for this book is available from the British Library.Microsoft Press books are available through booksellers and distributors worldwide. For further information aboutinternational editions, contact your local Microsoft Corporation office or contact Microsoft Press International directly atfax (425) 936-7329. Visit our Web site at www.microsoft.com/mspress. Send comments to tkinput@microsoft.com.Microsoft, Microsoft Press, Internet Explorer, Visual Basic, Visual Studio, Windows, Windows Server, and WindowsVista are either registered trademarks or trademarks of the Microsoft group of companies. Other product and companynames mentioned herein may be the trademarks of their respective owners.The example companies, organizations, products, domain names, e-mail addresses, logos, people, places, and eventsdepicted herein are fictitious. No association with any real company, organization, product, domain name, e-mail address,logo, person, place, or event is intended or should be inferred.This book expresses the author’s views and opinions. The information contained in this book is provided without anyexpress, statutory, or implied warranties. Neither the authors, Microsoft Corporation, nor its resellers, or distributors will beheld liable for any damages caused or alleged to be caused either directly or indirectly by this book.Acquisitions Editor: Ken JonesDevelopmental Editor: Laura SackermanProject Editor: Kathleen AtkinsEditorial Production: S4Carlisle Publishing ServicesTechnical Reviewer: Kurt Meyer; Technical Review services provided by Content Master, a member of CM Group, Ltd.Cover: Tom Draper DesignBody Part No. X14-15151About the AuthorMatthew A. Stoecker Matthew Stoecker started programming in BASIC on a TRS-80 at the age of nine. In 2001, he joined Microsoft Corporation as a programming writer authoring documen- tation for Microsoft Visual Basic .NET. He has written numerous technical articles about Visual Basic .NET and Visual C#, and he has written or contributed to multiple books about these languages, Windows Forms, and now Windows Presentation Foun- dation (WPF). He holds a Bachelor of Music degree in trombone performance from the Oberlin Conservatory and a Ph.D in microbiology from the University of Washington that he hopes he will never have to use again. He spends his spare time biking, playing the trombone, and playing with his cats. He lives in Bellevue, Washington.Contents at a Glance 1 WPF Application Fundamentals. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2 Events, Commands, and Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 3 Building the User Interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 4 Adding and Managing Content. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 5 Configuring Databinding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 6 Converting and Validating Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259 7 Styles and Animation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 8 Customizing the User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343 9 Resources, Documents, and Localization . . . . . . . . . . . . . . . . . . . . . . . . . 38910 Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441 Answers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473 Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503 vTable of Contents Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xxi1 WPF Application Fundamenta ...