70-511 microsoft windows applications development with microsoft .net framework 4

655 539 0
70-511 microsoft windows applications development with microsoft .net framework 4

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

70-511 microsoft windows applications development with microsoft .net framework 4

Introduction Hardware Requirements Software Requirements Using the Companion Media How to Install the Practice Tests How to Use the Practice Tests How to Uninstall the Practice Tests Microsoft Certied Professional Program Errata and Book Support We Want to Hear from You Stay in Touch Preparing for the Exam CHAPTER 1 Building a User Interface Before You Begin Lesson 1: Using WPF Controls WPF Controls Overview Content Controls Other Controls Setting the Tab Order for Controls Item Controls ListBox Control ComboBox Control TreeView Control and TreeViewItem Control Menus ToolBar Control StatusBar Control Layout Controls Control Layout Properties Using Attached Properties Layout Panels Accessing Child Elements Programmatically Aligning Content Lesson Summary Lesson Review Lesson 2: Using Resources Using Binary Resources Content Files Using Logical Resources Creating a Resource Dictionary Retrieving Resources in Code Lesson Summary Lesson Review Lesson 3: Using Styles and Triggers Using Styles Triggers Understanding Property Value Precedence Lesson Summary Lesson Review Case Scenarios Case Scenario 1: Streaming Stock Quotes Case Scenario 2: Cup Fever Suggested Practices On Your Own Take a Practice Test CHAPTER 2 Working with Events and Commands Before You Begin Lesson 1: Conguring Events and Event Handling Types of Routed Events RoutedEventArgs Attaching an Event Handler The EventManager Class Dening a New Routed Event Creating a Class-Level Event Handler Application-Level Events Lesson Summary Lesson Review Lesson 2: Conguring Commands A High-Level Procedure for Implementing a Command Invoking Commands Command Handlers and Command Bindings Creating Custom Commands Lesson Summary Lesson Review Lesson 3: Implementing Animation Using Animations Lesson Summary Lesson Review Case Scenarios Case Scenario 1: Validating User Input Case Scenario 2: Humongous Insurance User Interface Suggested Practices Take a Practice Test CHAPTER 3 Adding and Managing Content Before You Begin Lesson 1: Managing the Visual Interface Brushes Shapes Transformations The Visual Tree Adding to and Removing Controls from the Visual Interface at Run Time Lesson Summary Lesson Review Lesson 2: Adding Multimedia Content Using SoundPlayer MediaPlayer and MediaElement Handling Media-Specic Events Lesson Summary Lesson Review Case Scenario Case Scenario: The Company with Questionable Taste Suggested Practices On Your Own Take a Practice Test CHAPTER 4 Windows Forms and Windows Forms Controls Before You Begin Lesson 1: Working with Windows Forms and Container Controls Overview of Windows Forms Adding Forms to Your Project Properties of Windows Forms Modifying the Appearance and Behavior of the Form Overview of Container Controls The GroupBox Control The Panel Control The FlowLayoutPanel Control The TableLayoutPanel Control The TabControl Control The SplitContainer Control Lesson Summary Lesson Review Lesson 2: Conguring Controls in Windows Forms Overview of Controls Conguring Controls at Design Time Modifying Control Properties at Design Time The Button Control The Label Control Creating Access Keys for Controls without Using Label Controls The TextBox Control The MaskedTextBox Control Lesson Summary Lesson Review Lesson 3: Using List-Display and Specialized Controls Overview of List-Based Controls ListBox Control ComboBox Control CheckedListBox Control Adding Items to and Removing Items from a List-Based Control The ListView Control TreeView Control NumericUpDown Control DomainUpDown Control Value-Setting Controls The CheckBox Control The RadioButton Control The TrackBar Control Choosing Dates and Times DateTimePicker Control MonthCalendar Control Working with Images PictureBox Control ImageList Component Lesson Summary Lesson Review Lesson 4: Using Tool Strips and Menus Overview of the ToolStrip Control Tool Strip Items Displaying Images on Tool Strip Items The ToolStripContainer Class Merging Tool Strips Overview of the MenuStrip Control Creating Menu Strips and Tool Strip Menu Items Adding Enhancements to Menus Moving Items between Menus Disabling, Hiding, and Deleting Menu Items Merging Menus Switching between MenuStrip Controls Programmatically Context Menus and the ContextMenuStrip Control Lesson Summary Lesson Review Case Scenarios Case Scenario 1: Designing a Simple User Interface Case Scenario 2: Designing a User Interface Suggested Practices Take a Practice Test CHAPTER 5 Working with User-Dened Controls Before You Begin Lesson 1: Creating Controls in Windows Forms Introduction to Composite Controls Creating Extended Controls Lesson Summary Lesson Review Lesson 2: Using Control Templates Creating Control Templates Inserting a Trigger Object in a Template Respecting the Templated Parent’s Properties Applying Templates with Style Viewing the Source Code for an Existing Template Using Predened Part Names in a Template Lesson Summary Lesson Review Lesson 3: Creating Custom Controls in WPF Control Creation in WPF Choosing among User Controls, Custom Controls, and Templates Implementing and Registering Dependency Properties Creating User Controls Creating Custom Controls Consuming User Controls and Custom Controls Rendering a Theme-Based Appearance Lesson Summary Lesson Review Case Scenarios Case Scenario 1: Full Support for Styles Case Scenario 2: The Pizza Progress Bar Suggested Practices Take a Practice Test CHAPTER 6 Working with Data Binding Before You Begin Lesson 1: Conguring Data Binding The Binding Class Binding to a WPF Element Binding to an Object Setting the Binding Mode Binding to a Nullable Value Setting the UpdateSourceTrigger Property Lesson Summary Lesson Review Lesson 2: Converting Data Implementing IValueConverter Using Converters to Return Objects Localizing Data with Converters Using Multi-value Converters Lesson Summary Lesson Review Lesson 3: Validating Data and Conguring Change Notication Validating Data Conguring Data Change Notication Lesson Summary Lesson Review Case Scenarios Case Scenario 1: The Currency Trading Review Console Case Scenario 2: Currency Trading Console Suggested Practices Take a Practice Test CHAPTER 7 Conguring Data Binding Before You Begin Lesson 1: Binding to Data Sources Binding to a List Binding to ADO.NET Objects Binding to Hierarchical Data Binding to an Object with ObjectDataProvider Binding to XML Using XmlDataProvider Lesson Summary Lesson Review Lesson 2: Manipulating and Displaying Data Data Templates Sorting Data Grouping Filtering Data Lesson Summary Lesson Review Case Scenarios Case Scenario 1: Getting Information from the Field Case Scenario 2: Viewing Customer Data Suggested Practices Take a Practice Test CHAPTER 8 Working with Data Grids and Validating User Input Before You Begin Lesson 1: Implementing Data-bound Controls in Windows Forms Binding Controls to Data Conguring DataGridView Columns Adding Tables and Columns to DataGridView Deleting Columns in DataGridView Determining the Clicked Cell in DataGridView Validating Input in the DataGridView Control Format a DataGridView Control by Using Custom Painting Using DataGrid in WPF Applications Using DataGrid Columns Lesson Summary Lesson Review Lesson 2: Validating User Input Field-Level Validation Using Events in Field-Level Validation Handling the Focus Form-Level Validation Providing User Feedback Implementing IDataErrorInfo in WPF Applications Lesson Summary Lesson Review Case Scenario Case Scenario: The Writer Completeness Chart Suggested Practices Take a Practice Test CHAPTER 9 Enhancing Usability Before You Begin Lesson 1: Implementing Asynchronous Processing Running a Background Process Using Delegates Creating Process Threads Using Dispatcher to Access Controls Safely on Another Thread in WPF Lesson Summary Lesson Review Lesson 2: Implementing Globalization and Localization Globalization and Localization Localizing a WPF application Localizing an Application Using Culture Settings in Validators and Converters Lesson Summary Lesson Review Lesson 3: Integrating Windows Forms Controls and WPF Controls Using Windows Forms Controls in WPF Applications Using Dialog Boxes in WPF Applications WindowsFormsHost Adding a WPF User Control to Your Windows Form Project Lesson Summary Lesson Review Case Scenarios Case Scenario 1: The Publishing Application Case Scenario 2: Creating a Simple Game Suggested Practices Take a Practice Test CHAPTER 10 Advanced Topics Before You Begin Lesson 1: Working with Security Working with Code Access Security Policies Requesting User Account Control Permissions Software Restriction Policies Lesson Summary Lesson Review Lesson 2: Managing Settings Creating Settings at Design Time Loading Settings at Run Time Saving User Settings at Run Time Lesson Summary Lesson Review Lesson 3: Implementing Drag and Drop Implementing Drag and Drop Functionality Lesson Summary Lesson Review Case Scenario Case Scenario: The Congurable Application Suggested Practices Take a Practice Test CHAPTER 11 Testing and Debugging WPF Applications Before You Begin Lesson 1: Testing the User Interface Using Automation Peers to Automate the User Interface Using the WPF Tree Visualizer to Inspect the User Interface Lesson Summary Lesson Review Lesson 2: Debugging with Intellitrace and PresentationTraceSources Using Intellitrace Using PresentationTraceSources Lesson Summary Lesson Review Case Scenario Case Scenario: Debug Drama Suggested Practices Take a Practice Test CHAPTER 12 Deployment Before You Begin Lesson 1: Creating a Windows Setup Project Setup Projects Lesson Summary Lesson Review Lesson 2: Deploying Applications with ClickOnce Deploying with ClickOnce Conguring ClickOnce Update Options Deploying an XBAP with ClickOnce Conguring the Application Manifest Associating a Certicate with the Application Lesson Summary Lesson Review Case Scenarios Case Scenario 1: Distributing the Application a Little Early Case Scenario 2: Installing the Server Core Suggested Practices Take a Practice Test Answers Chapter 1: Lesson Review Answers Lesson 1 Lesson 2 Lesson 3 Chapter 1 Case Scenario Answers Case Scenario 1: Streaming Stock Quotes Case Scenario 2: Cup Fever Chapter 2: Lesson Review Answers Lesson 1 Lesson 2 Lesson 3 Chapter 2: Case Scenario Answers Case Scenario 1: Validating User Input Case Scenario 2: Humongous Insurance User Interface Chapter 3: Lesson Review Answers Lesson 1 Lesson 2 Chapter 3: Case Scenario Answers Case Scenario: The Company with Questionable Taste Chapter 4: Lesson Review Answers Lesson 1 Lesson 2 Lesson 3 Lesson 4 Chapter 4: Case Scenario Answers Case Scenario 1: Designing a Simple User Interface Case Scenario 2: Designing a User Interface Chapter 5: Lesson Review Answers Lesson 1 Lesson 2 Lesson 3 Chapter 5: Case Scenario Answers Case Scenario 1: Full Support for Styles Case Scenario 2: The Pizza Progress Bar Chapter 6: Lesson Review Answers Lesson 1 Lesson 2 Lesson 3 Chapter 6: Case Scenario Answers Case Scenario 1: The Currency Trading Review Console Case Scenario 2: Currency Trading Console Chapter 7: Lesson Review Answers Lesson 1 Lesson 2 Chapter 7: Case Scenario Answers Case Scenario 1: Getting Information from the Field Case Scenario 2: Viewing Customer Data Chapter 8: Lesson Review Answers Lesson 1 Lesson 2 Chapter 8: Case Scenario Answers Case Scenario: The Writer Completeness Chart Chapter 9: Lesson Review Answers Lesson 1 Lesson 2 Lesson 3 Chapter 9: Case Scenario Answers Case Scenario 1: The Publishing Application Case Scenario 2: Creating a Simple Game Chapter 10: Lesson Review Answers Lesson 1 Lesson 2 Lesson 3 Chapter 10: Case Scenario Answers Case Scenario: The Congurable Application Chapter 11: Lesson Review Answers Lesson 1 Lesson 2 Chapter 11: Case Scenario Answers Case Scenario: Debug Drama Chapter 12: Lesson Review Answers Lesson 1 Lesson 2 Chapter 12: Case Scenario Answers Case Scenario 1: Distributing the Application a Little Early Case Scenario 2: Installing the Server Core About the Author Systems Requirements Hardware Requirements Software Requirements PUBLISHED BY Microsoft Press A Division of Microsoft Corporation One Microsoft Way Redmond, Washington 98052-6399 Copyright © 2011 by Matthew Stoecker All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by any means without the written permission of the publisher. Library of Congress Control Number: 2010942625 ISBN: 978-0-7356-2742-0 Printed and bound in the United States of America. Microsoft Press books are available through booksellers and distributors worldwide. For further infor mation about international editions, contact your local Microsoft Corporation ofce or contact Microsoft Press International directly at fax (425) 936-7329. Visit our Web site at www.microsoft.com/mspress. Send comments to tkinput @microsoft.com. Microsoft and the trademarks listed at http://www.microsoft.com/about/legal/en/us/IntellectualProperty /Trademarks/EN-US.aspx are trademarks of the Microsoft group of companies. All other marks are property of their respective owners. The example companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted herein are ctitious. 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 any express, statutory, or implied warranties. Neither the authors, Microsoft Corporation, nor its resellers, or distributors will be held liable for any damages caused or alleged to be caused either directly or indirectly by this book. Acquisitions Editor: Martin DelRe Developmental Editor: Karen Szall Project Editor: Iram Nawaz Editorial Production: nSight, Inc. Technical Reviewer: Kurt Meyer Cover: Tom Draper Design Body Part No. X17-40175 Exam 70-511: TS: Microsoft Windows Applications Development with Microsoft .NET Framework 4 0BJECTIVE CHAPTER LESSON 1. BUILDING A USER INTERFACE BY USING BASIC TECHNIQUES (23%) 1.1 Choose the most appropriate control class 1 4 1 1, 2, 3, 4 1.2 Implement screen layout by using nested control hierarchies. 1 1 1.3 Create and apply styles and theming. 1 5 3 3 1.4 Manage reusable resources. 1 2 1.5 Implement an animation in WPF. 2 3 2. ENHANCING A USER INTERFACE BY USING ADVANCED TECHNIQUES (21%) 2.1 Manage routed events in WPF. 2 1 2.2 Congure WPF commanding. 2 2 2.3 Modify the visual interface at run time. 3 1, 2 2.4 Implement user-dened controls. 5 1, 3 2.5 Create and display graphics. 3 1 2.6 Add multimedia content to an application in WPF. 3 2 2.7 Create and apply control templates in WPF. 5 2 2.8 Create data, event, and property triggers in WPF. 1 3 3. MANAGING DATA AT THE USER INTERFACE LAYER (23%) 3.1 Implement data binding. 6 7 1 1 3.2 Implement value converters in WPF. 6 2 3.3 Implement data validation. 6 8 3 2 3.4 Implement and consume change notication interfaces. 6 3 3.5 Prepare collections of data for display. 7 2 3.6 Bind to hierarchical data. 7 1 3.7 Implement data-bound controls. 8 1 3.8 Create a data template in WPF. 7 2 4. ENHANCING THE FUNCTIONALITY AND USABILITY OF A SOLUTION (17%) 4.1 Integrate WinForms and WPF within an application. 9 3 4.2 Implement asynchronous processes and threading. 9 1 4.3 Incorporate globalization and localization features. 9 2 4.4 Implement drag and drop operations within and across applications. 10 3 4.5 Implement security features of an application. 10 1 4.6 Manage user and application settings. 10 2 4.7 Implement dependency properties. 5 3 5. STABILIZING AND RELEASING A SOLUTION (17%) 5.1 Implement a WPF test strategy. 11 1, 2 5.2 Debug XAML by using the WPF Visualizer. 11 1 5.3 Debug WPF issues by using PresentationTraceSources. 11 2 5.4 Congure a ClickOnce deployment. 12 2 5.5 Create and congure a Windows Installer project. 12 1 5.6 Congure deployment security settings. 12 2 Exam Objectives The exam objectives listed here are current as of this book’s publication date. Exam objectives are subject to change at any time without prior notice and at Microsoft’s sole discretion. Please visit the Microsoft Learning Web site for the most current listing of exam objectives: http://www.microsoft.com/learning/en/us/exams /70-237.mspx. Contents at a Glance Introduction xv CHAPTER 1 Building a User Interface 1 CHAPTER 2 Working with Events and Commands 75 CHAPTER 3 Adding and Managing Content 119 CHAPTER 4 Windows Forms and Windows Forms Controls 157 CHAPTER 5 Working with User-Dened Controls 273 CHAPTER 6 Working with Data Binding 315 CHAPTER 7 Conguring Data Binding 367 CHAPTER 8 Working with Data Grids and Validating User Input 407 CHAPTER 9 Enhancing Usability 447 CHAPTER 10 Advanced Topics 493 CHAPTER 11 Testing and Debugging WPF Applications 521 CHAPTER 12 Deployment 545 Index 607 vii Contents Introduction xv Hardware Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xvi Software Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii Using the Companion Media . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii Microsoft Certied Professional Program . . . . . . . . . . . . . . . . . . . . . . . . . . .xix Support for This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx We Want to Hear from You . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx Chapter 1 Building a User Interface 1 Lesson 1: Using WPF Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 WPF Controls Overview 3 Content Controls 4 Other Controls 7 Setting the Tab Order for Controls 12 Item Controls 12 ListBox Control 12 ComboBox Control 13 TreeView Control and TreeViewItem Control 14 Menus 15 ToolBar Control 17 StatusBar Control 19 Layout Controls 19 Control Layout Properties 19 Using Attached Properties 21 What do you think of this book? We want to hear from you! Microsoft is interested in hearing your feedback so we can continually improve our books and learning resources for you. To participate in a brief online survey, please visit: www.microsoft.com/learning/booksurvey/ viii Contents Layout Panels 22 Accessing Child Elements Programmatically 31 Aligning Content 32 Lesson 2: Using Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Using Binary Resources 41 Content Files 43 Using Logical Resources 46 Creating a Resource Dictionary 50 Retrieving Resources in Code 51 Lesson 3: Using Styles and Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 Using Styles 57 Triggers 63 Understanding Property Value Precedence 66 Chapter 2 Working with Events and Commands 75 Lesson 1: Conguring Events and Event Handling . . . . . . . . . . . . . . . . . . . . 77 Types of Routed Events 78 RoutedEventArgs 79 Attaching an Event Handler 80 The EventManager Class 81 Dening a New Routed Event 81 Creating a Class-Level Event Handler 83 Application-Level Events 83 Lesson 2: Conguring Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 A High-Level Procedure for Implementing a Command 90 Invoking Commands 90 Command Handlers and Command Bindings 92 Creating Custom Commands 95 Lesson 3: Implementing Animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 Using Animations 102 Chapter 3 Adding and Managing Content 119 Lesson 1: Managing the Visual Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 Brushes 121 ixContents Shapes 128 Transformations 133 The Visual Tree 136 Adding to and Removing Controls from the Visual Interface at Run Time 139 Lesson 2: Adding Multimedia Content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 Using SoundPlayer 144 MediaPlayer and MediaElement 147 Handling Media-Specic Events 150 Chapter 4 Windows Forms and Windows Forms Controls 157 Lesson 1: Working with Windows Forms and Container Controls . . . . . . 159 Overview of Windows Forms 159 Adding Forms to Your Project 160 Properties of Windows Forms 161 Modifying the Appearance and Behavior of the Form 163 Overview of Container Controls 170 The GroupBox Control 173 The Panel Control 173 The FlowLayoutPanel Control 174 The TableLayoutPanel Control 176 The TabControl Control 179 The SplitContainer Control 181 Lesson 2: Conguring Controls in Windows Forms . . . . . . . . . . . . . . . . . . 191 Overview of Controls 191 Conguring Controls at Design Time 193 Modifying Control Properties at Design Time 196 The Button Control 197 The Label Control 201 Creating Access Keys for Controls without Using Label Controls 202 The TextBox Control 203 The MaskedTextBox Control 204 Lesson 3: Using List-Display and Specialized Controls . . . . . . . . . . . . . . . . 212 Overview of List-Based Controls 212 x Contents ListBox Control 213 ComboBox Control 214 CheckedListBox Control 214 Adding Items to and Removing Items from a List-Based Control 216 The ListView Control 223 TreeView Control 225 NumericUpDown Control 228 DomainUpDown Control 228 Value-Setting Controls 229 The CheckBox Control 229 The RadioButton Control 231 The TrackBar Control 232 Choosing Dates and Times 233 DateTimePicker Control 233 MonthCalendar Control 233 Working with Images 235 PictureBox Control 235 ImageList Component 236 Lesson 4: Using Tool Strips and Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244 Overview of the ToolStrip Control 244 Tool Strip Items 246 Displaying Images on Tool Strip Items 248 The ToolStripContainer Class 249 Merging Tool Strips 249 Overview of the MenuStrip Control 251 Creating Menu Strips and Tool Strip Menu Items 253 Adding Enhancements to Menus 256 Moving Items between Menus 258 Disabling, Hiding, and Deleting Menu Items 259 Merging Menus 260 Switching between MenuStrip Controls Programmatically 261 Context Menus and the ContextMenuStrip Control 261 . Draper Design Body Part No. X17 -40 175 Exam 70-511: TS: Microsoft Windows Applications Development with Microsoft .NET Framework 4 0BJECTIVE CHAPTER LESSON. running Microsoft Windows XP with Service Pack 3 (SP3), Windows Vista with SP2, Windows 7, Windows Server 2003 with SP2, Windows Server 2003 R2, Windows

Ngày đăng: 06/08/2013, 17:30

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan