没有合适的资源?快使用搜索试试~ 我知道了~
Programming Windows 6th Edition
5星 · 超过95%的资源 需积分: 10 9 下载量 156 浏览量
2012-10-31
10:13:17
上传
评论
收藏 5.03MB PDF 举报
温馨提示
试读
294页
Programming Windows 6th Edition 第一本关于win8开发的书籍。
资源推荐
资源详情
资源评论
Charles Petzold
Windows
®
Programming
SIXTH EDITION
Writing Windows 8 Apps
With C# and XAML
Consumer 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
2
Introduction .................................................................................... 6
The Versions of Windows 8 ............................................................................. 6
The Focus of This Book ...................................................................................... 7
The Approach ........................................................................................................ 8
My Setup .............................................................................................................. 10
The Programming Windows Heritage....................................................... 10
Behind the Scenes ............................................................................................ 13
Errata & Book Support .................................................................................... 13
We Want to Hear from You .......................................................................... 14
Stay in Touch ...................................................................................................... 14
Chapter 1: Markup and Code ....................................................... 15
The First Project ................................................................................................. 15
Graphical Greetings ......................................................................................... 21
Variations in Text .............................................................................................. 24
Media As Well .................................................................................................... 33
The Code Alternatives ..................................................................................... 34
Images in Code .................................................................................................. 38
Not Even a Page ................................................................................................ 40
Chapter 2: XAML Syntax .............................................................. 42
The Gradient Brush in Code ......................................................................... 42
Property Element Syntax ................................................................................ 45
Content Properties ........................................................................................... 48
The TextBlock Content Property ................................................................. 52
Sharing Brushes (and Other Resources) ................................................... 54
Resources Are Shared ...................................................................................... 58
A Bit of Vector Graphics ................................................................................. 59
Styles ...................................................................................................................... 68
A Taste of Data Binding ................................................................................. 74
Chapter 3: Basic Event Handling ................................................. 78
The Tapped Event ............................................................................................. 78
3
Routed Event Handling .................................................................................. 81
Overriding the Handled Setting .................................................................. 87
Input, Alignment, and Backgrounds ......................................................... 88
Size and Orientation Changes ..................................................................... 91
Bindings to Run? ............................................................................................... 96
Timers and Animation ..................................................................................... 98
Chapter 4: Presentation with Panels......................................... 106
The Border Element ........................................................................................ 106
Rectangle and Ellipse .................................................................................... 110
The StackPanel ................................................................................................. 112
Horizontal Stacks ............................................................................................ 116
WhatSize with Bindings (and a Converter) ........................................... 119
The ScrollViewer Solution ............................................................................ 123
Layout Weirdness or Normalcy? ............................................................... 129
Making an E-Book .......................................................................................... 130
Fancier StackPanel Items ............................................................................. 133
Creating Windows Runtime Libraries ..................................................... 138
The Wrap Alternative .................................................................................... 140
The Canvas and Attached Properties ..................................................... 142
The Z-Index ....................................................................................................... 147
Canvas Weirdness ........................................................................................... 148
Chapter 5: Control Interaction .................................................. 150
The Control Difference .................................................................................. 150
The Slider for Ranges ..................................................................................... 152
The Grid .............................................................................................................. 156
Orientation and Aspect Ratios ................................................................... 163
Slider and the Formatted String Converter .......................................... 166
Tooltips and Conversions ............................................................................ 166
Sketching with Sliders ................................................................................... 168
The Varieties of Button Experience .......................................................... 170
4
Dependency Properties ................................................................................ 179
RadioButton Tags ............................................................................................ 187
Keyboard Input and TextBox ...................................................................... 194
Touch and Thumb .......................................................................................... 198
Chapter 6: WinRT and MVVM .................................................. 205
MVVM (Brief and Simplified)...................................................................... 205
Data Binding Notifications .......................................................................... 206
Deriving from BindableBase ....................................................................... 213
Bindings and TextBox .................................................................................... 218
Buttons and MVVM ....................................................................................... 223
The DelegateCommand Class .................................................................... 225
Chapter 7: Building an Application .......................................... 231
Commands, Options, and Settings .......................................................... 231
The Segoe UI Symbol Font .......................................................................... 233
The Application Bar ........................................................................................ 239
Popups and Dialogs ....................................................................................... 241
Windows Runtime File I/O .......................................................................... 244
Await and Async .............................................................................................. 251
Calling Your Own Async Methods ............................................................ 253
Controls for XamlCruncher ......................................................................... 255
Application Settings and Isolated Storage............................................ 271
The XamlCruncher Page .............................................................................. 275
Parsing the XAML ........................................................................................... 279
XAML Files In and Out .................................................................................. 282
The Settings Dialog ........................................................................................ 286
Beyond the Windows Runtime .................................................................. 291
Author Bio ............................................................................................................ 293
5
剩余293页未读,继续阅读
资源评论
- lebron2008lebron2014-07-21英文的看着特别好,简单易懂
- kevin_832012-11-20好久不看windows了 进入了android的时代,回来再仔细看看这个部分。
- chun8hu92014-04-09之前一直看的实体书,太不便携,电子版就好多了
w_l_h_
- 粉丝: 18
- 资源: 10
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- tensorflow-gpu-2.7.4-cp37-cp37m-manylinux2010-x86-64.whl
- 多段线、 圆、弧转多段线(仅我可见)
- tensorflow-2.7.2-cp38-cp38-manylinux2010-x86-64.whl
- yeyue-p8Yi4-ve4a83792.apk
- tensorflow-gpu-2.7.3-cp38-cp38-manylinux2010-x86-64.whl
- 五相感应电机矢量控制模型MATLAB
- RGLED (1) (1).circ
- IMG_20240427_215747.jpg
- python下前端WEB学习笔记
- 田间种植行排号自动生成工具
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功