没有合适的资源?快使用搜索试试~ 我知道了~
Windows 8 apps with XAML and C#英文原版
4星 · 超过85%的资源 需积分: 10 23 下载量 3 浏览量
2013-06-14
00:10:41
上传
评论
收藏 10.52MB PDF 举报
温馨提示
试读
579页
Windows 8 apps with XAML and C#的英文版··看英语看不进去的就不要下载啦
资源推荐
资源详情
资源评论
Charles Petzold
Windows
®
Programming
SIXTH EDITION
Writing Windows 8 Apps
With C# and XAML
Release Preview eBook
PUBLISHED BY
Microsoft Press
A Division of Microsoft Corporation
One Microsoft Way
Redmond, Washington 98052-6399
Copyright © 2012 Charles Petzold
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.
ISBN: 978-0-7356-7176-8
This document supports a preliminary release of a software product that may be changed substantially prior to
final commercial release. This document is provided for informational purposes only and Microsoft makes no
warranties, either express or implied, in this document. Information in this document, including URL and other
Internet website references, is subject to change without notice
.
The entire risk of the use or the results from
the use of this document remains with the user.
Unless otherwise noted, the companies, organizations, products, domain names, e-mail addresses, logos,
people, places, and events depicted in examples herein are fictitious. No association with any real company,
organization, product, domain name, e-mail address, logo, person, place, or event is intended or should be
inferred.
Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under
copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or
transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or
for any purpose, without the express written permission of Microsoft Corporation.
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.
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, Developmental, and Project Editor:
Devon Musgrave
Technical Reviewer:
Marc Young
Cover:
Twist Creative • Seattle
d
e:
o
d
e:
:
www.itpub.net
Introduction ......................................................................................................... 9
The Versions of Windows 8 ....................................................................................................................................................... 9
The Focus of This Book ............................................................................................................................................................. 10
The Approach ............................................................................................................................................................................... 12
My Setup ........................................................................................................................................................................................ 13
The Programming Windows Heritage .................................................................................................................................. 13
Behind the Scenes ....................................................................................................................................................................... 16
Errata & Book Support .............................................................................................................................................................. 17
We Want to Hear from You ..................................................................................................................................................... 17
Stay in Touch ................................................................................................................................................................................ 17
Chapter 1: Markup and Code .......................................................................... 18
The First Project ........................................................................................................................................................................... 18
Graphical Greetings .................................................................................................................................................................... 24
Variations in Text ......................................................................................................................................................................... 28
Media As Well .............................................................................................................................................................................. 36
The Code Alternatives ............................................................................................................................................................... 37
Images in Code ............................................................................................................................................................................ 41
Not Even a Page .......................................................................................................................................................................... 43
Chapter 2: XAML Syntax .................................................................................. 45
The Gradient Brush in Code .................................................................................................................................................... 45
Property Element Syntax .......................................................................................................................................................... 48
Content Properties...................................................................................................................................................................... 51
The TextBlock Content Property............................................................................................................................................. 55
Sharing Brushes (and Other Resources) ............................................................................................................................... 57
Resources Are Shared ................................................................................................................................................................ 61
A Bit of Vector Graphics ............................................................................................................................................................ 62
Stretching with Viewbox ........................................................................................................................................................... 71
Styles ............................................................................................................................................................................................... 74
A Taste of Data Binding ............................................................................................................................................................ 80
3
Chapter 3: Basic Event Handling .................................................................... 83
The Tapped Event ........................................................................................................................................................................ 83
Routed Event Handling ............................................................................................................................................................. 86
Overriding the Handled Setting ............................................................................................................................................. 92
Input, Alignment, and Backgrounds ..................................................................................................................................... 93
Size and Orientation Changes ................................................................................................................................................ 97
Bindings to Run? .......................................................................................................................................................................101
Timers and Animation .............................................................................................................................................................103
Chapter 4: The Border Element ..................................................................... 111
The Border Element ..................................................................................................................................................................111
Rectangle and Ellipse ...............................................................................................................................................................115
The StackPanel ...........................................................................................................................................................................117
Horizontal Stacks .......................................................................................................................................................................121
WhatSize with Bindings (and a Converter) .......................................................................................................................124
The ScrollViewer Solution .......................................................................................................................................................128
Layout Weirdness or Normalcy? ..........................................................................................................................................134
Making an E-Book ....................................................................................................................................................................135
Fancier StackPanel Items ........................................................................................................................................................138
Deriving from UserControl .....................................................................................................................................................141
Creating Windows Runtime Libraries .................................................................................................................................143
The Wrap Alternative ...............................................................................................................................................................146
The Canvas and Attached Properties .................................................................................................................................148
The Z-Index .................................................................................................................................................................................153
Canvas Weirdness .....................................................................................................................................................................153
Chapter 5: Control Interaction ...................................................................... 155
The Control Difference ............................................................................................................................................................155
The Slider for Ranges ...............................................................................................................................................................157
The Grid ........................................................................................................................................................................................161
Orientation and Aspect Ratios ..............................................................................................................................................168
Slider and the Formatted String Converter ......................................................................................................................171
4
www.itpub.net
Tooltips and Conversions .......................................................................................................................................................171
Sketching with Sliders ..............................................................................................................................................................174
The Varieties of Button Experience .....................................................................................................................................176
Defining Dependency Properties .........................................................................................................................................184
RadioButton Tags ......................................................................................................................................................................194
Keyboard Input and TextBox .................................................................................................................................................200
Touch and Thumb .....................................................................................................................................................................204
Chapter 6: WinRT and MVVM ....................................................................... 211
MVVM (Brief and Simplified).................................................................................................................................................211
Data Binding Notifications .....................................................................................................................................................212
A View Model for ColorScroll ................................................................................................................................................214
Syntactic Shortcuts ...................................................................................................................................................................219
The DataContext Property .....................................................................................................................................................222
Bindings and TextBox ...............................................................................................................................................................224
Buttons and MVVM ..................................................................................................................................................................230
The DelegateCommand Class ................................................................................................................................................231
Chapter 7: Building an Application .............................................................. 238
Commands, Options, and Settings ......................................................................................................................................238
The Segoe UI Symbol Font.....................................................................................................................................................240
The Application Bar ..................................................................................................................................................................246
Popups and Dialogs .................................................................................................................................................................248
Windows Runtime File I/O .....................................................................................................................................................251
Await and Async ........................................................................................................................................................................258
Calling Your Own Async Methods .......................................................................................................................................260
Controls for XamlCruncher ....................................................................................................................................................263
Application Settings and Isolated Storage........................................................................................................................278
The XamlCruncher Page .........................................................................................................................................................282
Parsing the XAML......................................................................................................................................................................286
XAML Files In and Out .............................................................................................................................................................288
The Settings Dialog ..................................................................................................................................................................292
5
剩余578页未读,继续阅读
资源评论
- jung24132014-05-26It's not all book. This is just smple book.
- Semimonk2013-06-27我要找的是 Adam Nathan 的 Windows 8 apps with XAML and C#, 这本不是. 这是 Charles Petzold 的 Programming Windows: Writing Windows 8 Apps With C# and XAML, 而且还不全.
- i4cll2014-12-05好书,大师作品
- gititfortest2014-05-12这个不是原版
- TimothyLiu2014-06-30是啊, 不是想要的书.
苏雨新
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功