没有合适的资源?快使用搜索试试~ 我知道了~
首页使用C#开发Silverlight 3应用程序实战指南
使用C#开发Silverlight 3应用程序实战指南
需积分: 10 1 下载量 53 浏览量
更新于2024-07-28
收藏 25.57MB PDF 举报
"Apress.Pro.Silverlight.3.in.C.Sharp.pdf"
本书《Pro Silverlight 3 in C#》由Matthew MacDonald撰写,是关于使用C#语言开发Silverlight 3应用程序的专业指南。这本书旨在帮助开发者利用Silverlight 3创建跨平台的.NET应用程序,特别适合于Web浏览器环境。
Silverlight是微软推出的一个强大的富互联网应用程序(RIA)框架,它允许开发者使用.NET Framework和C#等语言来构建具有丰富视觉效果和交互性的Web应用。在Silverlight 3版本中,开发者可以享受到更多的功能和改进,包括更高级的图形处理、媒体播放支持、更强大的数据绑定以及更好的性能。
书中的内容可能涵盖了以下几个方面:
1. **Silverlight基础**:介绍Silverlight的概念,如何安装和设置开发环境,以及Silverlight与传统的Web开发技术如HTML和JavaScript的区别。
2. **C#编程基础**:回顾C#语言的关键特性,包括类、对象、接口、继承、多态等面向对象编程概念,以及Lambda表达式、LINQ等现代C#特性。
3. **XAML简介**:讲解XAML语言,它是Silverlight用户界面的主要描述语言,用于声明式地定义UI元素和布局。
4. **UI设计与交互**:深入探讨控件、布局管理、事件处理和动画,展示如何创建动态、响应式的用户界面。
5. **数据绑定与服务通信**:介绍如何将应用程序与后端数据源进行绑定,以及使用WCF服务进行远程通信。
6. **多媒体支持**:讨论Silverlight对音频和视频的处理,包括流媒体和本地文件播放。
7. **高级图形与3D**:讲解如何利用Silverlight的图形API创建复杂的2D和3D图形。
8. **离线应用与脱机支持**:介绍如何利用Isolated Storage实现离线应用,以及脱机数据同步机制。
9. **部署与测试**:提供关于如何在不同环境中部署Silverlight应用程序的指导,以及测试和调试技巧。
10. **最佳实践与案例研究**:分享开发Silverlight应用程序时的常见问题和解决方案,以及实际项目中的应用示例。
这本书的作者Matthew MacDonald是一位经验丰富的技术作家,他通过清晰的解释和实例代码,使得复杂的技术概念易于理解。技术审阅者Damien Foggon的贡献则确保了书中内容的技术准确性。
作为一本专业书籍,它不仅适合初学者入门,也适用于有一定基础的开发者提升技能。无论你是希望扩展Web开发技能集,还是打算深入研究Silverlight技术,这本书都能为你提供宝贵的指导。

■ CONTENTS
xiv
Animation Easing.........................................................................................................................339
Using an Easing Function .......................................................................................................................340
Easing In and Easing Out........................................................................................................................341
Easing Function Classes.........................................................................................................................342
Animation Types Revisited..........................................................................................................346
Animating Transforms ............................................................................................................................346
Animation Perspective Projections ........................................................................................................349
Animating Brushes..................................................................................................................................351
Animating Pixel Shaders.........................................................................................................................352
Key-Frame Animation .............................................................................................................................353
Discrete Key Frames..........................................................................................................................355
Easing Key Frames ............................................................................................................................355
Spline Key Frames.............................................................................................................................356
Animations in Code .....................................................................................................................357
The Main Page.........................................................................................................................................359
The Bomb User Control ...........................................................................................................................360
Dropping the Bombs ...............................................................................................................................362
Intercepting a Bomb ...............................................................................................................................365
Counting Bombs and Cleaning Up..........................................................................................................366
Encapsulating Animations ..........................................................................................................368
Page Transitions .....................................................................................................................................369
The Base Class........................................................................................................................................370
The Wipe Transition ................................................................................................................................372
Frame-Based Animation .............................................................................................................374
Animation Performance ..............................................................................................................378
Desired Frame Rate.................................................................................................................................378
Hardware Acceleration ...........................................................................................................................379
Enabling Hardware Acceleration ......................................................................................................380
Bitmap Caching .................................................................................................................................380
Evaluating Hardware Acceleration ...................................................................................................383
The Last Word..............................................................................................................................385
■Chapter 11: Sound, Video, and Deep Zoom....................................................................387
Supported File Types...................................................................................................................387
The MediaElement.......................................................................................................................388
Controlling Playback...............................................................................................................................389
Handling Errors .......................................................................................................................................390
Playing Multiple Sounds .........................................................................................................................390
Changing Volume, Balance, and Position ..............................................................................................391
Playing Video...........................................................................................................................................395
Client-Side Playlists................................................................................................................................396
Server-Side Playlists...............................................................................................................................396

