在好例子网,分享、交流、成长!
您当前所在位置:首页C# 开发实例桌面应用界面/GUI → [Applied.WPF.4.in.Context(第1版)].(Raffaele.Garofalo)

[Applied.WPF.4.in.Context(第1版)].(Raffaele.Garofalo)

桌面应用界面/GUI

下载此实例
  • 开发语言:C#
  • 实例大小:7.15M
  • 下载次数:8
  • 浏览次数:32
  • 发布时间:2022-11-27
  • 实例类别:桌面应用界面/GUI
  • 发 布 人:ZSPINGGG
  • 文件格式:.pdf
  • 所需积分:2
 相关标签: C# wpf

实例介绍

【实例简介】[Applied.WPF.4.in.Context(第1版)].(Raffaele.Garofalo)

【实例截图】

【核心代码】

Contents
About the Author ...................................................................................................... xii
About the Technical Reviewer ................................................................................. xiii
Acknowledgments ................................................................................................... xiv
Introduction .............................................................................................................. xv
■ ■Chapter 1: Introducing WPF and XAML .................................................................... 1
The XAML Syntax ............................................................................................................... 2
Namespaces and Root Elements .............................................................................................................. 2
Objects and Common Elements ................................................................................................................ 3
The Code Behind ....................................................................................................................................... 6
Attached Properties .................................................................................................................................. 8
Introduction to WPF ........................................................................................................... 8
WPF Architecture .................................................................................................................................... 13
WPF 4 Tools ............................................................................................................................................ 17
Summary ......................................................................................................................... 23
■ ■Chapter 2: Sample Application: Overview and Getting Started ............................ 25
Requirements .................................................................................................................. 25
Tools and Software ................................................................................................................................. 25
Icons and Templates .............................................................................................................................. 26
Third-Party Library and Controls ............................................................................................................ 26
Application Overview ....................................................................................................... 27
Application Architecture ......................................................................................................................... 27
User Stories ............................................................................................................................................ 31
■ CONTENTS
vi
Domain Model ......................................................................................................................................... 32
Database Schema ................................................................................................................................... 34
Application Configuration ................................................................................................ 35
Visual Studio Solution ............................................................................................................................. 35
Resources and Third-Party Components ................................................................................................ 38
Summary ......................................................................................................................... 41
■ ■Chapter 3: Microsoft Expression Blend ................................................................. 43
Overview .......................................................................................................................... 43
Blend Workspace ............................................................................................................. 45
Workspace Panels .................................................................................................................................. 46
Drawing ........................................................................................................................... 48
Shapes and Objects ................................................................................................................................ 49
Text and Text Effects .............................................................................................................................. 50
Animations ....................................................................................................................... 51
Styling and Templating Controls ...................................................................................... 53
Modifying Properties .............................................................................................................................. 54
Creating Styles ....................................................................................................................................... 55
Design-Time Data ............................................................................................................ 57
SketchFlow and the Mockups ......................................................................................... 59
Summary ......................................................................................................................... 60
■ ■Chapter 4: Creating the Views ............................................................................... 61
Overview .......................................................................................................................... 61
Creating a Mock-up and Prototyping ............................................................................... 62
The Main Screen ..................................................................................................................................... 64
The List Views ........................................................................................................................................ 66
The Details Views ................................................................................................................................... 69
■ CONTENTS
vii
The View Models .............................................................................................................. 70
Base ViewModel Implementation ........................................................................................................... 70
Details ViewModel .................................................................................................................................. 73
List ViewModel ....................................................................................................................................... 74
Navigation Between the Views ........................................................................................ 77
The App.xaml File ................................................................................................................................... 77
Wrapping Up with IoC ...................................................................................................... 79
Inversion of Control ................................................................................................................................ 79
A Classic Implementation, Navigation Service ....................................................................................... 79
Summary ......................................................................................................................... 85
■ ■Chapter 5: Adding Controls to the Views ............................................................... 87
Resources and Styles ...................................................................................................... 87
Differences Between Static and Dynamic Resources ............................................................................ 88
The Resource Dictionary ......................................................................................................................... 88
Controls’ Styles ....................................................................................................................................... 91
Creating the Views ........................................................................................................... 97
Login View .............................................................................................................................................. 98
Details View .......................................................................................................................................... 100
List View ............................................................................................................................................... 104
User Controls for the Dashboard .......................................................................................................... 107
The Dashboard (MainView) ................................................................................................................... 109
Add Features to the Application ..................................................................................... 110
Custom Effects ..................................................................................................................................... 110
Summary ....................................................................................................................... 111
■ ■Chapter 6: The Entity Framework ........................................................................ 113
Object Relational Mappers ................................................................................................................... 113
Active Record Pattern ........................................................................................................................... 115
Code First Development ....................................................................................................................... 117
■ CONTENTS
viii
The TimeTracker Domain ............................................................................................... 121
Mapping the Domain Model .................................................................................................................. 121
The TimeTracker Data Layer .......................................................................................... 135
The Unit of Work ................................................................................................................................... 135
The Repository ...................................................................................................................................... 151
Summary ....................................................................................................................... 158
■ ■Chapter 7: Data Binding ....................................................................................... 159
WPF Data Binding Engine .............................................................................................. 159
The INotifyPropertyChanged Interface .................................................................................................. 160
Binding Direction .................................................................................................................................. 162
The IValueConverter Interface .............................................................................................................. 162
DataTemplate ....................................................................................................................................... 166
UI Validation .......................................................................................................................................... 168
Binding Syntax ...................................................................................................................................... 170
ViewModels ................................................................................................................... 171
A Generic ViewModel Validator ............................................................................................................. 171
Employee ViewModels .......................................................................................................................... 173
Additional ViewModels and Properties ................................................................................................. 184
Summary ....................................................................................................................... 187
■ ■Chapter 8: Command Handling and Event Routing ............................................. 189
Introduction to Commands ............................................................................................ 190
The Command Pattern .......................................................................................................................... 190
Command in WPF ................................................................................................................................. 191
Interactive Command, Listen for Changes ............................................................................................ 198
TimeTracker Commands ................................................................................................ 204
The EmployeeListView .......................................................................................................................... 204
Summary ....................................................................................................................... 208
■ CONTENTS
ix
■ ■Chapter 9: Testing with TDD ............................................................................... 209
Test Driven Development .............................................................................................. 209
Code Coverage. .................................................................................................................................... 210
TDD with MSTest . ................................................................................................................................ 212
Code Coverage with Visual Studio ....................................................................................................... 216
TDD: the TimeTracker Application ................................................................................ 219
Test the Business (Domain) Layer ....................................................................................................... 220
Testing the Data Layer ......................................................................................................................... 221
Testing the UI ....................................................................................................................................... 223
Summary ....................................................................................................................... 225
■ ■Chapter 10: Reports with Microsoft Reporting Services ................................... 227
SQL Server Reporting Services ..................................................................................... 228
Configure SQL Server Reporting Services ............................................................................................ 228
TimeTracker Reports . ................................................................................................... 231
First Report: EmployeeListReport ........................................................................................................ 231
EmployeeDetailsReport ....................................................................................................................... 237
Additional Reports . .............................................................................................................................. 241
Hosting the Reports in a WPF Control ........................................................................... 241
Display the Report in a WPF View ........................................................................................................ 242
Load a List of Employees Report ......................................................................................................... 244
Load a Detailed Report . ....................................................................................................................... 246
Summary ....................................................................................................................... 248
■ ■Chapter 11: Deploy the Application Using ClickOnce . ....................................... 251
ClickOnce Deployment .................................................................................................. 251
ClickOnce Security. .............................................................................................................................. 252
Download from Wow! eBook <www.wowebook.com>
■ CONTENTS
x
Publishing Options ......................................................................................................... 254
Updates ................................................................................................................................................ 254
Application Files and Prerequisites ...................................................................................................... 255
Additional Options ................................................................................................................................ 256
Deploy the TimeTracker Application .............................................................................. 257
Create a Temporary Certificate............................................................................................................. 258
Security ................................................................................................................................................ 259
Publish TimeTracker ............................................................................................................................. 259
Summary ....................................................................................................................... 260
■ ■Chapter 12: Design Patterns in WPF .................................................................... 261
Patterns for the UI .......................................................................................................... 261
Model View Presenter ........................................................................................................................... 262
Model View ViewModel ........................................................................................................................ 268
Summary ....................................................................................................................... 273
■ ■Chapter 13: WPF and Multithreading ................................................................... 275
Writing Multithreading Code in .NET .............................................................................. 276
The Thread Object ................................................................................................................................ 276
Asynchronous Operations ..................................................................................................................... 280
The Task Object .................................................................................................................................... 283
The Background Worker Component .................................................................................................... 285
Summary ....................................................................................................................... 287
■ ■Chapter 14: Interacting with WCF ........................................................................ 289
Introduction to WCF ....................................................................................................... 290
Brief Overview of WCF Architecture ..................................................................................................... 291
A Sample WCF Project ................................................................................................... 292
The WCF Test Client Utility ................................................................................................................... 294
Customize the Sample Service ............................................................................................................. 295
■ CONTENTS
xi
Test the Sample Service ....................................................................................................................... 300
Conclusion and Considerations ............................................................................................................ 304
Integrate WCF into the TimeTracker Application ........................................................... 304
WCF Data Service ................................................................................................................................. 304
Navigate the Data Using oData Queries ................................................................................................ 306
Integrate the WCF Data Service in WPF ................................................................................................ 307
WCF Security ................................................................................................................. 308
Security Requirements ......................................................................................................................... 309
Bindings ................................................................................................................................................ 309
Provide the Credentials ........................................................................................................................ 310
Authenticate and Authorize the Code ................................................................................................... 310
Summary ....................................................................................................................... 311
Index ....................................................................................................................... 313

标签: C# wpf

实例下载地址

[Applied.WPF.4.in.Context(第1版)].(Raffaele.Garofalo)

不能下载?内容有错? 点击这里报错 + 投诉 + 提问

好例子网口号:伸出你的我的手 — 分享

网友评论

发表评论

(您的评论需要经过审核才能显示)

查看所有0条评论>>

小贴士

感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。

  • 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
  • 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
  • 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
  • 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
;
报警