没有合适的资源?快使用搜索试试~ 我知道了~
首页C# 2010精通:.NET 4.0版WPF深度指南
"《Pro WPF in C# 2010: Windows Presentation Foundation in .NET 4.0》是一本由Matthew MacDonald编著的专业书籍,它深入探讨了Windows Presentation Foundation (WPF) 在 Microsoft .NET Framework 4.0环境下的应用。这本书是针对C# 2010版本的高级教程,旨在帮助读者理解和掌握WPF技术在实际开发中的关键概念和实践。
本书的内容覆盖了WPF的基础知识,如用户界面设计、数据绑定、XAML语言、控件与布局、动画和多媒体处理等方面,同时还特别关注了.NET 4.0所带来的新特性和改进。作为一本专业指南,它提供了大量的代码示例和实战项目,帮助读者通过实践提升技能,并理解如何利用WPF构建高效、可维护和高性能的应用程序。
版权方面,所有内容受到严格的保护,未经版权所有者Matthew MacDonald和出版社事先书面许可,禁止任何形式的复制或传播,包括但不限于复印、录音或通过任何信息存储和检索系统。本书的纸质版和电子版的ISBN分别为978-1-4302-7205-2和978-1-4302-7204-5,表明其出版和印刷都在美国完成。
作者、编辑团队以及技术评审员的名单也出现在了书的前言部分,显示了本书背后的专业实力。从主编Ewan Buckingham到技术专家FabioClaudioFerracchiati,他们的专业知识确保了内容的质量和权威性。
《Pro WPF in C# 2010》是一本针对WPF开发者的实用教材,适合那些希望在C#环境中深入学习和应用WPF技术的软件开发者,无论是初学者还是经验丰富的开发者,都能从中受益匪浅。"
■
CONTENTS
x
v
Organizing Template Resources ................................................................................................. 521
Refactoring the Button Control Template ................................................................................ 522
Applying Templates with Styles .............................................................................................. 524
Applying Templates Automatically .......................................................................................... 527
User-Selected Skins ............................................................................................................... 528
Building More Complex Templates ............................................................................................. 530
Nested Templates .................................................................................................................. 531
Modifying the Scroll Bar ......................................................................................................... 533
The Control Template Examples ............................................................................................. 538
Visual States .............................................................................................................................. 540
The Last Word ............................................................................................................................ 541
■Chapter 18: Custom Elements ....................................................................................................... 543
Understanding Custom Elements in WPF .................................................................................... 544
Building a Basic User Control ..................................................................................................... 547
Defining Dependency Properties ............................................................................................ 548
Defining Routed Events .......................................................................................................... 551
Adding Markup ...................................................................................................................... 552
Using the Control ................................................................................................................... 554
Command Support ................................................................................................................. 555
A Closer Look at User Controls ............................................................................................... 558
Creating a Lookless Control ........................................................................................................ 559
Refactoring the Color Picker Code .......................................................................................... 560
Refactoring the Color Picker Markup ...................................................................................... 560
Streamlining the Control Template ......................................................................................... 563
Theme-Specific Styles and the Default Style .......................................................................... 566
Supporting Visual States ............................................................................................................ 568
Starting the FlipPanel Class .................................................................................................... 569
Choosing Parts and States ..................................................................................................... 572
The Default Control Template ................................................................................................. 573
Using the FlipPanel ................................................................................................................ 580
Using a Different Control Template ......................................................................................... 581
Custom Panels ........................................................................................................................... 582
■
CONTENTS
xvi
The Two-Step Layout Process ................................................................................................ 583
The Canvas Clone .................................................................................................................. 586
A Better Wrapping Panel ........................................................................................................ 587
Custom-Drawn Elements ........................................................................................................... 590
The OnRender() Method ......................................................................................................... 591
Evaluating Custom Drawing ................................................................................................... 592
A Custom-Drawn Element ...................................................................................................... 593
A Custom Decorator ............................................................................................................... 595
The Last Word ............................................................................................................................ 597
■Chapter 19: Data Binding ............................................................................................................... 599
Binding to a Database with Custom Objects ............................................................................... 599
Building a Data Access Component ........................................................................................ 600
Building a Data Object ............................................................................................................ 603
Displaying the Bound Object .................................................................................................. 604
Updating the Database ........................................................................................................... 606
Change Notification ................................................................................................................ 607
Binding to a Collection of Objects ............................................................................................... 609
Displaying and Editing Collection Items .................................................................................. 610
Inserting and Removing Collection Items ................................................................................ 614
Binding to the ADO.NET Objects ............................................................................................. 615
Binding to a LINQ Expression ................................................................................................. 616
Improving Performance in Large Lists ........................................................................................ 619
Virtualization .......................................................................................................................... 619
Item Container Recycling ....................................................................................................... 621
Deferred Scrolling .................................................................................................................. 621
Validation ................................................................................................................................... 621
Validation in the Data Object .................................................................................................. 622
Custom Validation Rules ......................................................................................................... 626
Reacting to Validation Errors .................................................................................................. 628
Getting a List of Errors ........................................................................................................... 629
Showing a Different Error Indicator ......................................................................................... 630
Validating Multiple Values ...................................................................................................... 633
■
CONTENTS
xvii
Data Providers ........................................................................................................................... 636
The ObjectDataProvider .......................................................................................................... 637
The XmlDataProvider ............................................................................................................. 640
The Last Word ............................................................................................................................ 642
■Chapter 20: Formatting Bound Data .............................................................................................. 643
Data Binding Redux .................................................................................................................... 643
Data Conversion ......................................................................................................................... 645
The StringFormat Property ..................................................................................................... 645
Introducing Value Converters.................................................................................................. 647
Formatting Strings with a Value Converter .............................................................................. 648
Creating Objects with a Value Converter ................................................................................. 650
Applying Conditional Formatting ............................................................................................. 653
Evaluating Multiple Properties ................................................................................................ 654
List Controls ............................................................................................................................... 656
List Styles .................................................................................................................................. 658
The ItemContainerStyle .......................................................................................................... 659
A ListBox with Check Boxes or Radio Buttons ......................................................................... 660
Alternating Item Style ............................................................................................................. 663
Style Selectors ....................................................................................................................... 665
Data Templates .......................................................................................................................... 668
Separating and Reusing Templates ........................................................................................ 671
More Advanced Templates ..................................................................................................... 672
Varying Templates ................................................................................................................. 675
Template Selectors ................................................................................................................ 676
Templates and Selection ........................................................................................................ 679
Changing Item Layout ............................................................................................................ 684
The ComboBox ........................................................................................................................... 686
The Last Word ............................................................................................................................ 689
■Chapter 21: Data Views .................................................................................................................. 691
The View Object ......................................................................................................................... 691
Retrieving a View Object ........................................................................................................ 692
Navigating with a View ........................................................................................................... 692
■
CONTENTS
xviii
Creating a View Declaratively ................................................................................................. 695
Filtering, Sorting, and Grouping .................................................................................................. 697
Filtering Collections ................................................................................................................ 697
Filtering the DataTable ........................................................................................................... 701
Sorting ................................................................................................................................... 702
Grouping ................................................................................................................................ 703
The Last Word ............................................................................................................................ 707
■Chapter 22: Lists, Grids, and Trees ................................................................................................ 709
The ListView .............................................................................................................................. 710
Creating Columns with the GridView ...................................................................................... 711
Creating a Custom View ......................................................................................................... 715
The TreeView ............................................................................................................................. 724
A Data-Bound TreeView ......................................................................................................... 724
Binding a DataSet to a TreeView ............................................................................................ 728
Just-in-Time Node Creation ................................................................................................... 729
The DataGrid .............................................................................................................................. 732
Resizing and Rearranging Columns ........................................................................................ 734
Defining Columns ................................................................................................................... 735
Formatting and Styling Columns ............................................................................................. 740
Formatting Rows .................................................................................................................... 742
Row Details ............................................................................................................................ 744
Freezing Columns .................................................................................................................. 745
Selection ................................................................................................................................ 745
Sorting ................................................................................................................................... 746
DataGrid Editing ..................................................................................................................... 746
The Last Word ............................................................................................................................ 749
■Chapter 23: Windows ..................................................................................................................... 751
The Window Class ...................................................................................................................... 751
Showing a Window ................................................................................................................ 754
Positioning a Window ............................................................................................................. 755
Saving and Restoring Window Location .................................................................................. 756
Window Interaction .................................................................................................................... 758
■
CONTENTS
xi
x
Window Ownership ................................................................................................................ 760
The Dialog Model ................................................................................................................... 761
Common Dialog Boxes ........................................................................................................... 762
Nonrectangular Windows ........................................................................................................... 763
A Simple Shaped Window ...................................................................................................... 763
A Transparent Window with Shaped Content .......................................................................... 766
Moving Shaped Windows ....................................................................................................... 768
Resizing Shaped Windows ..................................................................................................... 769
Putting It All Together: A Custom Control Template for Windows ............................................ 770
The Aero Glass Effect ................................................................................................................. 774
Programming the Windows 7 Taskbar ........................................................................................ 779
Using Jump Lists ................................................................................................................... 779
Changing the Taskbar Icon and Preview ................................................................................. 784
The Last Word ............................................................................................................................ 790
■Chapter 24: Pages and Navigation ................................................................................................. 791
Understanding Page-Based Navigation ....................................................................................... 791
Page-Based Interfaces ............................................................................................................... 792
A Simple Page-Based Application with NavigationWindow ...................................................... 793
The Page Class ...................................................................................................................... 795
Hyperlinks .............................................................................................................................. 796
Hosting Pages in a Frame ...................................................................................................... 799
Hosting Pages in Another Page............................................................................................... 800
Hosting Pages in a Web Browser ............................................................................................ 802
The Page History ........................................................................................................................ 803
A Closer Look at URIs in WPF ................................................................................................. 803
Navigation History .................................................................................................................. 804
Maintaining Custom Properties............................................................................................... 805
The Navigation Service ............................................................................................................... 806
Programmatic Navigation ....................................................................................................... 806
Navigation Events .................................................................................................................. 808
Managing the Journal ............................................................................................................ 809
Adding Custom Items to the Journal ....................................................................................... 811
剩余1200页未读,继续阅读
2009-11-06 上传
2021-10-03 上传
2010-11-08 上传
2010-08-03 上传
2007-10-18 上传
2013-03-04 上传
192 浏览量
2009-03-12 上传
gaoh832002
- 粉丝: 4
- 资源: 33
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Angular实现MarcHayek简历展示应用教程
- Crossbow Spot最新更新 - 获取Chrome扩展新闻
- 量子管道网络优化与Python实现
- Debian系统中APT缓存维护工具的使用方法与实践
- Python模块AccessControl的Windows64位安装文件介绍
- 掌握最新*** Fisher资讯,使用Google Chrome扩展
- Ember应用程序开发流程与环境配置指南
- EZPCOpenSDK_v5.1.2_build***版本更新详情
- Postcode-Finder:利用JavaScript和Google Geocode API实现
- AWS商业交易监控器:航线行为分析与营销策略制定
- AccessControl-4.0b6压缩包详细使用教程
- Python编程实践与技巧汇总
- 使用Sikuli和Python打造颜色求解器项目
- .Net基础视频教程:掌握GDI绘图技术
- 深入理解数据结构与JavaScript实践项目
- 双子座在线裁判系统:提高编程竞赛效率
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功