■ CONTENTS
xv
Progressive Downloading and Streaming..............................................................................................397
Adaptive Streaming.................................................................................................................................399
Advanced Video Playback...........................................................................................................400
Video Encoding........................................................................................................................................400
Encoding in Expression Encoder ............................................................................................................401
Markers ...................................................................................................................................................403
Adding Markers with Expression Encoder .......................................................................................403
Using Markers in a Silverlight Application.......................................................................................405
VideoBrush ..............................................................................................................................................408
Video Effects ...........................................................................................................................................409
Deep Zoom...................................................................................................................................414
Creating a Deep Zoom Image Set...........................................................................................................416
Using a Deep Zoom Image Set in Silverlight..........................................................................................419
The Last Word..............................................................................................................................423
■Chapter 12: Styles and Behaviors ..................................................................................425
Styles ...........................................................................................................................................425
Defining a Style.......................................................................................................................................426
Applying a Style ......................................................................................................................................427
Dynamic Styles........................................................................................................................................428
Style Inheritance .....................................................................................................................................429
Organizing Styles ....................................................................................................................................430
Behaviors.....................................................................................................................................431
Getting Support for Behaviors ................................................................................................................432
Triggers and Actions...............................................................................................................................432
Creating an Action.............................................................................................................................433
Connecting an Action to an Element.................................................................................................435
Design-Time Behavior Support in Blend ..........................................................................................436
Creating a Targeted Trigger..............................................................................................................439
Creating a Behavior.................................................................................................................................443
Finding More Behaviors..........................................................................................................................446
The Last Word..............................................................................................................................448
■Chapter 13: Templates and Custom Controls ................................................................449
Template Basics..........................................................................................................................449
Creating a Template................................................................................................................................450
Reusing Control Templates.....................................................................................................................451
The ContentPresenter .............................................................................................................................452
Template Bindings ..................................................................................................................................452
Setting Templates through Styles ..........................................................................................................454
Reusing Colors ........................................................................................................................................455
The Parts and States Model........................................................................................................456
Understanding States with the Button Control ......................................................................................457

■ CONTENTS
xvi
Showing a Focus Cue..............................................................................................................................462
Transitions...............................................................................................................................................463
The Default Transition.......................................................................................................................464
From and To Transitions ...................................................................................................................465
Transitioning to a Steady State.........................................................................................................466
Custom Transition .............................................................................................................................466
Understanding Parts with the Slider Control .........................................................................................468
Creating Templates for Custom Controls ...................................................................................472
Planning the FlipPanel Control ...............................................................................................................473
Creating the Solution ..............................................................................................................................474
Starting the FlipPanel Class....................................................................................................................474
Adding the Default Style with Generic.xaml ..........................................................................................476
Choosing Parts and States......................................................................................................................478
Starting the Default Control Template ...................................................................................................480
The FlipButton Control ............................................................................................................................481
Defining the State Animations................................................................................................................482
Wiring Up the Elements in the Template................................................................................................484
Using the FlipPanel .................................................................................................................................486
Using a Different Control Template........................................................................................................487
The Last Word..............................................................................................................................489
■Chapter 14: Browser Integration....................................................................................491
Interacting with HTML Elements.................................................................................................492
Getting Browser Information ..................................................................................................................493
The HTML Window ..................................................................................................................................494
Popup Windows.......................................................................................................................................495
Inspecting the HTML Document .............................................................................................................496
Manipulating an HTML Element..............................................................................................................498
Inserting and Removing Elements....................................................................................................501
Changing Style Properties.................................................................................................................502
Handling JavaScript Events....................................................................................................................503
Code Interaction ..........................................................................................................................505
Calling Browser Script from Silverlight..................................................................................................506
Calling Silverlight Methods from the Browser.......................................................................................506
Instantiating Silverlight Objects in the Browser....................................................................................509
Combining Silverlight and HTML Content...................................................................................510
Sizing the Silverlight Control to Fit Its Content......................................................................................511
Placing the Silverlight Control Next to an HTML Element .....................................................................512
Securing HTML Interoperability ..................................................................................................515
The Last Word..............................................................................................................................516
■Chapter 15: ASP.NET Web Services................................................................................517
Building Web Services for Silverlight.........................................................................................517

