Professional WPF Programming.Pdf
Total Page:16
File Type:pdf, Size:1020Kb
01_041802 ffirs.qxp 4/2/07 5:16 PM Page iii Professional WPF Programming: .NET Development with the Windows® Presentation Foundation Chris Andrade, Shawn Livermore, Mike Meyers, Scott Van Vliet 01_041802 ffirs.qxp 4/2/07 5:16 PM Page ii 01_041802 ffirs.qxp 4/2/07 5:16 PM Page i Professional WPF Programming: .NET Development with the Windows® Presentation Foundation 01_041802 ffirs.qxp 4/2/07 5:16 PM Page ii 01_041802 ffirs.qxp 4/2/07 5:16 PM Page iii Professional WPF Programming: .NET Development with the Windows® Presentation Foundation Chris Andrade, Shawn Livermore, Mike Meyers, Scott Van Vliet 01_041802 ffirs.qxp 4/2/07 5:16 PM Page iv Professional WPF Programming: .NET Development with the Windows® Presentation Foundation Published by Wiley Publishing, Inc. 10475 Crosspoint Boulevard Indianapolis, IN 46256 www.wiley.com Copyright © 2007 by Wiley Publishing, Inc., Indianapolis, Indiana Published simultaneously in Canada ISBN: 978-0-470-04180-2 Manufactured in the United States of America 10 9 8 7 6 5 4 3 2 1 Library of Congress Cataloging-in-Publication Data is available from the publisher. No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permis- sion of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Legal Department, Wiley Publishing, Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317) 572-3447, fax (317) 572-4355, or online at http://www.wiley .com/go/permissions. LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: THE PUBLISHER AND THE AUTHOR MAKE NO REPRESENTATIONS OR WARRANTIES WITH RESPECT TO THE ACCURACY OR COMPLETENESS OF THE CONTENTS OF THIS WORK AND SPECIFICALLY DISCLAIM ALL WARRANTIES, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE. NO WARRANTY MAY BE CREATED OR EXTENDED BY SALES OR PROMOTIONAL MATERIALS. THE ADVICE AND STRATEGIES CONTAINED HEREIN MAY NOT BE SUITABLE FOR EVERY SITUATION. THIS WORK IS SOLD WITH THE UNDERSTANDING THAT THE PUBLISHER IS NOT ENGAGED IN RENDERING LEGAL, ACCOUNTING, OR OTHER PROFESSIONAL SERVICES. IF PROFESSIONAL ASSISTANCE IS REQUIRED, THE SERVICES OF A COMPETENT PROFESSIONAL PERSON SHOULD BE SOUGHT. NEITHER THE PUBLISHER NOR THE AUTHOR SHALL BE LIABLE FOR DAMAGES ARISING HERE- FROM. THE FACT THAT AN ORGANIZATION OR WEBSITE IS REFERRED TO IN THIS WORK AS A CITATION AND/OR A POTENTIAL SOURCE OF FURTHER INFORMATION DOES NOT MEAN THAT THE AUTHOR OR THE PUBLISHER ENDORSES THE INFORMATION THE ORGANIZATION OR WEBSITE MAY PROVIDE OR RECOMMENDATIONS IT MAY MAKE. FURTHER, READERS SHOULD BE AWARE THAT INTERNET WEBSITES LISTED IN THIS WORK MAY HAVE CHANGED OR DISAP- PEARED BETWEEN WHEN THIS WORK WAS WRITTEN AND WHEN IT IS READ. For general information on our other products and services please contact our Customer Care Department within the United States at (800) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002. Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Programmer to Programmer, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other countries, and may not be used without written permission. All other trademarks are the property of their respective owners. Wiley Publishing, Inc., is not associated with any product or vendor mentioned in this book. Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books. 01_041802 ffirs.qxp 4/2/07 5:16 PM Page v About the Authors Chris Andrade is a Principal with Novera Consulting, a Microsoft Certified Partner specializing in enterprise architecture and development with .NET and Microsoft server technology. Chris devotes most of his time to assisting companies in applying Microsoft technologies to improve their business pro- cesses and operations. Chris has worked within a diverse range of business verticals, including automo- tive, healthcare, and mortgage. Chris also takes active participation within the local developer community, speaking and presenting along the west coast whenever possible. Shawn Livermore (MCAD, MCSD, PMP) [shawnlivermore.blogspot.com] has been architecting and developing Microsoft-based solutions for nearly a decade. Shawn has been consulting as an enterprise and solutions architect for Fortune 500 clientele within highly visible enterprise implementations. His range of technical competence stretches across platforms and lines of business, but he specializes in Microsoft .NET enterprise application architectures and Microsoft server-based product integrations. Shawn lives in the Southern California area with his beautiful wife Shantell and amazing daughter Elexzandreia. Shawn also enjoys beating his friend Jason at air hockey, basketball, baseball, football, arcade games, cards, billiards, ping pong, shuffleboard, trivia, golf, racquetball, dirt bike races, cross- country skiing... and pretty much any other sport in existence. Shawn would like to once again remind Jason, “Who’s your daddy?” Mike Meyers is president of Novera Consulting Inc, a software development and consulting firm spe- cializing in custom application development utilizing the .NET platform and Microsoft server technol- ogy. Based in Orange County, California, Mike’s company is focused on providing solutions based on Microsoft platforms and technology to companies spanning multiple industries. Mike has worked in a number of industries, including mortgage, healthcare, and various ecommerce ventures as developer, architect, and project manager. When he’s not writing code, Mike is active mountain biking in southern California, hiking with his four-legged Labrador Dakota or playing music with friends. Scott Van Vliet is an accomplished Solutions Architect who has spent the past decade delivering suc- cessful Microsoft-based solutions to his clients. Currently a Senior Manager with Capgemini, a world- wide leader in technology consulting services, Scott has managed, architected, and developed solutions for companies across the globe. He is also the Microsoft Delivery Leader for Capgemini’s Telecom, Media & Entertainment practice, providing technical and engagement leadership on all Microsoft-based projects. Scott can be reached via his Web site at http://www.scottvanvliet.com/. 01_041802 ffirs.qxp 4/2/07 5:16 PM Page vi To my wife Sena and son Ethan: for their patience, love, and understanding during the process of writing this book. I love you both so much. —Chris Andrade To my best friend and life companion, Shantell, who has stuck around with me through it all and never once doubted me. You’ve believed in me from the beginning when we had nothing. I appreciate your friendship and your love, and look forward to getting old and wrinkled together. Thank you for supporting this book and the time it required. And, of course, I am so thankful for my daughter Elexzandreia, who has taught me so many things. Thanks for letting daddy type on the laptop while you write me little cards and “projects.” We must have gone through thousands of tape dispensers and construction paper packages over these last few years. You’re an angel, and my greatest accomplishment in this life would be to see your life flourish and grow into the woman God has designed you to be. —Shawn Livermore To my parents, Richard and Linda, who have always supported my entrepreneurial spirit, helping me to become who I am today. In particular, I dedicate this to my father for spending 30 years with I.B.M. to support his family and foster my interest in computers, and to my mother for raising a handful and teaching me an appreciation for writing and the arts. I would also like to dedicate this book to my brother Nick. No one could ask for a better brother or friend. —Mike Meyers 01_041802 ffirs.qxp 4/2/07 5:16 PM Page vii Credits Senior Acquisitions Editor Graphics and Production Specialists Jim Minatel Brooke Graczyk Denny Hager Development Editor Jennifer Mayberry John Sleeva Barbara Moore Alicia B. South Technical Editor Carl Daniel Quality Control Technicians Cynthia Fields Production Editor Brian H. Walls Christine O’Connor Project Coordinator Copy Editor Adrienne Martinez Nancy Rapoport Proofreading and Indexing Editorial Manager Aptara Mary Beth Wakefield Anniversary Logo Design Production Manager Richard Pacifico Tim Tate Vice President and Executive Group Publisher Richard Swadley Vice President and Executive Publisher Joseph B. Wikert 01_041802 ffirs.qxp 4/2/07 5:16 PM Page viii 01_041802 ffirs.qxp 4/2/07 5:16 PM Page ix Acknowledgments Many thanks to the many colleagues and friends I have worked with who have contributed so much to my life and professional development. I would especially like to thank my partner Mike Meyers for his accountability and support, and Mickey Williams, who inspires me to never stop learning and give back as much as I can to the community. —Chris Andrade I must acknowledge the Lord Jesus. My life would be a hopeless recursion without Him in charge. For all you computer geeks out there reading these books, be advised: your search for information and advancement in technology and science will not have any significance if your search for the Savior has not been fulfilled. This life means nothing without a Savior, and the only true Savior is Jesus Christ. If your logical approach to life has somehow given into the false “scientific” explanations for our existence, then I appeal to your spirit. Be a searcher for truth in your spirit and do not stop until you fill that gap- ing hole in your spirit.