基本信息
源码名称:Programming Windows 6th Edition.pdf
源码大小:9.26M
文件格式:.pdf
开发语言:C#
更新时间:2020-04-21
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559
本次赞助数额为: 2 元×
微信扫码支付:2 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
[Microsoft Press] Programming Windows 6th Edition.pdf
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 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 Beyond the Windows Runtime .............................................................................................................................................298 Chapter 8: Animation ..................................................................................... 299 The Windows.UI.Xaml.Media.Animation Namespace ....................................................................................................299 Animation Basics .......................................................................................................................................................................300 Animation Variation Appreciation .......................................................................................................................................303 Other Double Animations ......................................................................................................................................................310 Animating Attached Properties ............................................................................................................................................317 The Easing Functions ...............................................................................................................................................................320 All-XAML Animations...............................................................................................................................................................329 Animating Custom Classes .....................................................................................................................................................333 Key Frame Animations.............................................................................................................................................................337 The Object Animation ..............................................................................................................................................................341 Predefined Animations and Transitions .............................................................................................................................343 Chapter 9: Transforms .................................................................................... 347 A Brief Overview ........................................................................................................................................................................347 Rotation (Manual and Animated) ........................................................................................................................................350 Visual Feedback .........................................................................................................................................................................356 Translation ...................................................................................................................................................................................358 Transform Groups .....................................................................................................................................................................361 The Scale Transform .................................................................................................................................................................366 Building an Analog Clock .......................................................................................................................................................370 Skew...............................................................................................................................................................................................375 Making an Entrance .................................................................................................................................................................378 Transform Mathematics ..........................................................................................................................................................379 The CompositeTransform .......................................................................................................................................................386 Geometry Transforms ..............................................................................................................................................................389 Brush Transforms .......................................................................................................................................................................391 Dude, Where’s My Element? .................................................................................................................................................395 Projection Transforms ..............................................................................................................................................................398 Deriving a Matrix3D .................................................................................................................................................................405 6 Chapter 13: Touch, Etc. ...................................................................................416 A Pointer Roadmap ..................................................................................................................................................................417 A First Dab at Finger Painting ...............................................................................................................................................420 Capturing the Pointer ..............................................................................................................................................................423 Editing with a Popup Menu ...................................................................................................................................................431 Pressure Sensitivity ...................................................................................................................................................................435 How Do I Save My Drawings? ...............................................................................................................................................438 A Touch Piano ............................................................................................................................................................................439 Manipulation, Fingers, and Elements .................................................................................................................................444 Working with Inertia ................................................................................................................................................................452 An XYSlider Control ..................................................................................................................................................................456 Centered Scaling and Rotation .............................................................................................................................................462 Single-Finger Rotation.............................................................................................................................................................466 Chapter 14: Bitmaps .......................................................................................473 Pixel Bits .......................................................................................................................................................................................474 Transparency and Premultiplied Alphas ............................................................................................................................480 A Radial Gradient Brush ..........................................................................................................................................................485 Loading and Saving Image Files...........................................................................................................................................493 In Progress ...................................................................................................................................................................................503 Completed ...................................................................................................................................................................................503 Chapter 15: Printing .......................................................................................504 Basic Printing ..............................................................................................................................................................................504 Printable and Unprintable Margins .....................................................................................................................................511 The Pagination Process ...........................................................................................................................................................515 Custom Printing Properties....................................................................................................................................................522 Printing a Monthly Planner ....................................................................................................................................................527 Printing a Range of Pages ......................................................................................................................................................537 Where to Do the Big Jobs? ....................................................................................................................................................548 7 Chapter 16: Going Native .............................................................................. 549 An Introduction to P/Invoke..................................................................................................................................................549 Some Help ...................................................................................................................................................................................555 Time Zone Information ...........................................................................................................................................................555 A Windows Runtime Component Wrapper for DirectX ...............................................................................................577 About the Author ........................................................................................... 578