■ CONTENTS
xvii
Creating a Web Service...........................................................................................................................518
Adding a Service Reference....................................................................................................................519
Calling the Web Service..........................................................................................................................521
Configuring the Web Service URL...........................................................................................................524
Web Service Data Types..............................................................................................................526
More Advanced Web Services.....................................................................................................527
Cross-Domain Web Service Calls...........................................................................................................528
Monitoring the Network Connection ......................................................................................................530
Using ASP.NET Platform Services...........................................................................................................531
Duplex Services...........................................................................................................................533
Configuring the Service ..........................................................................................................................534
The Interfaces .........................................................................................................................................535
The Service..............................................................................................................................................536
The Client.................................................................................................................................................537
The Last Word..............................................................................................................................539
■Chapter 16: Data Binding................................................................................................541
Binding to Data Objects...............................................................................................................542
Building a Data Object ............................................................................................................................542
Displaying a Data Object with DataContext...........................................................................................543
Storing a Data Object as a Resource......................................................................................................546
Editing with Two-Way Bindings .............................................................................................................547
Validation ................................................................................................................................................548
ValidatesOnException........................................................................................................................548
NotifyOnValidationError.....................................................................................................................551
The Validation Class..........................................................................................................................552
Change Notification.................................................................................................................................553
Building a Data Service...........................................................................................................................554
Calling the Data Service..........................................................................................................................557
Binding to a Collection of Objects...............................................................................................559
Displaying and Editing Collection Items ................................................................................................559
Inserting and Removing Collection Items..............................................................................................563
Binding to a LINQ Expression .................................................................................................................564
Master-Details Display ...........................................................................................................................567
Data Conversion ..........................................................................................................................570
Formatting Strings with a Value Converter............................................................................................570
Creating Objects with a Value Converter ...............................................................................................574
Applying Conditional Formatting............................................................................................................577
Data Templates............................................................................................................................579
Separating and Reusing Templates .......................................................................................................581
More Advanced Templates .....................................................................................................................581
Changing Item Layout.............................................................................................................................583

■ CONTENTS
xviii
The Last Word..............................................................................................................................584
■Chapter 17: Data Controls ..............................................................................................585
Better Data Forms .......................................................................................................................586
The Goal: Data Class Markup .................................................................................................................586
The Label .................................................................................................................................................587
The DescriptionViewer............................................................................................................................589
The ValidationSummary..........................................................................................................................590
Data Annotations.........................................................................................................................593
Raising Annotation Errors.......................................................................................................................593
The Annotation Attributes.......................................................................................................................595
Required.............................................................................................................................................595
StringLength ......................................................................................................................................595
Range.................................................................................................................................................596
RegularExpression.............................................................................................................................596
CustomValidation ..............................................................................................................................599
Web Service Type Sharing......................................................................................................................601
Identifying Your Data Classes...........................................................................................................601
Setting Up the Visual Studio Solution...............................................................................................602
The DataGrid................................................................................................................................604
Creating a Simple Grid............................................................................................................................605
Resizing and Rearranging Columns.......................................................................................................607
Defining Columns....................................................................................................................................608
The DataGridCheckBoxColumn.........................................................................................................610
The DataGridTemplateColumn ..........................................................................................................610
Formatting and Styling Columns............................................................................................................612
Formatting Rows.....................................................................................................................................614
Row Details .............................................................................................................................................616
Freezing Columns....................................................................................................................................617
Selection..................................................................................................................................................618
Sorting.....................................................................................................................................................619
DataGrid Editing...........................................................................................................................620
Editing with Templates ...........................................................................................................................620
Validation and Editing Events.................................................................................................................621
The PagedCollectionView............................................................................................................624
Sorting.....................................................................................................................................................625
Filtering ...................................................................................................................................................625
Grouping..................................................................................................................................................626
Paging......................................................................................................................................................628
The TreeView...............................................................................................................................631
Filling a TreeView....................................................................................................................................631
A Data-Bound TreeView..........................................................................................................................632
剩余833页未读,继续阅读
点击了解资源详情
点击了解资源详情
112 浏览量
2010-09-04 上传
117 浏览量
118 浏览量
118 浏览量
103 浏览量
226 浏览量

duanmusy
- 粉丝: 0
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助

最新资源
- Node.js基础代码示例解析
- MVVM Light工具包:跨平台MVVM应用开发加速器
- Halcon实验例程集锦:C语言与VB的实践指南
- 维美短信API:团购网站短信接口直连解决方案
- RTP转MP4存储技术解析及应用
- MySQLFront客户端压缩包的内容分析
- LSTM用于PTB数据库中ECG信号的心电图分类
- 飞凌-MX6UL开发板QT4.85看门狗测试详解
- RepRaptor:基于Qt的RepRap gcode发送控制器
- Uber开源高性能地理数据分析工具kepler.gl介绍
- 蓝色主题的简洁企业网站管理系统模板
- 深度解析自定义Launcher源码与UI设计
- 深入研究操作系统中的磁盘调度算法
- Vim插件clever-f.vim:深度优化f,F,t,T按键功能
- 弃用警告:Meddle.jl中间件堆栈使用风险提示
- 毕业设计网上书店系统完整代码与论文
安全验证
文档复制为VIP权益,开通VIP直接复制
