SlideShare a Scribd company logo
Essential Windows Phone 7 5 Application
Development with Silverlight 1st Edition Shawn
Wildermuth pdf download
https://ebookgate.com/product/essential-windows-
phone-7-5-application-development-with-silverlight-1st-edition-
shawn-wildermuth/
Get the full ebook with Bonus Features for a Better Reading Experience on ebookgate.com
Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...
Windows Phone 7 Developer Guide Building connected mobile
applications with Microsoft Silverlight Developer Series
1st Edition Dominic Betts
https://ebookgate.com/product/windows-phone-7-developer-guide-
building-connected-mobile-applications-with-microsoft-silverlight-
developer-series-1st-edition-dominic-betts/
ebookgate.com
Windows Phone 7 Secrets 1st Edition Paul Thurrott
https://ebookgate.com/product/windows-phone-7-secrets-1st-edition-
paul-thurrott/
ebookgate.com
Programming with Mobile Applications Android iOS and
Windows Phone 7 1st Edition Thomas J. Duffy
https://ebookgate.com/product/programming-with-mobile-applications-
android-ios-and-windows-phone-7-1st-edition-thomas-j-duffy/
ebookgate.com
Windows 8 and Windows Phone 8 Game Development 1st Edition
Adam Dawes (Auth.)
https://ebookgate.com/product/windows-8-and-windows-phone-8-game-
development-1st-edition-adam-dawes-auth/
ebookgate.com
Professional Windows Phone 7 Game Development Creating
Games using XNA Game Studio 4 1st Edition Chris G.
Williams
https://ebookgate.com/product/professional-windows-phone-7-game-
development-creating-games-using-xna-game-studio-4-1st-edition-chris-
g-williams/
ebookgate.com
Pro Windows Phone App Development 3rd Edition Falafel
Software
https://ebookgate.com/product/pro-windows-phone-app-development-3rd-
edition-falafel-software/
ebookgate.com
Windows Phone 7 Recipes A Problem Solution Approach 1st
Edition Fabio Claudio Ferracchiati
https://ebookgate.com/product/windows-phone-7-recipes-a-problem-
solution-approach-1st-edition-fabio-claudio-ferracchiati/
ebookgate.com
Microsoft Silverlight 4 Business Application Development
Beginners Guide 1st New edition Edition Cameron Albert
https://ebookgate.com/product/microsoft-silverlight-4-business-
application-development-beginners-guide-1st-new-edition-edition-
cameron-albert/
ebookgate.com
Windows 7 Secrets 1st Edition Paul Thurrott
https://ebookgate.com/product/windows-7-secrets-1st-edition-paul-
thurrott/
ebookgate.com
Essential Windows Phone 7 5 Application Development with Silverlight 1st Edition Shawn Wildermuth
Essential Windows Phone 7 5 Application Development with Silverlight 1st Edition Shawn Wildermuth
Essential Windows
Phone 7.5
The award-winning Microsoft .NET Development Series was
established in 2002 to provide professional developers with the
most comprehensive, practical coverage of the latest .NET technologies.
Authors in this series include Microsoft architects, MVPs, and other
experts and leaders in the field of Microsoft development technologies.
Each book provides developers with the vital information and critical
insight they need to write highly effective applications.
Visit informit.com/msdotnetseries for a complete list of available products.
Microsoft
®
.NET Development Series
Essential Windows
Phone 7.5
Application Development
with Silverlight
Shawn Wildermuth
Upper Saddle River, NJ • Boston • Indianapolis • San Francisco
New York • Toronto • Montreal • London • Munich • Paris • Madrid
Capetown • Sydney • Tokyo • Singapore • Mexico City
Many of the designations used by manufacturers and sellers to distinguish their products are
claimed as trademarks. Where those designations appear in this book, and the publisher was aware
of a trademark claim, the designations have been printed with initial capital letters or in all capitals.
The .NET logo is either a registered trademark or trademark of Microsoft Corporation in the United
States and/or other countries and is used under license from Microsoft.
Microsoft, Windows, Visual Basic, Visual C#, and Visual C++ are either registered trademarks or
trademarks of Microsoft Corporation in the U.S.A. and/or other countries/regions.
The author and publisher have taken care in the preparation of this book, but make no expressed or
implied warranty of any kind and assume no responsibility for errors or omissions. No liability is
assumed for incidental or consequential damages in connection with or arising out of the use of the
information or programs contained herein.
The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases
or special sales, which may include electronic versions and/or custom covers and content particular
to your business, training goals, marketing focus, and branding interests. For more information,
please contact:
U.S. Corporate and Government Sales
(800) 382-3419
corpsales@pearsontechgroup.com
For sales outside the United States, please contact:
International Sales
international@pearson.com
Visit us on the Web: informit.com/aw
Library of Congress Cataloging-in-Publication Data
Wildermuth, Shawn.
Essential windows phone 7.5 : application development with silverlight
/ Shawn Wildermuth.
p. cm.
Includes index.
ISBN 978-0-321-75213-0 (pbk. : alk. paper)
1. Windows phone (Computer file) 2. Silverlight (Electronic resource)
3. Operating systems (Computers) 4. Application software—Development.
5. Mobile computing—Programming. I. Title.
QA76.59.W54 2012
005.4’46—dc23
2011036842
Copyright © 2012 Pearson Education, Inc.
All rights reserved. Printed in the United States of America. This publication is protected by copy-
right, and permission must be obtained from the publisher prior to any prohibited reproduction,
storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical,
photocopying, recording, or likewise. To obtain permission to use material from this work, please
submit a written request to Pearson Education, Inc., Permissions Department, One Lake Street,
Upper Saddle River, New Jersey 07458, or you may fax your request to (201) 236-3290.
ISBN-13: 978-0-321-75213-0
ISBN-10: 0-321-75213-9
Text printed in the United States on recycled paper at RR Donnelley in Crawfordsville, Indiana.
First printing, December 2011
To my friend and mentor, Chris Sells,
without whom I would have never learned
that the story is more important than the facts.
This page intentionally left blank
vii
Contents at a Glance
Figures xvii
Tables xxv
Foreword xxvii
Preface xxix
Acknowledgments xxxi
About the Author xxxiii
1 Introducing Windows Phone 1
2 Writing Your First Phone Application 25
3 XAML Overview 61
4 Controls 89
5 Designing for the Phone 139
6 Developing for the Phone 187
7 Phone Integration 219
8 Databases and Storage 305
9 Multitasking 337
10 Services 369
11 The Marketplace 431
Index 459
This page intentionally left blank
ix
Contents
Figures xvii
Tables xxv
Foreword xxvii
Preface xxix
Acknowledgments xxxi
About the Author xxxiii
1 Introducing Windows Phone 1
A Different Kind of Phone 1
Integrated Experiences 6
Phone Specifications 7
Input Patterns 9
Designing for Touch 10
Hardware Buttons 11
Keyboards 11
Sensors 13
Application Lifecycle 14
Driving Your Development with Services 15
Live Tiles 16
The Marketplace 18
Distributing Your Application through the Marketplace 18
Marketplace Submissions 19
Application Policies 20
x Contents
Content Policies 23
Where Are We? 24
2 Writing Your First Phone Application 25
Preparing Your Machine 25
Creating a New Project 27
Visual Studio 27
XAML 32
Designing with Blend 36
Adding Code 43
Working with Events 46
Debugging in the Emulator 47
Debugging with a Device 48
Using Touch 52
Working with the Phone 55
Where Are We? 59
3 XAML Overview 61
What Is XAML? 61
XAML Object Properties 63
Understanding XAML Namespaces 64
Naming in XAML 65
Visual Containers 66
Visual Grammar 70
Shapes 71
Brushes 72
Colors 73
Text 74
Images 75
Transformations and Animations 77
Transformations 77
Animations 80
XAML Styling 82
Understanding Resources 83
Understanding Styles 84
Where Are We? 87
xi
Contents
4 Controls 89
Controls in Silverlight 89
Simple Controls 91
Content Controls 97
List Controls 98
Phone-Specific Controls 99
Panorama Control 99
Pivot Control 102
Data Binding 105
Simple Data Binding 105
Using a DataTemplate 108
Improving Scrolling Performance 108
Binding Formatting 110
Element Binding 110
Converters 111
Data Binding Errors 113
Control Templates 114
Silverlight for Windows Phone Toolkit 119
AutoCompleteBox Control 119
ContextMenu Control 121
DatePicker and TimePicker Controls 122
ListPicker Control 124
LongListSelector Control 127
PerformanceProgressBar Control 131
ToggleSwitch Control 132
ExpanderView Control 133
PhoneTextBox Control 134
WrapPanel Layout Container 136
Where Are We? 138
5 Designing for the Phone 139
The Third Screen 139
It Is a Phone, Right? 143
Deciding on an Application Paradigm 144
Panorama 146
xii Contents
Pivot 147
Simple Pages 150
Microsoft Expression Blend 150
Creating a Project 150
A Tour around Blend 151
Blend Basics 159
Layout 159
Brushes 164
Creating Animations 169
Working with Behaviors 173
Phone-Specific Design 176
The ApplicationBar in Blend 176
Using the Panorama Control in Blend 179
Using the Pivot Control in Blend 182
Previewing Applications 185
Where Are We? 185
6 Developing for the Phone 187
Application Lifecycle 187
Navigation 190
Tombstoning 195
The Phone Experience 200
Orientation 201
Designing for Touch 203
Application Client Area 211
Application Bar 213
Understanding Idle Detection 215
The Tilt Effect 216
Where Are We? 218
7 Phone Integration 219
Using Vibration 219
Using Motion 220
Emulating Motion 223
Using Sound 226
Playing Sounds with MediaElement 226
xiii
Contents
Using XNA Libraries 227
Playing Sounds with XNA 228
Adjusting Playback 229
Recording Sounds 230
Contacts and Appointments 233
Contacts 233
Appointments 238
Alarms and Reminders 240
Creating an Alarm 242
Creating a Reminder 244
Accessing Existing Notifications 245
Using Tasks 246
Launchers 248
Choosers 257
Media and Picture Hubs 266
Accessing Music 266
Playing Music 268
Accessing Pictures 270
Storing Pictures 272
Integrating into the Pictures Hub 274
Integrating into the Music+Videos Hub 276
Working with the Camera 280
Using the PhotoCamera Class 280
Raw Hardware Access 284
The Clipboard API 287
Live Tiles 288
Main Live Tile 289
Secondary Tiles 290
Dual-Sided Live Tiles 292
Location APIs 293
Location Permission 293
Accessing Location Information 294
Emulating Location Information 300
Where Are We? 303
xiv Contents
8 Databases and Storage 305
Storing Data 305
Isolated Storage 306
Serialization 308
Local Databases 314
Getting Started 314
Optimizing the Context Class 320
Associations 324
Using an Existing Database 330
Schema Updates 332
Database Security 334
Where Are We? 335
9 Multitasking 337
Multitasking 337
Background Agents 338
Periodic Agent 340
Resource-Intensive Agent 348
Audio Agent 350
Background Transfer Service 360
Requirements and Limitations 360
Requesting Transfers 362
Monitoring Requests 363
Where Are We? 368
10 Services 369
The Network Stack 370
The WebClient Class 370
Accessing Network Information 373
Consuming JSON 376
Using JSON Serialization 377
Parsing JSON 379
Web Services 383
Consuming OData 387
How OData Works 388
xv
Contents
The URI 389
Using OData on the Phone 398
Generating a Service Reference for OData 398
Retrieving Data 399
Updating Data 401
Using Push Notifications 403
Push Notification Requirements 404
Preparing the Application for Push Notifications 405
Setting Up the Server for Push Notifications 407
Raw Notifications 410
Sending Toast Notifications 419
Creating Live Tiles 423
Handling Push Notification Errors 427
Where Are We? 429
11 The Marketplace 431
What Is the Marketplace? 431
How It Works 432
Charging for Apps 435
Getting Paid 438
Submitting Your App 439
Preparing Your Application 439
The Submission Process 445
After the Submission 451
Modifying Your Application 453
Dealing with Failed Submissions 454
Using Ads in Your Apps 457
Where Are We? 458
Index 459
This page intentionally left blank
xvii
Figures
FIGURE 1.1 Windows Phone Start screen 3
FIGURE 1.2 Phone screen real estate 3
FIGURE 1.3 The application bar in action 4
FIGURE 1.4 Panorama application 5
FIGURE 1.5 Last pane of a panorama application 5
FIGURE 1.6 Using Metro chrome, or not 6
FIGURE 1.7 Seven points of input 8
FIGURE 1.8 Metro’s interactive element sizes 10
FIGURE 1.9 Default keyboard 12
FIGURE 1.10 Contextual keyboards 12
FIGURE 1.11 Application lifecycle (tombstoning) 15
FIGURE 1.12 A tile in the hub 17
FIGURE 1.13 Updating tiles 17
FIGURE 1.14 Marketplace application submission process 19
FIGURE 2.1 Microsoft Visual Studio 2010 Express for Windows Phone 28
FIGURE 2.2 New Project dialog 29
FIGURE 2.3 Picking the phone version to target 29
FIGURE 2.4 The Visual Studio user interface 30
FIGURE 2.5 Enabling the toolbar 31
FIGURE 2.6 Using the emulator 31
FIGURE 2.7 The emulator 31
xviii Figures
FIGURE 2.8 Using the Visual Studio XAML design surface 33
FIGURE 2.9 Location of the Properties window 34
FIGURE 2.10 Contents of the Properties window 34
FIGURE 2.11 The changed property 35
FIGURE 2.12 Opening Blend directly in Visual Studio 36
FIGURE 2.13 The Blend user interface 37
FIGURE 2.14 Selecting an object in Blend 38
FIGURE 2.15 Selecting an object to edit in the Properties pane 38
FIGURE 2.16 Updating a property in Blend 39
FIGURE 2.17 Drawing in a container 40
FIGURE 2.18 Rounding the corners 40
FIGURE 2.19 Editing brushes 41
FIGURE 2.20 Picking a color 41
FIGURE 2.21 Inserting a TextBlock 42
FIGURE 2.22 Centering the TextBlock 42
FIGURE 2.23 Changing the text properties 43
FIGURE 2.24 Naming an element in the Properties window 45
FIGURE 2.25 Running the application 46
FIGURE 2.26 Using the Visual Studio debugger 48
FIGURE 2.27 Connected device 49
FIGURE 2.28 Your phone connected to the Zune software 49
FIGURE 2.29 Registering your device 50
FIGURE 2.30 Successfully registered developer phone 51
FIGURE 2.31 Changing the deployment to use a development phone 51
FIGURE 2.32 Running on a device 52
FIGURE 2.33 Dragging the ellipse 55
FIGURE 2.34 The SearchTask in action 57
FIGURE 2.35 Choosing a contact to retrieve an email address via the
EmailAddressChooserTask 59
FIGURE 2.36 Showing the selected email in a MessageBox 59
FIGURE 3.1 Path explained 72
FIGURE 3.2 Image stretching 77
FIGURE 3.3 Transformations in action 78
FIGURE 3.4 Entire container transformed 79
xix
Figures
FIGURE 4.1 TextBox control example 90
FIGURE 4.2 Software input panel (SIP) 92
FIGURE 4.3 Special SIP keys 92
FIGURE 4.4 Long-hold keys 93
FIGURE 4.5 Chat input scope 94
FIGURE 4.6 Simple button with simple content 97
FIGURE 4.7 Button with XAML content 97
FIGURE 4.8 List box 98
FIGURE 4.9 Panorama application 99
FIGURE 4.10 Panorama explained 100
FIGURE 4.11 Landscape sections 101
FIGURE 4.12 Pivot control 103
FIGURE 4.13 Pivot control in action 104
FIGURE 4.14 Looping pivot sections 104
FIGURE 4.15 Simple data binding 105
FIGURE 4.16 Changes in the source 107
FIGURE 4.17 Output window 113
FIGURE 4.18 Binding error shown in the Output window 114
FIGURE 4.19 Conversion error shown in the Output window 114
FIGURE 4.20 TemplatePart attribute 116
FIGURE 4.21 TemplateVisualState attribute 118
FIGURE 4.22 AutoCompleteBox example 120
FIGURE 4.23 ContextMenu example 121
FIGURE 4.24 Date picking user interface 123
FIGURE 4.25 Setting icons as “Content” 124
FIGURE 4.26 Time picking user interface 125
FIGURE 4.27 ListPicker example (closed) 125
FIGURE 4.28 ListPicker example (opened) 126
FIGURE 4.29 ListPicker example (full screen) 126
FIGURE 4.30 LongListSelector with groups 128
FIGURE 4.31 LongListSelector’s pop-up groups 128
FIGURE 4.32 ToggleSwitch example 132
FIGURE 4.33 ToggleSwitch components 132
FIGURE 4.34 ExpanderView in action 133
FIGURE 4.35 PhoneTextBox with the Hint and ActionIcon shown 134
xx Figures
FIGURE 4.36 PhoneTextBox’s length indication support 135
FIGURE 4.37 PhoneTextBox’s AcceptReturn functionality 136
FIGURE 4.38 Buttons in a StackPanel 137
FIGURE 4.39 Buttons in a WrapPanel 137
FIGURE 4.40 Buttons in a vertical WrapPanel 138
FIGURE 5.1 Foursquare.com 140
FIGURE 5.2 Phone-sized app 141
FIGURE 5.3 Panorama application 142
FIGURE 5.4 A sample Foursquare on Windows Phone 142
FIGURE 5.5 Sample application navigation 145
FIGURE 5.6 Single-page Windows Phone application 145
FIGURE 5.7 Sample panorama application 146
FIGURE 5.8 Panorama in the emulator 146
FIGURE 5.9 Pivot example 148
FIGURE 5.10 Pivot pages 149
FIGURE 5.11 Blend New Project dialog 150
FIGURE 5.12 Blend user interface 152
FIGURE 5.13 Blend toolbar 153
FIGURE 5.14 Projects panel 154
FIGURE 5.15 Assets panel 155
FIGURE 5.16 Objects and Timeline panel 155
FIGURE 5.17 Artboard 157
FIGURE 5.18 Item Tools panel 158
FIGURE 5.19 Searching in the Properties panel 159
FIGURE 5.20 Dragging a new control 160
FIGURE 5.21 Margin and alignment layout 160
FIGURE 5.22 Column and row gutters 161
FIGURE 5.23 Splitting the grid into rows 162
FIGURE 5.24 Modifying row/column properties 163
FIGURE 5.25 Sizing across rows 163
FIGURE 5.26 Sizing across rows with RowSpan 164
FIGURE 5.27 Brushes in the Properties panel 164
FIGURE 5.28 Converting a color to a resource 167
FIGURE 5.29 Creating a color resource 168
xxi
Figures
FIGURE 5.30 Applying a color resource 168
FIGURE 5.31 Creating a brush resource 169
FIGURE 5.32 Applying a brush resource 169
FIGURE 5.33 Storyboard basics 169
FIGURE 5.34 Creating a storyboard 170
FIGURE 5.35 Objects and Timeline panel with animation 170
FIGURE 5.36 Picking the animation point 171
FIGURE 5.37 Animation mode on the artboard 171
FIGURE 5.38 The ellipse animated 172
FIGURE 5.39 Animation values in the Objects and Timeline panel 172
FIGURE 5.40 RenderTransform in an animation 173
FIGURE 5.41 Closing a storyboard 173
FIGURE 5.42 Behaviors in the Assets panel 174
FIGURE 5.43 Applying a behavior 175
FIGURE 5.44 Changing behavior properties 175
FIGURE 5.45 Multiple behaviors 176
FIGURE 5.46 ApplicationBar explained 177
FIGURE 5.47 Adding an ApplicationBar 178
FIGURE 5.48 Adding items to the ApplicationBar 178
FIGURE 5.49 Selecting a built-in icon for an ApplicationBar icon 179
FIGURE 5.50 New panorama application 180
FIGURE 5.51 PanoramaItems in the Objects and Timeline panel 180
FIGURE 5.52 Panorama control user interface 181
FIGURE 5.53 PanoramaItem selection 181
FIGURE 5.54 Adding a PanoramaItem 182
FIGURE 5.55 Creating a pivot application 183
FIGURE 5.56 A pivot application 183
FIGURE 5.57 Pivot control user interface 184
FIGURE 5.58 Editing a PivotItem 184
FIGURE 5.59 Changing device properties 185
FIGURE 6.1 Important files in a new project 188
FIGURE 6.2 Page navigation explained 191
FIGURE 6.3 URI mapping to the files in the project 192
FIGURE 6.4 How tombstoning works 196
xxii Figures
FIGURE 6.5 Portrait orientation 201
FIGURE 6.6 Landscape left orientation 201
FIGURE 6.7 Landscape right orientation 202
FIGURE 6.8 Application client area 212
FIGURE 6.9 Untilted 216
FIGURE 6.10 Tilted 216
FIGURE 7.1 Accelerometer axes 221
FIGURE 7.2 Showing the Accelerometer window in the emulator 224
FIGURE 7.3 The Accelerometer window 225
FIGURE 7.4 An alarm 240
FIGURE 7.5 A reminder 241
FIGURE 7.6 Stacked notifications 242
FIGURE 7.7 Media player controls 253
FIGURE 7.8 PhoneCallTask confirmation 255
FIGURE 7.9 Allowing photo cropping 262
FIGURE 7.10 Music library objects 267
FIGURE 7.11 Displaying the albums and pictures 272
FIGURE 7.12 The apps in the Pictures hub 274
FIGURE 7.13 Tile layers 288
FIGURE 7.14 Opening the emulator’s Additional Tools sidebar 300
FIGURE 7.15 Selecting the Location tab 301
FIGURE 7.16 Location tab of the Additional Tools dialog 301
FIGURE 7.17 Using pins to create waypoints 302
FIGURE 7.18 Saving recorded data 302
FIGURE 8.1 The SQL query 319
FIGURE 8.2 SQL Server Compact Edition database as Content 330
FIGURE 9.1 Relationship between application and scheduled task 339
FIGURE 9.2 Adding a new Scheduled Task Agent project 341
FIGURE 9.3 Picking the Windows Phone Scheduled Task Agent 341
FIGURE 9.4 Adding a reference to the Scheduled Task Agent project 344
FIGURE 9.5 The PeriodicTask’s description in the management user
interface 346
xxiii
Figures
FIGURE 9.6 The Universal Volume Control (UVC) in action 351
FIGURE 9.7 Adding an audio agent to your project 352
FIGURE 9.8 Making a reference to the audio agent project 353
FIGURE 10.1 Adding a service reference 383
FIGURE 10.2 The Add Service Reference dialog 384
FIGURE 10.3 Service files displayed 385
FIGURE 10.4 Adding a service reference to an OData feed 399
FIGURE 10.5 Adding a using statement to the data service 400
FIGURE 10.6 Push notification message flow 404
FIGURE 10.7 Debugging push notifications 420
FIGURE 10.8 A toast message 420
FIGURE 10.9 Tile layers 424
FIGURE 11.1 The Marketplace 432
FIGURE 11.2 The Marketplace in Zune 432
FIGURE 11.3 Submission process 433
FIGURE 11.4 The App Hub 434
FIGURE 11.5 Capability detection results 442
FIGURE 11.6 Works in the dark theme 444
FIGURE 11.7 Does not work in the light theme 444
FIGURE 11.8 Accessing your “dashboard” 445
FIGURE 11.9 Starting the submission process 446
FIGURE 11.10 Step 1 of the submission process 446
FIGURE 11.11 Filling in the descriptive fields 448
FIGURE 11.12 Pricing your app 449
FIGURE 11.13 Publish and testing options 450
FIGURE 11.14 Submission confirmation 450
FIGURE 11.15 Application lifecycle page 451
FIGURE 11.16 My Apps page 452
FIGURE 11.17 Deep link 453
FIGURE 11.18 Application actions 454
FIGURE 11.19 A failure report 455
This page intentionally left blank
xxv
Tables
TABLE 1.1 Integrated Experiences 7
TABLE 1.2 Hardware Specifications 8
TABLE 1.3 Hardware Inputs 9
TABLE 1.4 Sample Keyboard Layouts 13
TABLE 1.5 Sensors 13
TABLE 1.6 Microsoft Phone Services 16
TABLE 2.1 Windows Phone Developer Tools Requirements 26
TABLE 3.1 Visual Containers 67
TABLE 3.2 Grid Row and Column Sizing 69
TABLE 3.3 Brush Types 73
TABLE 3.4 Transformation Types 79
TABLE 4.1 Common InputScope Values 94
TABLE 4.2 RichTextBox Markup Tags 96
TABLE 4.3 Data Binding Modes 107
TABLE 5.1 New Project Types in Blend 151
TABLE 5.2 Row/Column Sizing Icons 162
TABLE 5.3 Brush Editors 165
TABLE 5.4 Blend Behaviors 174
xxvi Tables
TABLE 6.1 Manipulation Events 207
TABLE 6.2 UIElement Touch Events 211
TABLE 7.1 FilterKind Enumeration 234
TABLE 7.2 Launchers 246
TABLE 7.3 Choosers 247
TABLE 7.4 MediaPlaybackControls Enumeration 253
TABLE 9.1 Scheduled Task Limitations 340
TABLE 10.1 OData HTTP Verb Mappings 388
TABLE 10.2 OData Query Options 391
TABLE 10.3 $filter Operators 393
TABLE 10.4 $filter Functions 394
TABLE 10.5 Push Notification Response Headers 414
TABLE 10.6 Response Codes and Header Status Codes 415
TABLE 10.7 ChannelErrorType Enumeration 429
TABLE 10.8 ChannelPowerLevel Enumeration 429
TABLE 11.1 International Pricing Example 436
TABLE 11.2 Application Images 443
TABLE 11.3 Advertising Vendors for the Phone 457
xxvii
Foreword
When Shawn asked me to write a foreword for his Windows Phone devel-
opment book, I had a couple of reactions. First, that they must really be
scraping the bottom of the barrel if they have asked me to write anything.
There are so many people who actually help bring the product to market
who never really get the credit they deserve. While I am honored that I
was asked to write this, based in part on my public role on the team, the
engineering team that designed and built this amazing product are the real
heroes. The product itself is amazing, but the right application platform,
which enables the amazing Metro apps and games to be built, is a devel-
oper’s playground. I do this to honor them.
My second reaction was to think about the huge value Shawn has in
the Microsoft ecosystem. As an eight-time MVP and Silverlight Insider,
Shawn’s contributions are highly valued both for their content as well as
for their reach. When Shawn speaks, you know that he has the developer
in mind: He is a developer’s developer. Without individuals like Shawn, it
would be tough (if possible at all) for Microsoft to have built our developer
ecosystem over the last three decades. I do this to honor him.
My last reaction was one of panic. I have never written a foreword
before, so I was at a bit of a loss as to what I should say. I figure if you are
buying this book, you did so of your own volition, and not on the strength
of what I have to say here. However, if you are reading the foreword with
xxviii Foreword
an eye toward confirming your belief that Windows Phone is where it’s at,
well, for that I can be accommodating. I do this to honor you.
With the initial release of Windows Phone, and the subsequent pair-
ing with Nokia, Microsoft is investing in building the third ecosystem for
mobile developers. The canvas with which mobile developers can work
on Windows Phone is unlike any other platform, whereby developers can
create simply gorgeous apps with more focus on the user experience than
tinkering with the innards of a convoluted framework. Metro apps come
alive on the screen, and you will be able to build deeply engaging applica-
tions using Live Tiles.
Windows Phone 7.5 is an updated release, codenamed “Mango,” and
carries with it the tagline “Put people first.” We think the same way about
the developer platform. We aim to put developers first. The book you are
holding might be your first step on your journey to building Windows
Phone apps. It may be a refresher course. Either way, with Shawn’s guid-
ance, we know that you will come away from this experience feeling great
about your prospects of building amazing mobile experiences for Windows
Phone, and a firm belief that Microsoft puts the developers first when we
think about Windows Phone. Every developer matters. Every. Single. One.
—Brandon Watson
Microsoft Corporation
xxix
Preface
I have never owned a PalmPilot. But I have owned palmtops and smart-
phones. I dived into writing software for a plethora of different devices but
never got very far. My problem was that the story of getting software onto
the phones was chaotic and I didn’t see how the marketing of software
for phones would lead to a successful product. In the intervening years, I
got distracted by Silverlight and Web development. I didn’t pay attention
as the smartphone revolution happened. I was happily neck-deep in data
binding, business application development, and teaching XAML.
The smartphone revolution clearly started with the iPhone. What I find
interesting is that the iPhone is really about the App Store, not the phone.
It’s a great device, but the App Store is what changed everything, provid-
ing a simple way to publish, market, and monetize applications for these
handheld powerhouses that everyone wanted. Of course, Apple didn’t
mean to do it. When the original iPhone shipped, Apple clearly said that
Safari (its Web browser) was the development environment. With the pres-
sure of its OS X developer community, Apple relented and somewhat acci-
dentally created the app revolution.
When it was clear that I had missed something, I dived headlong into
looking at development for phones again. I had an Android phone at the
time, so that is where I started. Getting up to speed with Eclipse and Java
wasn’t too hard, but developing for the phone was still a bit of a chore. The
development tools just didn’t seem to be as easy as the development I was
xxx Preface
used to with Visual Studio and Blend. In this same time frame, I grabbed
a Mac and tried my hand at Objective-C and Xcode to write something
simple for the iPhone. That experience left me bloodied and bandaged. I
wanted to write apps, but since it was a side effort, the friction of the tool
sets for Android and iPhone left me wanting, and I put them aside.
Soon after my experience with iPhone and Android, Microsoft took
the covers off its new phone platform: Windows Phone 7. For me, the real
excitement was the development experience. At that point I’d been teach-
ing and writing about Silverlight since it was called WPF/E, so the ability
to marry my interest in mobile development to my Silverlight knowledge
seemed like a perfect match.
I’ve enjoyed taking the desktop/Web Silverlight experience I have and
applying the same concepts to the phone. By being able to use Visual Stu-
dio and Blend to craft beautiful user interface designs and quickly go from
prototype to finished application, I have found that the workflow of using
these tools and XAML makes the path of building my own applications
much easier than on other platforms.
In the middle of this learning process Microsoft continued to mature the
platform by announcing and releasing Windows Phone 7.5 (code-named
Mango). I was left questioning whether to finish my Windows Phone 7
book or rush forward and mold all the new features of Windows Phone
7.5 into a book for this next version of the phone. Obviously you know the
answer to that question.
It has been a long road to get the right story for this book, and to help
both beginners and existing Silverlight developers to learn from the book.
My goal was always to allow readers to get started writing apps quickly,
while also including the information that leads to great apps. Because of
the relative size of these minicomputers we keep in our pockets, knowing
when to pull back is often the key to a great application. As you will see
throughout this book, my goal has been to help you build great apps, not
rich applications. This means I will try to hold your hand as you read the
book, but I will also challenge your assumptions about how you approach
the process of building applications for the phone.
xxxi
Acknowledgments
Writing a book is a team sport. Anyone who thinks for a moment that writ-
ing a book requires that you sit in a dark room and craft words that magi-
cally get bound into Amazon currency hasn’t been through the sausage
factory that is book writing. The fact is that I may have the skills to get words
down on virtual paper, but I am not good at much of the rest of the process.
It takes a strong editor who knows how to dole out praise and pressure in
equal amounts. It takes technical reviewers who aren’t afraid to ruffle your
feathers. It takes production people to take the mess of Visio ramblings
you call figures and create something the reader will understand. Finally,
it takes an army of people to listen to your questions about the ambiguity
of writing a book based on a beta version of a product . . . and who will not
stop responding to your constant pestering. So I’d like to thank my army of
people by acknowledging their real contributions (in no particular order).
First and foremost, I want to thank my editor at Addison-Wesley, Joan
Murray. I am not an easy author to work with, and she’s been a trouper in
getting me to stick to deadlines and coercing me to make the right deci-
sions, not just the easy ones. The rest of the people at Addison-Wesley
that I’ve had the pleasure to work with are all great, too. Of special note,
Christopher Cleveland did a great job picking up the role of developmen-
tal editor in the middle of the book, and has been great through the whole
process.
xxxii Acknowledgments
To the litany of people on the Silverlight Insiders Mailing List and the
Windows Phone 7 Advisors Mailing List, I would like to thank you for
your patience as I pestered the lists with endless questions and hyperbolic
rants. You all helped shape this book, even if you didn’t realize it.
During this process, my blog’s readers and my followers on Facebook
and Twitter remained a consistent sounding board. My polls and open
questions helped me shape what is and isn’t in this book. For that I am
indebted to you.
I also want to thank my terrific technical reviewers, Jeremy Likeness,
Ambrose Little, and Bruce Little. Not only did they help me find the tons
of places I just plain got it wrong, but they also helped me when the story
got off track and I missed that key piece of the puzzle. Of particular note, I
want to thank Ambrose for his tenacious adherence to the designer’s voice.
He helped me make sure I wasn’t coddling the developers into bad user
experience design.
To anyone else I forgot to mention, I apologize.
—Shawn Wildermuth
November 2011
http://wildermuth.com
@shawnwildermuth
xxxiii
About the Author
During his twenty-five years in software development, Shawn Wilder-
muth has experienced a litany of shifts in software development. These
shifts have shaped how he understands technology. Shawn is a nine-time
Microsoft MVP, a member of the INETA Speaker’s Bureau, and an author
of several books on .NET. He is also involved with Microsoft as a Silver-
light Insider and a Data Insider. He has spoken at a variety of interna-
tional conferences, including TechEd, MIX, VSLive, OreDev, SDC, WinDev,
DevTeach, DevConnections, and DevReach. He has written dozens of arti-
cles for a variety of magazines and websites including MSDN, DevSource,
InformIT, CoDe Magazine, ServerSide.NET, and MSDN Online. He is cur-
rently teaching workshops around the United States through his training
company, AgiliTrain (http://agilitrain.com).
This page intentionally left blank
1
1
Introducing Windows Phone
T
o some, the cell phone is an annoying necessity; to others, it’s a
critical need. Being able to use a phone to make calls everywhere
has really changed the way people communicate. In the past few
years these phones have taken another leap forward. With the introduc-
tion of iPhone and Android devices, the consumer market for an always-
connected device that can interact with the Internet, run applications, and
make phone calls has changed people’s relationship with their phone. It
has also raised the bar for consumer-level devices. Consumers now expect
their phones to also function as GPSs, gaming devices, and Internet tablets.
For some consumers, their phones are now their primary connections to
the Internet, replacing the desktop/laptop computer for the first time. As
developers, our challenge is to find the best way to create the experiences
the user needs. Windows Phone provides the platform, and Silverlight is
the engine to power those experiences.
A Different Kind of Phone
When Microsoft originally unveiled Windows Phone 7 many skeptics
expected the phone would simply try to play catch-up with Apple’s and
Google’s offerings. Microsoft had other plans, though. The new operating
system for the phone was a departure from existing offerings from the other
mobile operating system vendors (primarily Apple, Research in Motion,
2 Chapter 1: Introducing Windows Phone
and Google). Instead of just mimicking the icon pattern screens that iPhone
and Android seemed to love, Microsoft thought in a different way. Applica-
tion and operating system design is defined in a new design language code-
named Metro.1
This design language defines a set of guidelines and styles
for creating Windows Phone applications. The design of the Start screen
laid out by Metro is similar to other smartphone designs in that it is a list of
icons. Instead of separating the icons into pages, Windows Phone lets users
scroll through the icons. Windows Phone is also differentiated from other
smartphones in that each icon can include information about the applica-
tion. These icons are called Live Tiles, as shown in Figure 1.1.
What Is a Design Language?
Developers think about a language as a set of textual expressions that
describe some machine operation(s). For designers, it is a set of rules for
defining the look and feel of a set of applications (or an entire operating
system in this case). Wikipedia.org defines it more generally as “. . . an
overarching scheme or style that guides the design of a complement of
products or architectural settings.”
The Start screen should be a place where users can quickly review the
status of the phone. The Live Tiles will give user information such as the
number of missed phone calls and the number of email or SMS messages
waiting, or even third-party information such as the current weather.
When you develop your own applications you can either create a simple
icon for the Start screen or build a Live Tile for your users.
For applications, the Windows Phone screen is divided into three areas
in which the user can interact with the phone: the system tray, the logical
client, and the application bar (see Figure 1.2).
The system tray area is managed by the phone’s operating system.
This is where the time, signal strength, and alerts will appear to the user.
Most applications will leave this area of the screen visible to the user. Some
1. UIDesignandInteractionGuideforWindowsPhone:http://shawnw.me/wpmetroguide
3
A Different Kind of Phone
FIGURE 1.1 Windows Phone Start screen
FIGURE 1.2 Phone screen real estate
4 Chapter 1: Introducing Windows Phone
applications (e.g., games) may hide this area, but you should only do so
when critical to the success of your application.
The logical client area is where your application will exist. This area
shows your user interface and any data and points of interaction.
The application bar shows options for your application. While using
the application bar is not a requirement, it is a very common practice as it
gives users access to your application’s options and menus. For example,
Figure 1.3 shows a simple note-taking application that uses the applica-
tion bar to allow users to create new notes or show the menu (note that the
ellipsis can be clicked to open the list of menu items).
One big distinction that users will see in many of the applications built
into Windows Phone is the use of hubs. The central idea of a hub is to pro-
vide a starting point to get the user to use natural curiosity to learn what is
available in the application. Usually these hubs take the form of applica-
tions that are larger than the phone screen. Instead of the typical page-based
FIGURE 1.3 The application bar in action
5
A Different Kind of Phone
applications that are fairly commonplace on smartphones, the Metro style
guide introduces something called a panorama application. For panorama
applications the phone is used as a window that looks into a larger applica-
tion surface. You’ll notice in Figure 1.4 that the content of the screen takes
up most of the horizontal real estate, but the next section of the panorama
application shows up on the right side of the screen to help the user under-
stand that there is more content.
As the user navigates through the panorama application, the virtual
space is moved within the window. For example, in Figure 1.5 you can see
how, after sliding the application to the left, the rightmost part of the pano-
rama becomes visible.
FIGURE 1.4 Panorama application
FIGURE 1.5 Last pane of a panorama application
6 Chapter 1: Introducing Windows Phone
The use of the panorama application results in a simple but powerful
user interface design that users should find very intuitive.
By following the guidelines specified by Metro, you can create applica-
tions that should be consistent with the rest of the phone, while giving you
the freedom to create applications of any kind. In this way, Metro helps by
defining basic ideas of how a Windows Phone application should look so
that the user can see complete consistency. At the same time, Metro says
you can simply take over the entire user interface and not use the basic
ideas of the Metro chrome, leaving you the flexibility to create either cus-
tom experiences or applications that look like they belong on the phone.
Figure 1.6 shows example apps with and without the chrome applied.
Integrated Experiences
One of the main purposes of the phone is to be an integrated platform on
which applications can interact with each other and with the core phone
experiences. This means you can write applications that integrate with the
phone in unprecedented ways. Table 1.1 outlines some of the core experi-
ences users will be able to interact with and use on the phone.
FIGURE 1.6 Using Metro chrome, or not
7
Phone Specifications
As developers, your code might or might not look like the code in tra-
ditional applications. Because you can write straightforward applications
that can be launched in a traditional sense, the integrated experiences let
your applications also interact with and even be embedded into these
experiences. This means you can write applications that extend and power
these experiences.
Phone Specifications
For Windows Phone, the stakes were high in terms of Microsoft’s ability
to not only create the software but also encourage its partners to build the
phone. Learning a lesson from its past Windows Mobile platform, Micro-
soft decided to be very specific about the hardware to ensure a great user
experience while giving phone designers some flexibility with feature sets
so that they could compete with one another. Table 1.2 shows the hardware
requirements.
In addition, Windows Phone has physical requirements. The most obvi-
ous of these is that each phone must have seven standard inputs, as shown
in Figure 1.7.
Table 1.3 lists and describes these seven hardware inputs.
TABLE 1.1 Integrated Experiences
Experience Description
People The people on your phone, including contacts and past phone
calls/SMS messages
Office Integration with email, Word, Excel, and PowerPoint files
Music+Videos The media on your device
Marketplace Access to try, buy, and install applications on the phone
Pictures View, share, and take pictures on your device
Games Playing games on the device; this includes Xbox Live
integration
8 Chapter 1: Introducing Windows Phone
TABLE 1.2 Hardware Specifications
Category Requirement
Screen resolution WVGA (480 x 800)
Capacitive touch At least four points of touch support
Memory 256MB RAM, 8GB Flash
Sensors A-GPS, Accelerometer, Compass, Light and Proximity, Gyro
CPU ARM7 Scorpion/Cortex or better (typically 1GHz+)
GPU DirectX 9 acceleration
Camera 5 megapixels minimum, flash required
Bluetooth Bluetooth 2.1 + EDR; Bluetooth profiles provided are Hand-Free
Profile (HFP), Headset Profile (HSP), Advanced Audio Distribu-
tion Profile (A2DP), and Phone Book Access Profile (PBAP)
Multimedia Codec acceleration required; support for DivX 4, 5, and 6 as well
as H.264 High Profile required (High Profile is used by Blu-ray)
Wi-Fi 802.11g radio required
Radio FM radio receiver required
FIGURE 1.7 Seven points of input
9
Input Patterns
Now that we have seen what the phone consists of, let’s see how users
will interact with the phone.
Input Patterns
You are the developer. You want users to want to use your applications.
That means you must deal with the different ways the phone can accept
user input. Developing for the Web or desktop means you are primarily
dealing with designing for the keyboard and mouse. But when developing
for the phone, you have to change the way you look at input and consider
that the user is going to interact with your application in different ways.
Interaction patterns for the phone include touch, keyboards (hardware and
software), hardware buttons, and sensors.
TABLE 1.3 Hardware Inputs
Input Expected Behavior
1 Power button When powered off, a long press will power on the device.
If powered on and screen is active, will turn off screen and
lock device. If screen is off, will enable screen and present
unlock UI.
2 Volume
control
A rocker switch will adjust volume for current activity’s
sound profile (e.g., phone call volume while on a call).
Pressing volume during a phone call will disable the ringer.
Adjusting volume when no activity is presently happening
will allow user to switch between sound profiles.
3 Touch screen The capacitive touch screen will support at least four points
of touch.
4 Camera button A long press on this dedicated button will launch the camera
application.
5 Back button This button issues a “back” operation. This may take the
user back in an individual application or from one applica-
tion to the previous application as presented by the page
API.
6 Start button This takes the user to the Start screen of the device.
7 Search button This launches the search experience to allow searching
across the device.
10 Chapter 1: Introducing Windows Phone
Designing for Touch
The Metro design language is specifically constructed to make sure the
interface is treating touch as a first-class citizen and that the interface
requires no training (i.e., is intuitive). By building a design language that
defines the elements of a touch-based interface, Microsoft has made it eas-
ier to build such interfaces. The design language includes guidelines for
what touch gestures are supported, as well as how to space and size ele-
ments for finger-size interactions. Figure 1.8 shows an example from Metro
to define the minimum sizes for touch points and their spacing.
Metro also defines the types of interactions (e.g., touch gestures) the
device supports. Most of these interactions are well-worn gestures that
have been the vocabulary of other touch devices such as the iPhone, Zune
HD, and Android. These interactions include
• Single touch:
− Tap
− Double-Tap
− Pan
− Flick
− Touch and Hold
• Multitouch:
− Pinch/Stretch/Rotate
2 mm/8 px
Minimum Space
between Touch
Targets
7 mm/26 px
Minimum
Object
Size
9 mm/34 px
Touch Target
FIGURE 1.8 Metro’s interactive element sizes
Random documents with unrelated
content Scribd suggests to you:
moral nature, and to contemplate, as beings existing external to
himself, angels and devils. For, the origin of both representations
remains merely subjective, the angel being simply the ideal of
created perfection: which, as it was formed from the subordinate
point of view of a fanciful imagination, disappears from the higher
and more comprehensive observation of the intellect.18
Olshausen, on the other hand, seeks to deduce a positive argument
in favour of the reality of the apparition in question, from those very
reasonings of the present day which, in fact, negative the existence
of angels; and he does so by viewing the subject on its speculative
side. He is of opinion that the gospel narrative does not contradict
just views of the world, since God is immanent in the universe and
moves it by his breath.19 But if it be true that God is immanent in the
world, precisely on that account is the intervention of angels
superfluous. It is only a Deity who dwells apart, throned in heaven,
who requires to send down his angels to fulfil his purposes on earth.
It would excite surprise to find Olshausen arguing thus, did we not
perceive from the manner in which this interpreter constantly treats
of angelology and demonology, that he does not consider angels to
be independent personal entities; but regards them rather as divine
powers, transitory emanations and fulgurations of the Divine Being.
Thus Olshausen’s conception of angels, in their relation to God,
seems to correspond with the Sabellian doctrine of the Trinity; but as
his is not the representation of the Bible, as also the arguments in
favour of the former prove nothing in relation to the latter, it is
useless to enter into further explanation. The reasoning of this same
theologian, that we must not require the ordinariness of every-day
life for the most pregnant epochs in the life of the human race; that
the incarnation of the eternal word was accompanied by
extraordinary manifestations from the world of spirits, uncalled for in
times less rich in momentous results,20 rests upon a
misapprehension. For the ordinary course of every-day life is
interrupted in such moments, by the very fact that exalted beings
like the Baptist are born into the world, and it would be puerile to
designate as ordinary those times and circumstances which gave
birth and maturity to a John, because they were unembellished by
angelic apparitions. That which the spiritual world does for ours at
such periods is to send extraordinary human intelligences, not to
cause angels to ascend and descend.
Finally, if, in vindication of this narrative, it be stated that such an
exhibition by the angel, of the plan of education for the unborn
child, was necessary in order to make him the man he should
become,21 the assumption includes too much; namely, that all great
men, in order by their education to become such, must have been
introduced into the world in like manner, or cause must be shown
why that which was unnecessary in the case of great men of other
ages and countries was indispensable for the Baptist. Again, the
assumption attaches too much importance to external training, too
little to the internal development of the mind. But in conclusion,
many of the circumstances in the life of the Baptist, instead of
serving to confirm a belief [100]in the truth of the miraculous history,
are on the contrary, as has been justly maintained, altogether
irreconcilable with the supposition, that his birth was attended by
these wonderful occurrences. If it were indeed true, that John was
from the first distinctly and miraculously announced as the
forerunner of the Messiah, it is inconceivable that he should have
had no acquaintance with Jesus prior to his baptism; and that, even
subsequent to that event, he should have felt perplexed concerning
his Messiahship (John i. 30 ; Matt. xi. 2 ).22
Consequently the negative conclusion of the rationalistic criticism
and controversy must, we think, be admitted, namely, that the birth
of the Baptist could not have been preceded and attended by these
supernatural occurrences. The question now arises, what positive
view of the matter is to replace the rejected literal orthodox
explanation?
[Contents]
§ 18.
NATURAL EXPLANATION OF THE NARRATIVE.
In treating the narrative before us according to the rationalistic
method, which requires the separation of the pure fact from the
opinion of interested persons, the simplest alteration is this: to retain
the two leading facts, the apparition and the dumbness, as actual
external occurrences; but to account for them in a natural manner.
This were possible with respect to the apparition, by supposing that
a man, mistaken by Zacharias for a divine messenger, really
appeared to him, and addressed to him the words he believed he
heard. But this explanation, viewed in connexion with the attendant
circumstances, being too improbable, it became necessary to go a
step further, and to transform the event from an external to an
internal one; to remove the occurrence out of the physical into the
psychological world. To this view the opinion of Bahrdt, that a flash
of lightning was perhaps mistaken by Zacharias for an angel,23 forms
a transition; since he attributes the greater part of the scene to
Zacharias’s imagination. But that any man, in an ordinary state of
mind, could have created so long and consecutive a dialogue out of
a flash of lightning is incredible. A peculiar mental state must be
supposed; whether it be a swoon, the effect of fright occasioned by
the lightning,24 but of this there is no trace in the text (no falling
down as in Acts ix. 4 ); or, abandoning the notion of the lightning, a
dream, which, however, could scarcely occur whilst burning incense
in the temple. Hence, it has been found necessary, with Paulus, to
call to mind that there are waking visions or ecstasies, in which the
imagination confounds internal images with external occurrences.25
Such ecstasies, it is true, are not common; but, says Paulus, in
Zacharias’s case many circumstances combined to produce so
unusual a state of mind. The exciting causes were, firstly, the long-
cherished desire to have a posterity; secondly, the exalted vocation
of administering in the Holy of Holies, offering up with the incense
the prayers of the people to the throne of Jehovah, which seemed to
Zacharias to foretoken the acceptance of his own prayer; and thirdly,
perhaps an exhortation from his wife as he left his house, similar to
that of Rachel to Jacob. Gen. xxx. 1 (!) In [101]this highly excited
state of mind, as he prays in the dimly-lighted sanctuary, he thinks
of his most ardent wish, and expecting that now or never his prayer
shall be heard, he is prepared to discern a sign of its acceptance in
the slightest occurrence. As the glimmer of the lamps falls upon the
ascending cloud of incense, and shapes it into varying forms, the
priest imagines he perceives the figure of an angel. The apparition at
first alarms him; but he soon regards it as an assurance from God
that his prayer is heard. No sooner does a transient doubt cross his
mind, than the sensitively pious priest looks upon himself as sinful,
believes himself reproved by the angel, and—here two explanations
are possible—either an apoplectic seizure actually deprives him of
speech, which he receives as the just punishment of his incredulity,
till the excessive joy he experiences at the circumcision of his son
restores the power of utterance: so that the dumbness is retained as
an external, physical, though not miraculous, occurrence;26 or the
proceeding is psychologically understood, namely, that Zacharias, in
accordance with a Jewish superstition, for a time denied himself the
use of the offending member.27 Reanimated in other respects by the
extraordinary event, the priest returns home to his wife, and she
becomes a second Sarah.
With regard to this account of the angelic apparition given by Paulus,
—and the other explanations are either of essentially similar
character, or are so manifestly untenable, as not to need refutation—
it may be observed that the object so laboriously striven after is not
attained. Paulus fails to free the narrative of the marvellous; for by
his own admission, the majority of men have no experience of the
kind of vision here supposed.28 If such a state of ecstasy occur in
particular cases, it must result either from a predisposition in the
individual, of which we find no sign in Zacharias, and which his
advanced age must have rendered highly improbable; or it must
have been induced by some peculiar circumstances, which totally fail
in the present instance.29 A hope which has been long indulged is
inadequate to the production of ecstatic vehemence, and the act of
burning incense is insufficient to cause so extraordinary an
excitement, in a priest who has grown old in the service of the
temple. Thus Paulus has in fact substituted a miracle of chance for a
miracle of God. Should it be said that to God nothing is impossible,
or to chance nothing is impossible, both explanations are equally
precarious and unscientific.
Indeed, the dumbness of Zacharias as explained from this point of
view is very unsatisfactory. For had it been, as according to one
explanation, the result of apoplexy; admitting Paulus’s reference to
Lev. xxi. 16 , to be set aside by the contrary remark of Lightfoot,30
still, we must join with Schleiermacher in wondering how Zacharias,
notwithstanding this apoplectic seizure, returned home in other
respects healthy and vigorous;31 and that in spite of partial paralysis
his general strength was unimpaired, and his long-cherished hope
fulfilled. It must also be regarded as a strange coincidence, that the
father’s tongue should have been loosed exactly at the time of the
circumcision; for if the recovery of speech is to be considered as the
effect of joy,32 surely the father must have been far more elated at
the birth of the [102]earnestly-desired son, than at the circumcision;
for by that time he would have become accustomed to the
possession of his child.
The other explanation: that Zacharias’s silence was not from any
physical impediment, but from a notion, to be psychologically
explained, that he ought not to speak, is in direct contradiction to
the words of Luke. What do all the passages, collected by Paulus to
show that οὐ δύναμαι may signify not only a positive non posse, but
likewise a mere non sustinere,33 prove against the clear meaning of
the passage and its context? If perhaps the narrative phrase (v.
22 ), οὐκ ἠδύνατο λαλῆσαι αὐτοῖς might be forced to bear this
sense, yet certainly in the supposed vision of Zacharias, had the
angel only forbidden him to speak, instead of depriving him of the
power of speech, he would not have said: καὶ ἔσῃ σιωπῶν, μὴ
δυνάμενος λαλῆσαι, but ἴσθι σιωπῶν, μηδ’ ἐπιχειρήσῃς λαλῆσαι. The
words διέμενε κωφὸς (v. 21 ) also most naturally mean actual
dumbness. This view assumes, and indeed necessarily so, that the
gospel history is a correct report of the account given by Zacharias
himself; if then it be denied that the dumbness was actual, as
Zacharias affirms that actual dumbness was announced to him by
the angel, it must be admitted that, though perfectly able to speak,
he believed himself to be dumb, which leads to the conclusion that
he was mad: an imputation not to be laid upon the father of the
Baptist without compulsory evidence in the text.
Again, the natural explanation makes too light of the incredibly
accurate fulfilment of a prediction originating, as it supposes, in an
unnatural, over-excited state of mind. In no other province of inquiry
would the realization of a prediction which owed its birth to a vision
be found credible, even by the Rationalist. If Dr. Paulus were to read
that a somnambulist, in a state of ecstasy, had foretold the birth of a
child, under circumstances in the highest degree improbable; and
not only of a child, but of a boy; and had moreover, with accurate
minuteness, predicted his future mode of life, character, and position
in history; and that each particular had been exactly verified by the
result: would he find such a coincidence credible? Most assuredly to
no human being, under any conditions whatsoever, would he
concede the power thus to penetrate the most mysterious workings
of nature; on the contrary he would complain of the outrage on
human free-will, which is annihilated by the admission that a man’s
entire intellectual and moral development may be predetermined like
the movements of a clock. And he would on this very ground
complain of the inaccuracy of observation, and untrustworthiness of
the report which represented, as matters of fact, things in their very
nature impossible. Why does he not follow the same rule with
respect to the New Testament narrative? Why admit in the one case
what he rejects in the other? Is biblical history to be judged by one
set of laws, and profane history by another?—An assumption which
the Rationalist is compelled to make, if he admits as credible in the
Gospels that which he rejects as unworthy of credit in every other
history—which is in fact to fall back on the supranaturalistic point of
view, since the assumption, that the natural laws which govern in
every other province are not applicable to sacred history, is the very
essential of supranaturalism.
No other rescue from this self-annihilation remains to the anti-
supernatural mode of explanation, than to question the verbal
accuracy of the history. This is the simplest expedient, felt to be
such by Paulus himself, who remarks, that his efforts may be
deemed superfluous to give a natural explanation of a narrative,
which is nothing more than one of those stories invented either after
the death or even during the lifetime of every distinguished man to
embellish [103]his early history. Paulus, however, after an impartial
examination, is of opinion that the analogy, in the present instance,
is not applicable. The principal ground for this opinion is the too
short interval between the birth of the Baptist, and the composition
of the Gospel of Luke.34 We, on the contrary, in harmony with the
observations in the introduction, would reverse the question and
inquire of this interpreter, how he would render it credible, that the
history of the birth of a man so famed as the Baptist should have
been transmitted, in an age of great excitement, through a period of
more than sixty years, in all its primitive accuracy of detail? Paulus’s
answer is ready: an answer approved by others (Heidenreich,
Olshausen):—the passage inserted by Luke i. 5 ; ii. 39 was
possibly a family record, which circulated among the relatives of the
Baptist and of Jesus; and of which Zacharias was probably the
author.35
K. Ch. L. Schmidt controverts this hypothesis with the remark, that it
is impossible that a narrative so disfigured (we should rather say, so
embellished) could have been a family record; and that, if it does
not belong altogether to the class of legends, its historical basis, if
such there be, is no longer to be distinguished.36 It is further
maintained, that the narrative presents certain features which no
poet would have conceived, and which prove it to be a direct
impression of facts; for instance, the Messianic expectations
expressed by the different personages introduced by Luke (chap. i.
and ii.) correspond exactly with the situation and relation of each
individual.37 But these distinctions are by no means so striking as
Paulus represents; they are only the characteristics of a history
which goes into details, making a transition from generalities to
particulars, which is natural alike to the poet and to the popular
legend; besides, the peculiar Judaical phraseology in which the
Messianic expectations are expressed, and which it is contended
confirm the opinion that this narrative was written, or received its
fixed form, before the death of Jesus, continued to be used after
that event Acts i. 6 38. Moreover we must agree with
Schleiermacher when he says:39 least of all is it possible to regard
these utterances as strictly historical; or to maintain that Zacharias,
in the moment that he recovered his speech, employed it in a song
of praise, uninterrupted by the exultation and wonder of the
company, sentiments which the narrator interrupts himself to
indulge. It must, at all events, be admitted that the author has made
additions of his own, and has enriched the history by the lyric
effusions of his muse. Kuinöl supposes that Zacharias composed and
wrote down the canticle subsequent to the occasion; but this strange
surmise contradicts the text. There are some other features which, it
is contended, belong not to the creations of the poet; such as, the
signs made to the father, the debate in the family, the position of the
angel on the right hand of the altar.40 But this criticism is merely a
proof that these interpreters have, or determine to have, no just
conception of poetry or popular legend; for the genuine
characteristic of poetry and mythus is natural and pictorial
representation of details.41 [104]
[Contents]
§ 19.
MYTHICAL VIEW OF THE NARRATIVE IN ITS
DIFFERENT STAGES.
The above exposition of the necessity, and lastly, of the possibility of
doubting the historical fidelity of the gospel narrative, has led many
theologians to explain the account of the birth of the Baptist as a
poetical composition; suggested by the importance attributed by the
Christians to the forerunner of Jesus, and by the recollection of
some of the Old Testament histories, in which the births of Ishmael,
Isaac, Samuel, and especially of Samson, are related to have been
similarly announced. Still the matter was not allowed to be
altogether invented. It may have been historically true that Zacharias
and Elizabeth lived long without offspring; that, on one occasion
whilst in the temple, the old man’s tongue was suddenly paralyzed;
but that soon afterwards his aged wife bore him a son, and he, in
his joy at the event, recovered the power of speech. At that time,
but still more when John became a remarkable man, the history
excited attention, and out of it the existing legend grew.42
It is surprising to find an explanation almost identical with the
natural one we have criticised above, again brought forward under a
new title; so that the admission of the possibility of an admixture of
subsequent legends in the narrative has little influence on the view
of the matter itself. As the mode of explanation we are now
advocating denies all confidence in the historical authenticity of the
record, all the details must be in themselves equally problematic;
and whether historical validity can be retained for this or that
particular incident, can be determined only by its being either less
improbable than the rest, or else less in harmony with the spirit,
interest, and design of the poetic legend, so as to make it probable
that it had a distinct origin. The barrenness of Elizabeth and the
sudden dumbness of Zacharias are here retained as incidents of this
character: so that only the appearing and prediction of the angel are
given up. But by taking away the angelic apparition, the sudden
infliction and as sudden removal of the dumbness loses its only
adequate supernatural cause, so that all difficulties which beset the
natural interpretation remain in full force: a dilemma into which
these theologians are, most unnecessarily, brought by their own
inconsequence; for the moment we enter upon mythical ground, all
obligation to hold fast the assumed historical fidelity of the account
ceases to exist. Besides, that which they propose to retain as
historical fact, namely, the long barrenness of the parents of the
Baptist, is so strictly in harmony with the spirit and character of
Hebrew legendary poetry, that of this incident the mythical origin is
least to be mistaken. How confused has this misapprehension made,
for example, the reasoning of Bauer! It was a prevailing opinion,
says he, consonant with Jewish ideas, that all children born of aged
parents, who had previously been childless, became distinguished
personages. John was the child of aged parents, and became a
notable preacher of repentance; consequently it was thought
justifiable to infer that his birth was predicted by an angel. What an
illogical conclusion! for which he has no other ground than the
assumption that John was the son of aged parents. Let this be made
a settled point, and the conclusion follows without difficulty. It was
readily believed, he proceeds, of remarkable men that they were
born of aged parents, and that their birth, no longer in the ordinary
course of nature to be expected, was announced [105]by a heavenly
messenger43; John was a great man and a prophet; consequently,
the legend represented him to have been born of an aged couple,
and his birth to have been proclaimed by an angel.
Seeing that this explanation of the narrative before us, as a half (so
called historical) mythus, is encumbered with all the difficulties of a
half measure, Gabler has treated it as a pure philosophical, or
dogmatical mythus.44 Horst likewise considers it, and indeed the
entire two first chapters of Luke, of which it forms a part, as an
ingenious fiction, in which the birth of the Messiah, together with
that of his precursor, and the predictions concerning the character
and ministry of the latter, framed after the event, are set forth; it
being precisely the loquacious circumstantiality of the narration
which betrays the poet.45 Schleiermacher likewise explains the first
chapter as a little poem, similar in character to many of the Jewish
poems which we meet with in their apocrypha. He does not however
consider it altogether a fabrication. It might have had a foundation
in fact, and in a widespread tradition; but the poet has allowed
himself so full a license in arranging, and combining, in moulding
and embodying the vague and fluctuating representations of
tradition, that the attempt to detect the purely historical in such
narratives, must prove a fruitless and useless effort.46 Horst goes so
far as to suppose the author of the piece to have been a Judaising
Christian; whilst Schleiermacher imagines it to have been composed
by a Christian of the famed Jewish school, at a period when it
comprised some who still continued strict disciples of John; and
whom it was the object of the narrative to bring over to Christianity,
by exhibiting the relationship of John to the Christ as his peculiar
and highest destiny; and also by holding out the expectation of a
state of temporal greatness for the Jewish people at the
reappearance of Christ.
An attentive consideration of the Old Testament histories, to which,
as most interpreters admit, the narrative of the annunciation and
birth of the Baptist bears a striking affinity, will render it abundantly
evident that this is the only just view of the passage in question. But
it must not here be imagined, as is now so readily affirmed in the
confutation of the mythical view of this passage, that the author of
our narrative first made a collection from the Old Testament of its
individual traits; much rather had the scattered traits respecting the
late birth of different distinguished men, as recorded in the Old
Testament, blended themselves into a compound image in the mind
of their reader, whence he selected the features most appropriate to
his present subject. Of the children born of aged parents, Isaac is
the most ancient prototype. As it is said of Zacharias and Elizabeth,
“they both were advanced in their days” (v. 7 ) προβεβηκότες ἐν
ταῖς ἡμέραις αὐτῶν, so Abraham and Sarah “were advanced in their
days” ‫ַּבָיִמים‬ ‫‏ָּבִאים‬
‎(Gen. xviii. 11 ; LXX: προβεβηκότες ἡμερῶν),
when they were promised a son. It is likewise from this history that
the incredulity of the father, on account of the advanced age of both
[106]parents, and the demand of a sign, are borrowed in our
narrative. As Abraham, when Jehovah promises him he shall have a
son and a numerous posterity who shall inherit the land of Canaan,
doubtingly inquires, “Whereby shall I know that I shall inherit it?”
κατὰ τί γνώσομαι, ὄτι κληρονομήσω αὐτήν; (sc. τὴν γῆν. Gen. xv.
8 . LXX.): so Zacharias—“Whereby shall I know this?” κατὰ τί
γνώσομαι τοῦτο; (v. 18 .) The incredulity of Sarah is not made use
of for Elizabeth; but she is said to be of the daughters of Aaron, and
the name Elizabeth may perhaps have been suggested by that of
Aaron’s wife (Exod. vi. 23 . LXX.). The incident of the angel
announcing the birth of the Baptist is taken from the history of
another late-born child, Samson. In our narrative, indeed, the angel
appears first to the father in the temple, whereas in the history of
Samson he shows himself first to the mother, and afterwards to the
father in the field. This, however, is an alteration arising naturally out
of the different situations of the respective parents (Judges xiii .).
According to popular Jewish notions, it was no unusual occurrence
for the priest to be visited by angels and divine apparitions whilst
offering incense in the temple.47 The command which before his
birth predestined the Baptist—whose later ascetic mode of life was
known—to be a Nazarite, is taken from the same source. As, to
Samson’s mother during her pregnancy, wine, strong drink, and
unclean food, were forbidden, so a similar diet is prescribed for her
son,48 adding, as in the case of John, that the child shall be
consecrated to God from the womb.49 The blessings which it is
predicted that these two men shall realize for the people of Israel
are similar (comp. Luke i. 16, 17 , with Judges xiii. 5 ), and each
narrative concludes with the same expression respecting the hopeful
growth of the child.50 It may be too bold to derive the Levitical
descent of the Baptist from a third Old Testament history of a late-
born son—from the history of Samuel (compare 1 Sam. i. 1 ; Chron.
vii. 27 ); but the lyric effusions in the first chapter of Luke are
imitations of this history. As Samuel’s mother, when consigning him
to the care of the high priest, breaks forth into a hymn (1 Sam. ii.
1 ), so the father of John does the same at the circumcision; though
the particular expressions in the Canticle uttered by Mary—of which
we shall have to speak hereafter—have a closer resemblance to
Hannah’s song of praise than that of Zacharias. The significant
appellation John (‫‏ְיהֹוָחָנן‬
‎= Θεόχαρις), predetermined by the angel,
had its precedent in the announcements of the names of Ishmael
and Isaac51; but the ground of its selection was the apparently
providential coincidence between the signification of the name and
the historical destination of the man. The [107]remark, that the name
of John was not in the family (v. 61 ), only brought its celestial
origin more fully into view. The tablet (πινακίδιον) upon which the
father wrote the name (v. 63 ), was necessary on account of his
incapacity to speak; but it also had its type in the Old Testament.
Isaiah was commanded to write the significant names of the child
Maher-shalal-hash-baz upon a tablet (Isaiah viii. 1 ff. ). The only
supernatural incident of the narrative, of which the Old Testament
may seem to offer no precise analogy, is the dumbness; and this is
the point fixed upon by those who contest the mythical view.52 But if
it be borne in mind that the asking and receiving a sign from heaven
in confirmation of a promise or prophecy was usual among the
Hebrews (comp. Isaiah vii. 11 ff. ); that the temporary loss of one
of the senses was the peculiar punishment inflicted after a heavenly
vision (Acts ix. 8 , 17 ff. ); that Daniel became dumb whilst the
angel was talking with him, and did not recover his speech till the
angel had touched his lips and opened his mouth (Dan. x. 15 f. ):
the origin of this incident also will be found in the legend, and not in
historical fact. Of two ordinary and subordinate features of the
narrative, the one, the righteousness of the parents of the Baptist (v.
6 ), is merely a conclusion founded upon the belief that to a pious
couple alone would the blessing of such a son be vouchsafed, and
1
2
3
4
5
6
7
8
consequently is void of all historical worth; the other, the statement
that John was born in the reign of Herod (the Great) (v. 5 ), is
without doubt a correct calculation.
So that we stand here upon purely mythical-poetical ground; the
only historical reality which we can hold fast as positive matter of
fact being this:—the impression made by John the Baptist, by virtue
of his ministry and his relation to Jesus, was so powerful as to lead
to the subsequent glorification of his birth in connection with the
birth of the Messiah in the Christian legend.53 [108]
It may here be observed, once for all, that whenever in the following inquiry
the names “Matthew,” “Luke,” etc., are used, it is the author of the several
Gospels who is thus briefly indicated, quite irrespective of the question whether
either of the Gospels was written by an apostle or disciple of that name, or by a
later unknown author. ↑
See Kuinöl Comm. in Luc., Proleg., p. 247. ↑
Paulus, exeget. Handbuch, 1 a. s. 78 f. 96. Bauer, hebr. Mythol., 2 Bd. s. 218
f. ↑
Here Michael is called one of the chief princes. ↑
Here Raphael is represented as one of the seven angels which go in and out
before the glory of the holy One; (Tobit, xii. 15 ), almost the same as
Gabriel in Luke i. 19 , excepting the mention of the number. This number is in
imitation of the Persian Amschaspands. Vid. De Wette, bibl. Dogmatik, § 171 b. ↑
Hieros. rosch haschanah f. lvi. 4. (Lightfoot, horæ hebr. et talmud. in IV.
Evangg., p. 723): R. Simeon ben Lachisch dicit: nomina angelorum ascenderunt
in manu Israëlis ex Babylone. Nam antea dictum est: advolavit ad me unus τῶν
Seraphim, Seraphim steterunt ante eum, Jes. vi.; at post: vir Gabriel, Dan. ix.
21 , Michaël princeps vester, Dan. x. 21 . ↑
Olshausen, biblischer Commentar zum N.T., 1 Thl. s. 29 (2te Auflage). Comp.
Hoffmann, s. 124 f. ↑
Olshausen, ut sup. Hoffmann, s. 135. ↑
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Ut sup. s. 77. ↑
Geschichte der drei letzten Lebensjahre Jesu, sammt dessen
Jugendgeschichte. Tübingen, 1779. 1 Bd. s. 12. ↑
Bibl. Comm. 1, s. 115. ↑
Hebr. Mythol. ii. s. 218. ↑
Bauer, ut sup. i. s. 129. Paulus, exeget. Handbuch, i. a, 74. ↑
Paulus, Commentar, i. s. 12. ↑
Bauer, ut sup. ↑
Glaubenslehre, 1 Thl. § 42 und 43 (2te Ausgabe). ↑
Binder, Studien der evang. Geistlichkeit Würtembergs, ix. 2, 5.
11 ff. ↑
Compare my Dogmatik, i. § 49. ↑
Bibl. Comm., 1. Thl. s. 119. ↑
Ut sup. s. 92. ↑
Hess, Geschichte der drei letzten Lebensjahre Jesu u. s. w., 1. Thl. s.
13, 33. ↑
Horst in Henke’s Museum, i. 4. s. 733 f. Gabler in seinem neuest. theol. Journal,
vii. 1. s. 403. ↑
Briefe über die Bibel im Volkstone (Ausg. Frankfurt und Leipzig, 1800), 1tes
Bändchen, 6ter Brief, s. 51 f. ↑
Bahrdt, ut sup. s. 52. ↑
Exeget. Handb. 1, a. s. 74 ff. ↑
Bahrdt, ut sup. 7ter Brief, s. 60.—E. F. über die beiden ersten Kapitel des
Matthäus und Lukas, in Henke’s Magazin, v. 1. s. 163. Bauer, hebr.
Mythol. 2, s. 220. ↑
Exeget. Handb. 1, a. s. 77–80. ↑
Ut sup. s. 73. ↑
Comp. Schleiermacher über die Schriften des Lukas, s. 25. ↑
Horæ hebr. et talmud., ed. Carpzov. p. 722. ↑
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Ut sup. s. 26. ↑
Examples borrowed from Aulus Gellius, v. 9, and from Valerius Maximus,
i. 8, are cited. ↑
Ut sup. s. 26. ↑
Ut sup. s. 72 f. ↑
Ut sup. s. 69. ↑
In Schmidt’s Bibliothek für Kritik und Exegese, iii. 1, s. 119. ↑
Paulus, ut sup. ↑
Comp. De Wette, exeg. Handb., 1. 2, s. 9. ↑
Über die Schriften des Lukas, s. 23. ↑
Paulus und Olshausen z. d. St., Heydenreich a. a. O. 1, s.
87. ↑
Comp. Horst, in Henke’s Museum, i. 4, s. 705; Vater, Commentar zum
Pentateuch, 3, s. 597 ff.; Hase L. J., § 35; auch George, s. 33 f. 91. ↑
E. F. über die zwei ersten Kapitel u. s. w. in Henke’s Magazin, v. 1, s. 162 ff.,
und Bauer hebr. Mythol., ii. 220 f. ↑
The adoption of this opinion is best explained by a passage—with respect to
this matter classical—in the Evangelium de nativitate Mariæ, in Fabricius codex
apocryphus N. Ti. 1, p. 22 f., and in Thilo 1, p. 322, “Deus”—it is here said,—cum
alicujus uterum claudit, ad hoc facit, ut mirabilius denuo aperiat, et non libidinis
esse, quod nascitur, sed divini muneris cognoscatur. Prima enim gentis vestræ Sara
mater nonne usque ad octogesimum annum infecunda fuit? et tamen in ultimâ
senectutis ætate genuit Isaac, cui repromissa erat benedictio omnium gentium.
Rachel quoque, tantum Domino grata tantumque a sancto Jacob amata diu sterilis
fuit, et tamen Joseph genuit, non solum dominum Ægypti, sed plurimarum
gentium fame periturarum liberatorem. Quis in ducibus vel fortior Sampsone, vel
sanctior Samuele? et tamen hi ambo steriles matres habuere.—ergo—crede—
dilatos diu conceptus et steriles partus mirabiliores esse solere. ↑
Neuestes theol. Journal, vii. 1, s. 402 f. ↑
In Henke’s Museum, i. 4, s. 702 ff. ↑
46
47
48
49
50
51
Hase in his Leben Jesu makes the same admission; compare § 52 with § 32. ↑
Wetstein zu Luke i. 11 , s. 647 f. adduces passages from Josephus and from
the Rabbins recording apparitions seen by the high priests. How readily it
was presumed that the same thing happened to ordinary priests is apparent from
the narrative before us. ↑
Judges xiii. 14 (LXX.):
καὶ οἶνον καὶ σίκερα (al. μέθυσμα, hebr.
‫‏ֵׁשָכר‬
‎
) μὴ πιέτω.
Luc. i. 15 .:
καὶ οἶνον καὶ σίκερα οὐ μὲ πίῃ.
Judg. xiii. 5 :
ὅτι ἡγιασμένον ἔσται τῷ θεῷ (al. Ναζὶρ
θεοῦ ἔσται) τὸ παιδάριον οὐκ τῆς
γαστρός (al. ἀπὸ τῆς κοιλίας).
Luc. i. 15 .:
καὶ πνεύματος ἁγίου πλησθήσεται ἔτι ἐκ
κοιλίας μητρός αὐτοῦ.
Judg. xiii. 24 f. :
καὶ ηὐλόγησεν αὐτὸν Κύριος, καὶ η
’ξήθη (al. ἡδρύνθη) τὸ παιδάριον· καὶ
ἤρξατο πνεῦμα Κυρίου συμπορεύεσθαι
αὐτῷ ἐν παρεμβολῇ Δὰν, ἀναμὲσον
Σαρὰ καὶ ἀναμέσον Ἐσθαόλ.
Luc. i. 80 :
τὸ δὲ παιδίον ηὔξανε καὶ ἐκραταιοῦτο
πνεύματι, κὰι ἦν ἐν ταῖς ἐρήμοις, ἕως
ἡμέρας ἁναδείξεως αὐτοῦ πρὸς τὸν
Ἰσραήλ.
Comp. Gen. xxi. 20. ↑
Gen. xvi. 11 . (LXX.):
καὶ καλέσεις τὸ ὄνομα αὐτοῦ Ἰσμαήλ.
Luc. i. 13 :
καὶ καλέσεις τὸ ὄνομα αὐτοῦ Ἰωάννην.
xvii. 19 : — — Ἰσαάκ. ↑
52
53
Olshausen, bibl. Commentar, 1. s. 116. Hoffmann, s. 146. ↑
With this view of the passage compare De Wette, Exeg. Handbuch zum N.
T., 1, 2, s. 12. ↑
[Contents]
CHAPTER II.
DAVIDICAL DESCENT OF JESUS, ACCORDING TO
THE GENEALOGICAL TABLES OF MATTHEW AND
LUKE.
[Contents]
§ 20.
THE TWO GENEALOGIES OF JESUS CONSIDERED
SEPARATELY AND IRRESPECTIVELY OF ONE
ANOTHER.
In the history of the birth of the Baptist, we had the single account
of Luke; but regarding the genealogical descent of Jesus we have
also that of Matthew; so that in this case the mutual control of two
narrators in some respects multiplies, whilst in others it lightens, our
critical labour. It is indeed true that the authenticity of the two first
chapters of Matthew, which contain the history of the birth and
childhood of Jesus, as well as that of the parallel section of Luke,
has been questioned: but as in both cases the question has
originated merely in a prejudiced view of the subject, the doubt has
been silenced by a decisive refutation.1
Each of these two Gospels contains a genealogical table designed to
exhibit the Davidical descent of Jesus, the Messiah. That of Matthew
(i. 1–17) precedes, that of Luke (iii. 23–38) follows, the history of
the announcement and birth of Jesus. These two tables, considered
each in itself, or both compared together, afford so important a key
to the character of the evangelic records in this section, as to render
a close examination of them imperative. We shall first consider each
separately, and then each, but particularly that of Matthew, in
comparison with the passages in the Old Testament to which it is
parallel.
In the Genealogy given by the author of the first Gospel, there is a
comparison of the account with itself which is important, as it gives
a result, a sum at its conclusion, whose correctness may be proved
by comparing it with the previous statements. In the summing up it
is said, that from Abraham to Christ there are three divisions of
fourteen generations each, the first from Abraham to David, the
second from David to the Babylonish exile, the third from the exile to
Christ. Now if we compute the number of names for ourselves, we
find the first fourteen from Abraham to David, both included,
complete (2–5 ); also that from Solomon to Jechonias, after whom
the Babylonish exile is mentioned (6–11 ); but from Jechonias to
Jesus, even reckoning the latter as one, we can discover only
thirteen (12–16 ). How shall we explain this discrepancy? The
supposition that one of the names has escaped from the third
division by an error of a transcriber,2 is in the highest degree
improbable, [109]since the deficiency is mentioned so early as by
Porphyry.3 The insertion, in some manuscripts and versions, of the
name Jehoiakim4 between Josias and Jechonias, does not supply the
deficiency of the third division; it only adds a superfluous generation
to the second division, which was already complete. As also there is
no doubt that this deficiency originated with the author of the
genealogy, the question arises: in what manner did he reckon so as
to count fourteen generations for his third series? Truly it is possible
to count in various ways, if an arbitrary inclusion and exclusion of
the first and last members of the several series be permitted. It
might indeed have been presupposed, that a generation already
included in one division was necessarily excluded from another: but
the compiler of the genealogy may perhaps have thought otherwise;
and since David is twice mentioned in the table, it is possible that
the author counted him twice: namely, at the end of the first series,
and again at the beginning of the second. This would not indeed,
any more than the insertion of Jehoiakim, fill up the deficiency in the
third division, but give too many to the second; so that we must,
with some commentators,5 conclude the second series not with
Jechonias, as is usually done, but with his predecessor Josias: and
now, by means of the double enumeration of David, Jechonias, who
was superfluous in the second division, being available for the third,
the last series, including Jesus, has its fourteen members complete.
But it seems very arbitrary to reckon the concluding member of the
first series twice, and not also that of the second: to avoid which
inconsistency some interpreters have proposed to count Josias twice,
as well as David, and thus complete the fourteen members of the
third series without Jesus. But whilst this computation escapes one
blunder, it falls into another; namely, that whereas the expression
ἀπὸ Ἀβραὰμ ἕως Δαβὶδ κ.τ.λ. (v. 17 ) is supposed to include the
latter, in ἀπὸ μετοικεσίας Βαβυλῶνος ἕως τοῦ Χριστοῦ, the latter is
excluded. This difficulty may be avoided by counting Jechonias twice
instead of Josias, which gives us fourteen names for the third
division, including Jesus; but then, in order not to have too many in
the second, we must drop the double enumeration of David, and
thus be liable to the same charge of inconsistency as in the former
case, since the double enumeration is made between the second
and third divisions, and not between the first and second. Perhaps
De Wette has found the right clue when he remarks, that in v. 17 ,
in both transitions some member of the series is mentioned twice,
but in the first case only that member is a person (David), and
therefore to be twice reckoned. In the second case it is the
Babylonish captivity occurring between Josias and Jechonias, which
latter, since he had reigned only three months in Jerusalem (the
greater part of his life having passed after the carrying away to
Babylon), was mentioned indeed at the conclusion of the second
series for the sake of connexion, but was to be reckoned only at the
beginning of the third.6
If we now compare the genealogy of Matthew (still without
reference to that of Luke) with the corresponding passages of the
Old Testament, we shall also find discrepancy, and in this case of a
nature exactly the reverse of the preceding: for as the table
considered in itself required the duplication of one member in order
to complete its scheme, so when compared with the Old Testament,
we find that many of the names there recorded have been omitted,
in order that the number fourteen might not be exceeded. That is to
say, the Old Testament affords data for comparison with this
genealogical [110]table as the famed pedigree of the royal race of
David, from Abraham to Zorobabel and his sons; after whom, the
Davidical line begins to retire into obscurity, and from the silence of
the Old Testament the genealogy of Matthew ceases to be under any
control. The series of generations from Abraham to Judah, Pharez,
and Hezron, is sufficiently well known from Genesis; from Pharez to
David we find it in the conclusion of the book of Ruth, and in the
2nd chapter of the 1st Chronicles ; that from David to Zerubbabel in
the 3rd chapter of the same book; besides passages that are
parallel with separate portions of the series.
To complete the comparison: we find the line from Abraham to
David, that is, the whole first division of fourteen in our genealogy,
in exact accordance with the names of men given in the Old
Testament: leaving out however the names of some women, one of
which makes a difficulty. It is said v. 5 that Rahab was the mother
of Boaz. Not only is this without confirmation in the Old Testament,
but even if she be made the great-grandmother of Jesse, the father
of David, there are too few generations between her time and that
of David (from about 1450 to 1050 b.c.), that is, counting either
Rahab or David as one, four for 400 years. Yet this error falls back
upon the Old Testament genealogy itself, in so far as Jesse’s great-
grandfather Salmon, whom Matthew calls the husband of Rahab, is
said Ruth iv. 20 , as well as by Matthew, to be the son of Nahshon,
who, according to Numbers i. 7 , lived in the time of the march
through the wilderness:7 from which circumstance the idea was
naturally suggested, to marry his son with that Rahab who saved the
Israelitish spies, and thus to introduce a woman for whom the
Israelites had an especial regard (compare James ii. 25 , Heb. xi.
31 ) into the lineage of David and the Messiah.
Many discrepancies are found in the second division from David to
Zorobabel and his son, as well as in the beginning of the third.
Firstly, it is said v. 8 Joram begat Ozias; whereas we know from 1
Chron. iii. 11 , 12 , that Uzziah was not the son, but the grandson
of the son of Joram, and that three kings occur between them,
namely, Ahaziah, Joash, and Amaziah, after whom comes Uzziah (2
Chron. xxvi. 1 , or as he is called 1 Chron. iii. 12 , and 2 Kings xiv.
21 , Azariah). Secondly: our genealogy says v. 11 , Josias begat
Jechonias and his brethren. But we find from 1 Chron. iii. 16 , that
the son and successor of Josiah was called Jehoiakim, after whom
came his son and successor Jechoniah or Jehoiachin. Moreover
brethren are ascribed to Jechoniah, whereas the Old Testament
mentions none. Jehoiakim, however, had brothers: so that the
mention of the brethren of Jechonias in Matthew appears to have
Welcome to Our Bookstore - The Ultimate Destination for Book Lovers
Are you passionate about books and eager to explore new worlds of
knowledge? At our website, we offer a vast collection of books that
cater to every interest and age group. From classic literature to
specialized publications, self-help books, and children’s stories, we
have it all! Each book is a gateway to new adventures, helping you
expand your knowledge and nourish your soul
Experience Convenient and Enjoyable Book Shopping Our website is more
than just an online bookstore—it’s a bridge connecting readers to the
timeless values of culture and wisdom. With a sleek and user-friendly
interface and a smart search system, you can find your favorite books
quickly and easily. Enjoy special promotions, fast home delivery, and
a seamless shopping experience that saves you time and enhances your
love for reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!
ebookgate.com

More Related Content

PDF
Essential Windows Phone 7 5 Application Development with Silverlight 1st Edit...
PDF
Essential Windows Phone 75 Application Development With Silverlight 1st Editi...
PDF
Apress.migrating.to.windows.phone.dec.2011
PDF
Windows Phone 7 Developer Guide Building connected mobile applications with M...
PPTX
Designing and developing a Windows Phone 7 Silverlight Application End-to-End...
PDF
Microsoft Silverlight 4 Business Application Development Beginners Guide Came...
PPTX
Windows 7 mobile
PDF
Windows Store App Development C And Xaml 1st Edition Pete Brown
Essential Windows Phone 7 5 Application Development with Silverlight 1st Edit...
Essential Windows Phone 75 Application Development With Silverlight 1st Editi...
Apress.migrating.to.windows.phone.dec.2011
Windows Phone 7 Developer Guide Building connected mobile applications with M...
Designing and developing a Windows Phone 7 Silverlight Application End-to-End...
Microsoft Silverlight 4 Business Application Development Beginners Guide Came...
Windows 7 mobile
Windows Store App Development C And Xaml 1st Edition Pete Brown

Similar to Essential Windows Phone 7 5 Application Development with Silverlight 1st Edition Shawn Wildermuth (20)

PDF
Windows Phone 7 Programming for Fun and Profit
PDF
Windows Store App Development C and XAML Pete Brown
PPTX
Windows Phone Application development
PDF
windows phone-developer-guidance-map- 2-d00_-v2
PPTX
Windows phone app development overview
PPTX
Windows Phone Code Camp Montreal - The Windows Phone 7.5 opportunity
PPTX
Stc ftn-wp7-intro
PPTX
데브멘토 발표세미나
PPTX
Silverlight and Windows Phone workshop
PPTX
Windows Phone 7
PDF
Windows Phone 7 Microsoft's Entrant to the Smartphone Wars
PPTX
Nashua Cloud .NET User Group - Basic WP8 App Dev With XAML and C#, April 2013
PDF
Manning.silverlight.4.in.action.sep.2010
PDF
S#01 김영욱
PPTX
Windows Phone 7 Unleashed Session 1
PPTX
Presentation[1]
PPTX
Building appsinsilverlight4 part_1
PDF
Porting iPhone Apps to Windows Phone 7
PPTX
Computer project work
PPTX
Developing windows phone 7 applications with silverlight
Windows Phone 7 Programming for Fun and Profit
Windows Store App Development C and XAML Pete Brown
Windows Phone Application development
windows phone-developer-guidance-map- 2-d00_-v2
Windows phone app development overview
Windows Phone Code Camp Montreal - The Windows Phone 7.5 opportunity
Stc ftn-wp7-intro
데브멘토 발표세미나
Silverlight and Windows Phone workshop
Windows Phone 7
Windows Phone 7 Microsoft's Entrant to the Smartphone Wars
Nashua Cloud .NET User Group - Basic WP8 App Dev With XAML and C#, April 2013
Manning.silverlight.4.in.action.sep.2010
S#01 김영욱
Windows Phone 7 Unleashed Session 1
Presentation[1]
Building appsinsilverlight4 part_1
Porting iPhone Apps to Windows Phone 7
Computer project work
Developing windows phone 7 applications with silverlight
Ad

Recently uploaded (20)

PDF
Basic Mud Logging Guide for educational purpose
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
Pharma ospi slides which help in ospi learning
PPTX
Institutional Correction lecture only . . .
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPTX
master seminar digital applications in india
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Cell Structure & Organelles in detailed.
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Computing-Curriculum for Schools in Ghana
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Basic Mud Logging Guide for educational purpose
O5-L3 Freight Transport Ops (International) V1.pdf
Pharma ospi slides which help in ospi learning
Institutional Correction lecture only . . .
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
master seminar digital applications in india
TR - Agricultural Crops Production NC III.pdf
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Microbial diseases, their pathogenesis and prophylaxis
Abdominal Access Techniques with Prof. Dr. R K Mishra
Renaissance Architecture: A Journey from Faith to Humanism
Anesthesia in Laparoscopic Surgery in India
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Cell Structure & Organelles in detailed.
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Computing-Curriculum for Schools in Ghana
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Ad

Essential Windows Phone 7 5 Application Development with Silverlight 1st Edition Shawn Wildermuth

  • 1. Essential Windows Phone 7 5 Application Development with Silverlight 1st Edition Shawn Wildermuth pdf download https://ebookgate.com/product/essential-windows- phone-7-5-application-development-with-silverlight-1st-edition- shawn-wildermuth/ Get the full ebook with Bonus Features for a Better Reading Experience on ebookgate.com
  • 2. Instant digital products (PDF, ePub, MOBI) available Download now and explore formats that suit you... Windows Phone 7 Developer Guide Building connected mobile applications with Microsoft Silverlight Developer Series 1st Edition Dominic Betts https://ebookgate.com/product/windows-phone-7-developer-guide- building-connected-mobile-applications-with-microsoft-silverlight- developer-series-1st-edition-dominic-betts/ ebookgate.com Windows Phone 7 Secrets 1st Edition Paul Thurrott https://ebookgate.com/product/windows-phone-7-secrets-1st-edition- paul-thurrott/ ebookgate.com Programming with Mobile Applications Android iOS and Windows Phone 7 1st Edition Thomas J. Duffy https://ebookgate.com/product/programming-with-mobile-applications- android-ios-and-windows-phone-7-1st-edition-thomas-j-duffy/ ebookgate.com Windows 8 and Windows Phone 8 Game Development 1st Edition Adam Dawes (Auth.) https://ebookgate.com/product/windows-8-and-windows-phone-8-game- development-1st-edition-adam-dawes-auth/ ebookgate.com
  • 3. Professional Windows Phone 7 Game Development Creating Games using XNA Game Studio 4 1st Edition Chris G. Williams https://ebookgate.com/product/professional-windows-phone-7-game- development-creating-games-using-xna-game-studio-4-1st-edition-chris- g-williams/ ebookgate.com Pro Windows Phone App Development 3rd Edition Falafel Software https://ebookgate.com/product/pro-windows-phone-app-development-3rd- edition-falafel-software/ ebookgate.com Windows Phone 7 Recipes A Problem Solution Approach 1st Edition Fabio Claudio Ferracchiati https://ebookgate.com/product/windows-phone-7-recipes-a-problem- solution-approach-1st-edition-fabio-claudio-ferracchiati/ ebookgate.com Microsoft Silverlight 4 Business Application Development Beginners Guide 1st New edition Edition Cameron Albert https://ebookgate.com/product/microsoft-silverlight-4-business- application-development-beginners-guide-1st-new-edition-edition- cameron-albert/ ebookgate.com Windows 7 Secrets 1st Edition Paul Thurrott https://ebookgate.com/product/windows-7-secrets-1st-edition-paul- thurrott/ ebookgate.com
  • 7. The award-winning Microsoft .NET Development Series was established in 2002 to provide professional developers with the most comprehensive, practical coverage of the latest .NET technologies. Authors in this series include Microsoft architects, MVPs, and other experts and leaders in the field of Microsoft development technologies. Each book provides developers with the vital information and critical insight they need to write highly effective applications. Visit informit.com/msdotnetseries for a complete list of available products. Microsoft ® .NET Development Series
  • 8. Essential Windows Phone 7.5 Application Development with Silverlight Shawn Wildermuth Upper Saddle River, NJ • Boston • Indianapolis • San Francisco New York • Toronto • Montreal • London • Munich • Paris • Madrid Capetown • Sydney • Tokyo • Singapore • Mexico City
  • 9. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals. The .NET logo is either a registered trademark or trademark of Microsoft Corporation in the United States and/or other countries and is used under license from Microsoft. Microsoft, Windows, Visual Basic, Visual C#, and Visual C++ are either registered trademarks or trademarks of Microsoft Corporation in the U.S.A. and/or other countries/regions. The author and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein. The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales, which may include electronic versions and/or custom covers and content particular to your business, training goals, marketing focus, and branding interests. For more information, please contact: U.S. Corporate and Government Sales (800) 382-3419 corpsales@pearsontechgroup.com For sales outside the United States, please contact: International Sales international@pearson.com Visit us on the Web: informit.com/aw Library of Congress Cataloging-in-Publication Data Wildermuth, Shawn. Essential windows phone 7.5 : application development with silverlight / Shawn Wildermuth. p. cm. Includes index. ISBN 978-0-321-75213-0 (pbk. : alk. paper) 1. Windows phone (Computer file) 2. Silverlight (Electronic resource) 3. Operating systems (Computers) 4. Application software—Development. 5. Mobile computing—Programming. I. Title. QA76.59.W54 2012 005.4’46—dc23 2011036842 Copyright © 2012 Pearson Education, Inc. All rights reserved. Printed in the United States of America. This publication is protected by copy- right, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. To obtain permission to use material from this work, please submit a written request to Pearson Education, Inc., Permissions Department, One Lake Street, Upper Saddle River, New Jersey 07458, or you may fax your request to (201) 236-3290. ISBN-13: 978-0-321-75213-0 ISBN-10: 0-321-75213-9 Text printed in the United States on recycled paper at RR Donnelley in Crawfordsville, Indiana. First printing, December 2011
  • 10. To my friend and mentor, Chris Sells, without whom I would have never learned that the story is more important than the facts.
  • 12. vii Contents at a Glance Figures xvii Tables xxv Foreword xxvii Preface xxix Acknowledgments xxxi About the Author xxxiii 1 Introducing Windows Phone 1 2 Writing Your First Phone Application 25 3 XAML Overview 61 4 Controls 89 5 Designing for the Phone 139 6 Developing for the Phone 187 7 Phone Integration 219 8 Databases and Storage 305 9 Multitasking 337 10 Services 369 11 The Marketplace 431 Index 459
  • 14. ix Contents Figures xvii Tables xxv Foreword xxvii Preface xxix Acknowledgments xxxi About the Author xxxiii 1 Introducing Windows Phone 1 A Different Kind of Phone 1 Integrated Experiences 6 Phone Specifications 7 Input Patterns 9 Designing for Touch 10 Hardware Buttons 11 Keyboards 11 Sensors 13 Application Lifecycle 14 Driving Your Development with Services 15 Live Tiles 16 The Marketplace 18 Distributing Your Application through the Marketplace 18 Marketplace Submissions 19 Application Policies 20
  • 15. x Contents Content Policies 23 Where Are We? 24 2 Writing Your First Phone Application 25 Preparing Your Machine 25 Creating a New Project 27 Visual Studio 27 XAML 32 Designing with Blend 36 Adding Code 43 Working with Events 46 Debugging in the Emulator 47 Debugging with a Device 48 Using Touch 52 Working with the Phone 55 Where Are We? 59 3 XAML Overview 61 What Is XAML? 61 XAML Object Properties 63 Understanding XAML Namespaces 64 Naming in XAML 65 Visual Containers 66 Visual Grammar 70 Shapes 71 Brushes 72 Colors 73 Text 74 Images 75 Transformations and Animations 77 Transformations 77 Animations 80 XAML Styling 82 Understanding Resources 83 Understanding Styles 84 Where Are We? 87
  • 16. xi Contents 4 Controls 89 Controls in Silverlight 89 Simple Controls 91 Content Controls 97 List Controls 98 Phone-Specific Controls 99 Panorama Control 99 Pivot Control 102 Data Binding 105 Simple Data Binding 105 Using a DataTemplate 108 Improving Scrolling Performance 108 Binding Formatting 110 Element Binding 110 Converters 111 Data Binding Errors 113 Control Templates 114 Silverlight for Windows Phone Toolkit 119 AutoCompleteBox Control 119 ContextMenu Control 121 DatePicker and TimePicker Controls 122 ListPicker Control 124 LongListSelector Control 127 PerformanceProgressBar Control 131 ToggleSwitch Control 132 ExpanderView Control 133 PhoneTextBox Control 134 WrapPanel Layout Container 136 Where Are We? 138 5 Designing for the Phone 139 The Third Screen 139 It Is a Phone, Right? 143 Deciding on an Application Paradigm 144 Panorama 146
  • 17. xii Contents Pivot 147 Simple Pages 150 Microsoft Expression Blend 150 Creating a Project 150 A Tour around Blend 151 Blend Basics 159 Layout 159 Brushes 164 Creating Animations 169 Working with Behaviors 173 Phone-Specific Design 176 The ApplicationBar in Blend 176 Using the Panorama Control in Blend 179 Using the Pivot Control in Blend 182 Previewing Applications 185 Where Are We? 185 6 Developing for the Phone 187 Application Lifecycle 187 Navigation 190 Tombstoning 195 The Phone Experience 200 Orientation 201 Designing for Touch 203 Application Client Area 211 Application Bar 213 Understanding Idle Detection 215 The Tilt Effect 216 Where Are We? 218 7 Phone Integration 219 Using Vibration 219 Using Motion 220 Emulating Motion 223 Using Sound 226 Playing Sounds with MediaElement 226
  • 18. xiii Contents Using XNA Libraries 227 Playing Sounds with XNA 228 Adjusting Playback 229 Recording Sounds 230 Contacts and Appointments 233 Contacts 233 Appointments 238 Alarms and Reminders 240 Creating an Alarm 242 Creating a Reminder 244 Accessing Existing Notifications 245 Using Tasks 246 Launchers 248 Choosers 257 Media and Picture Hubs 266 Accessing Music 266 Playing Music 268 Accessing Pictures 270 Storing Pictures 272 Integrating into the Pictures Hub 274 Integrating into the Music+Videos Hub 276 Working with the Camera 280 Using the PhotoCamera Class 280 Raw Hardware Access 284 The Clipboard API 287 Live Tiles 288 Main Live Tile 289 Secondary Tiles 290 Dual-Sided Live Tiles 292 Location APIs 293 Location Permission 293 Accessing Location Information 294 Emulating Location Information 300 Where Are We? 303
  • 19. xiv Contents 8 Databases and Storage 305 Storing Data 305 Isolated Storage 306 Serialization 308 Local Databases 314 Getting Started 314 Optimizing the Context Class 320 Associations 324 Using an Existing Database 330 Schema Updates 332 Database Security 334 Where Are We? 335 9 Multitasking 337 Multitasking 337 Background Agents 338 Periodic Agent 340 Resource-Intensive Agent 348 Audio Agent 350 Background Transfer Service 360 Requirements and Limitations 360 Requesting Transfers 362 Monitoring Requests 363 Where Are We? 368 10 Services 369 The Network Stack 370 The WebClient Class 370 Accessing Network Information 373 Consuming JSON 376 Using JSON Serialization 377 Parsing JSON 379 Web Services 383 Consuming OData 387 How OData Works 388
  • 20. xv Contents The URI 389 Using OData on the Phone 398 Generating a Service Reference for OData 398 Retrieving Data 399 Updating Data 401 Using Push Notifications 403 Push Notification Requirements 404 Preparing the Application for Push Notifications 405 Setting Up the Server for Push Notifications 407 Raw Notifications 410 Sending Toast Notifications 419 Creating Live Tiles 423 Handling Push Notification Errors 427 Where Are We? 429 11 The Marketplace 431 What Is the Marketplace? 431 How It Works 432 Charging for Apps 435 Getting Paid 438 Submitting Your App 439 Preparing Your Application 439 The Submission Process 445 After the Submission 451 Modifying Your Application 453 Dealing with Failed Submissions 454 Using Ads in Your Apps 457 Where Are We? 458 Index 459
  • 22. xvii Figures FIGURE 1.1 Windows Phone Start screen 3 FIGURE 1.2 Phone screen real estate 3 FIGURE 1.3 The application bar in action 4 FIGURE 1.4 Panorama application 5 FIGURE 1.5 Last pane of a panorama application 5 FIGURE 1.6 Using Metro chrome, or not 6 FIGURE 1.7 Seven points of input 8 FIGURE 1.8 Metro’s interactive element sizes 10 FIGURE 1.9 Default keyboard 12 FIGURE 1.10 Contextual keyboards 12 FIGURE 1.11 Application lifecycle (tombstoning) 15 FIGURE 1.12 A tile in the hub 17 FIGURE 1.13 Updating tiles 17 FIGURE 1.14 Marketplace application submission process 19 FIGURE 2.1 Microsoft Visual Studio 2010 Express for Windows Phone 28 FIGURE 2.2 New Project dialog 29 FIGURE 2.3 Picking the phone version to target 29 FIGURE 2.4 The Visual Studio user interface 30 FIGURE 2.5 Enabling the toolbar 31 FIGURE 2.6 Using the emulator 31 FIGURE 2.7 The emulator 31
  • 23. xviii Figures FIGURE 2.8 Using the Visual Studio XAML design surface 33 FIGURE 2.9 Location of the Properties window 34 FIGURE 2.10 Contents of the Properties window 34 FIGURE 2.11 The changed property 35 FIGURE 2.12 Opening Blend directly in Visual Studio 36 FIGURE 2.13 The Blend user interface 37 FIGURE 2.14 Selecting an object in Blend 38 FIGURE 2.15 Selecting an object to edit in the Properties pane 38 FIGURE 2.16 Updating a property in Blend 39 FIGURE 2.17 Drawing in a container 40 FIGURE 2.18 Rounding the corners 40 FIGURE 2.19 Editing brushes 41 FIGURE 2.20 Picking a color 41 FIGURE 2.21 Inserting a TextBlock 42 FIGURE 2.22 Centering the TextBlock 42 FIGURE 2.23 Changing the text properties 43 FIGURE 2.24 Naming an element in the Properties window 45 FIGURE 2.25 Running the application 46 FIGURE 2.26 Using the Visual Studio debugger 48 FIGURE 2.27 Connected device 49 FIGURE 2.28 Your phone connected to the Zune software 49 FIGURE 2.29 Registering your device 50 FIGURE 2.30 Successfully registered developer phone 51 FIGURE 2.31 Changing the deployment to use a development phone 51 FIGURE 2.32 Running on a device 52 FIGURE 2.33 Dragging the ellipse 55 FIGURE 2.34 The SearchTask in action 57 FIGURE 2.35 Choosing a contact to retrieve an email address via the EmailAddressChooserTask 59 FIGURE 2.36 Showing the selected email in a MessageBox 59 FIGURE 3.1 Path explained 72 FIGURE 3.2 Image stretching 77 FIGURE 3.3 Transformations in action 78 FIGURE 3.4 Entire container transformed 79
  • 24. xix Figures FIGURE 4.1 TextBox control example 90 FIGURE 4.2 Software input panel (SIP) 92 FIGURE 4.3 Special SIP keys 92 FIGURE 4.4 Long-hold keys 93 FIGURE 4.5 Chat input scope 94 FIGURE 4.6 Simple button with simple content 97 FIGURE 4.7 Button with XAML content 97 FIGURE 4.8 List box 98 FIGURE 4.9 Panorama application 99 FIGURE 4.10 Panorama explained 100 FIGURE 4.11 Landscape sections 101 FIGURE 4.12 Pivot control 103 FIGURE 4.13 Pivot control in action 104 FIGURE 4.14 Looping pivot sections 104 FIGURE 4.15 Simple data binding 105 FIGURE 4.16 Changes in the source 107 FIGURE 4.17 Output window 113 FIGURE 4.18 Binding error shown in the Output window 114 FIGURE 4.19 Conversion error shown in the Output window 114 FIGURE 4.20 TemplatePart attribute 116 FIGURE 4.21 TemplateVisualState attribute 118 FIGURE 4.22 AutoCompleteBox example 120 FIGURE 4.23 ContextMenu example 121 FIGURE 4.24 Date picking user interface 123 FIGURE 4.25 Setting icons as “Content” 124 FIGURE 4.26 Time picking user interface 125 FIGURE 4.27 ListPicker example (closed) 125 FIGURE 4.28 ListPicker example (opened) 126 FIGURE 4.29 ListPicker example (full screen) 126 FIGURE 4.30 LongListSelector with groups 128 FIGURE 4.31 LongListSelector’s pop-up groups 128 FIGURE 4.32 ToggleSwitch example 132 FIGURE 4.33 ToggleSwitch components 132 FIGURE 4.34 ExpanderView in action 133 FIGURE 4.35 PhoneTextBox with the Hint and ActionIcon shown 134
  • 25. xx Figures FIGURE 4.36 PhoneTextBox’s length indication support 135 FIGURE 4.37 PhoneTextBox’s AcceptReturn functionality 136 FIGURE 4.38 Buttons in a StackPanel 137 FIGURE 4.39 Buttons in a WrapPanel 137 FIGURE 4.40 Buttons in a vertical WrapPanel 138 FIGURE 5.1 Foursquare.com 140 FIGURE 5.2 Phone-sized app 141 FIGURE 5.3 Panorama application 142 FIGURE 5.4 A sample Foursquare on Windows Phone 142 FIGURE 5.5 Sample application navigation 145 FIGURE 5.6 Single-page Windows Phone application 145 FIGURE 5.7 Sample panorama application 146 FIGURE 5.8 Panorama in the emulator 146 FIGURE 5.9 Pivot example 148 FIGURE 5.10 Pivot pages 149 FIGURE 5.11 Blend New Project dialog 150 FIGURE 5.12 Blend user interface 152 FIGURE 5.13 Blend toolbar 153 FIGURE 5.14 Projects panel 154 FIGURE 5.15 Assets panel 155 FIGURE 5.16 Objects and Timeline panel 155 FIGURE 5.17 Artboard 157 FIGURE 5.18 Item Tools panel 158 FIGURE 5.19 Searching in the Properties panel 159 FIGURE 5.20 Dragging a new control 160 FIGURE 5.21 Margin and alignment layout 160 FIGURE 5.22 Column and row gutters 161 FIGURE 5.23 Splitting the grid into rows 162 FIGURE 5.24 Modifying row/column properties 163 FIGURE 5.25 Sizing across rows 163 FIGURE 5.26 Sizing across rows with RowSpan 164 FIGURE 5.27 Brushes in the Properties panel 164 FIGURE 5.28 Converting a color to a resource 167 FIGURE 5.29 Creating a color resource 168
  • 26. xxi Figures FIGURE 5.30 Applying a color resource 168 FIGURE 5.31 Creating a brush resource 169 FIGURE 5.32 Applying a brush resource 169 FIGURE 5.33 Storyboard basics 169 FIGURE 5.34 Creating a storyboard 170 FIGURE 5.35 Objects and Timeline panel with animation 170 FIGURE 5.36 Picking the animation point 171 FIGURE 5.37 Animation mode on the artboard 171 FIGURE 5.38 The ellipse animated 172 FIGURE 5.39 Animation values in the Objects and Timeline panel 172 FIGURE 5.40 RenderTransform in an animation 173 FIGURE 5.41 Closing a storyboard 173 FIGURE 5.42 Behaviors in the Assets panel 174 FIGURE 5.43 Applying a behavior 175 FIGURE 5.44 Changing behavior properties 175 FIGURE 5.45 Multiple behaviors 176 FIGURE 5.46 ApplicationBar explained 177 FIGURE 5.47 Adding an ApplicationBar 178 FIGURE 5.48 Adding items to the ApplicationBar 178 FIGURE 5.49 Selecting a built-in icon for an ApplicationBar icon 179 FIGURE 5.50 New panorama application 180 FIGURE 5.51 PanoramaItems in the Objects and Timeline panel 180 FIGURE 5.52 Panorama control user interface 181 FIGURE 5.53 PanoramaItem selection 181 FIGURE 5.54 Adding a PanoramaItem 182 FIGURE 5.55 Creating a pivot application 183 FIGURE 5.56 A pivot application 183 FIGURE 5.57 Pivot control user interface 184 FIGURE 5.58 Editing a PivotItem 184 FIGURE 5.59 Changing device properties 185 FIGURE 6.1 Important files in a new project 188 FIGURE 6.2 Page navigation explained 191 FIGURE 6.3 URI mapping to the files in the project 192 FIGURE 6.4 How tombstoning works 196
  • 27. xxii Figures FIGURE 6.5 Portrait orientation 201 FIGURE 6.6 Landscape left orientation 201 FIGURE 6.7 Landscape right orientation 202 FIGURE 6.8 Application client area 212 FIGURE 6.9 Untilted 216 FIGURE 6.10 Tilted 216 FIGURE 7.1 Accelerometer axes 221 FIGURE 7.2 Showing the Accelerometer window in the emulator 224 FIGURE 7.3 The Accelerometer window 225 FIGURE 7.4 An alarm 240 FIGURE 7.5 A reminder 241 FIGURE 7.6 Stacked notifications 242 FIGURE 7.7 Media player controls 253 FIGURE 7.8 PhoneCallTask confirmation 255 FIGURE 7.9 Allowing photo cropping 262 FIGURE 7.10 Music library objects 267 FIGURE 7.11 Displaying the albums and pictures 272 FIGURE 7.12 The apps in the Pictures hub 274 FIGURE 7.13 Tile layers 288 FIGURE 7.14 Opening the emulator’s Additional Tools sidebar 300 FIGURE 7.15 Selecting the Location tab 301 FIGURE 7.16 Location tab of the Additional Tools dialog 301 FIGURE 7.17 Using pins to create waypoints 302 FIGURE 7.18 Saving recorded data 302 FIGURE 8.1 The SQL query 319 FIGURE 8.2 SQL Server Compact Edition database as Content 330 FIGURE 9.1 Relationship between application and scheduled task 339 FIGURE 9.2 Adding a new Scheduled Task Agent project 341 FIGURE 9.3 Picking the Windows Phone Scheduled Task Agent 341 FIGURE 9.4 Adding a reference to the Scheduled Task Agent project 344 FIGURE 9.5 The PeriodicTask’s description in the management user interface 346
  • 28. xxiii Figures FIGURE 9.6 The Universal Volume Control (UVC) in action 351 FIGURE 9.7 Adding an audio agent to your project 352 FIGURE 9.8 Making a reference to the audio agent project 353 FIGURE 10.1 Adding a service reference 383 FIGURE 10.2 The Add Service Reference dialog 384 FIGURE 10.3 Service files displayed 385 FIGURE 10.4 Adding a service reference to an OData feed 399 FIGURE 10.5 Adding a using statement to the data service 400 FIGURE 10.6 Push notification message flow 404 FIGURE 10.7 Debugging push notifications 420 FIGURE 10.8 A toast message 420 FIGURE 10.9 Tile layers 424 FIGURE 11.1 The Marketplace 432 FIGURE 11.2 The Marketplace in Zune 432 FIGURE 11.3 Submission process 433 FIGURE 11.4 The App Hub 434 FIGURE 11.5 Capability detection results 442 FIGURE 11.6 Works in the dark theme 444 FIGURE 11.7 Does not work in the light theme 444 FIGURE 11.8 Accessing your “dashboard” 445 FIGURE 11.9 Starting the submission process 446 FIGURE 11.10 Step 1 of the submission process 446 FIGURE 11.11 Filling in the descriptive fields 448 FIGURE 11.12 Pricing your app 449 FIGURE 11.13 Publish and testing options 450 FIGURE 11.14 Submission confirmation 450 FIGURE 11.15 Application lifecycle page 451 FIGURE 11.16 My Apps page 452 FIGURE 11.17 Deep link 453 FIGURE 11.18 Application actions 454 FIGURE 11.19 A failure report 455
  • 30. xxv Tables TABLE 1.1 Integrated Experiences 7 TABLE 1.2 Hardware Specifications 8 TABLE 1.3 Hardware Inputs 9 TABLE 1.4 Sample Keyboard Layouts 13 TABLE 1.5 Sensors 13 TABLE 1.6 Microsoft Phone Services 16 TABLE 2.1 Windows Phone Developer Tools Requirements 26 TABLE 3.1 Visual Containers 67 TABLE 3.2 Grid Row and Column Sizing 69 TABLE 3.3 Brush Types 73 TABLE 3.4 Transformation Types 79 TABLE 4.1 Common InputScope Values 94 TABLE 4.2 RichTextBox Markup Tags 96 TABLE 4.3 Data Binding Modes 107 TABLE 5.1 New Project Types in Blend 151 TABLE 5.2 Row/Column Sizing Icons 162 TABLE 5.3 Brush Editors 165 TABLE 5.4 Blend Behaviors 174
  • 31. xxvi Tables TABLE 6.1 Manipulation Events 207 TABLE 6.2 UIElement Touch Events 211 TABLE 7.1 FilterKind Enumeration 234 TABLE 7.2 Launchers 246 TABLE 7.3 Choosers 247 TABLE 7.4 MediaPlaybackControls Enumeration 253 TABLE 9.1 Scheduled Task Limitations 340 TABLE 10.1 OData HTTP Verb Mappings 388 TABLE 10.2 OData Query Options 391 TABLE 10.3 $filter Operators 393 TABLE 10.4 $filter Functions 394 TABLE 10.5 Push Notification Response Headers 414 TABLE 10.6 Response Codes and Header Status Codes 415 TABLE 10.7 ChannelErrorType Enumeration 429 TABLE 10.8 ChannelPowerLevel Enumeration 429 TABLE 11.1 International Pricing Example 436 TABLE 11.2 Application Images 443 TABLE 11.3 Advertising Vendors for the Phone 457
  • 32. xxvii Foreword When Shawn asked me to write a foreword for his Windows Phone devel- opment book, I had a couple of reactions. First, that they must really be scraping the bottom of the barrel if they have asked me to write anything. There are so many people who actually help bring the product to market who never really get the credit they deserve. While I am honored that I was asked to write this, based in part on my public role on the team, the engineering team that designed and built this amazing product are the real heroes. The product itself is amazing, but the right application platform, which enables the amazing Metro apps and games to be built, is a devel- oper’s playground. I do this to honor them. My second reaction was to think about the huge value Shawn has in the Microsoft ecosystem. As an eight-time MVP and Silverlight Insider, Shawn’s contributions are highly valued both for their content as well as for their reach. When Shawn speaks, you know that he has the developer in mind: He is a developer’s developer. Without individuals like Shawn, it would be tough (if possible at all) for Microsoft to have built our developer ecosystem over the last three decades. I do this to honor him. My last reaction was one of panic. I have never written a foreword before, so I was at a bit of a loss as to what I should say. I figure if you are buying this book, you did so of your own volition, and not on the strength of what I have to say here. However, if you are reading the foreword with
  • 33. xxviii Foreword an eye toward confirming your belief that Windows Phone is where it’s at, well, for that I can be accommodating. I do this to honor you. With the initial release of Windows Phone, and the subsequent pair- ing with Nokia, Microsoft is investing in building the third ecosystem for mobile developers. The canvas with which mobile developers can work on Windows Phone is unlike any other platform, whereby developers can create simply gorgeous apps with more focus on the user experience than tinkering with the innards of a convoluted framework. Metro apps come alive on the screen, and you will be able to build deeply engaging applica- tions using Live Tiles. Windows Phone 7.5 is an updated release, codenamed “Mango,” and carries with it the tagline “Put people first.” We think the same way about the developer platform. We aim to put developers first. The book you are holding might be your first step on your journey to building Windows Phone apps. It may be a refresher course. Either way, with Shawn’s guid- ance, we know that you will come away from this experience feeling great about your prospects of building amazing mobile experiences for Windows Phone, and a firm belief that Microsoft puts the developers first when we think about Windows Phone. Every developer matters. Every. Single. One. —Brandon Watson Microsoft Corporation
  • 34. xxix Preface I have never owned a PalmPilot. But I have owned palmtops and smart- phones. I dived into writing software for a plethora of different devices but never got very far. My problem was that the story of getting software onto the phones was chaotic and I didn’t see how the marketing of software for phones would lead to a successful product. In the intervening years, I got distracted by Silverlight and Web development. I didn’t pay attention as the smartphone revolution happened. I was happily neck-deep in data binding, business application development, and teaching XAML. The smartphone revolution clearly started with the iPhone. What I find interesting is that the iPhone is really about the App Store, not the phone. It’s a great device, but the App Store is what changed everything, provid- ing a simple way to publish, market, and monetize applications for these handheld powerhouses that everyone wanted. Of course, Apple didn’t mean to do it. When the original iPhone shipped, Apple clearly said that Safari (its Web browser) was the development environment. With the pres- sure of its OS X developer community, Apple relented and somewhat acci- dentally created the app revolution. When it was clear that I had missed something, I dived headlong into looking at development for phones again. I had an Android phone at the time, so that is where I started. Getting up to speed with Eclipse and Java wasn’t too hard, but developing for the phone was still a bit of a chore. The development tools just didn’t seem to be as easy as the development I was
  • 35. xxx Preface used to with Visual Studio and Blend. In this same time frame, I grabbed a Mac and tried my hand at Objective-C and Xcode to write something simple for the iPhone. That experience left me bloodied and bandaged. I wanted to write apps, but since it was a side effort, the friction of the tool sets for Android and iPhone left me wanting, and I put them aside. Soon after my experience with iPhone and Android, Microsoft took the covers off its new phone platform: Windows Phone 7. For me, the real excitement was the development experience. At that point I’d been teach- ing and writing about Silverlight since it was called WPF/E, so the ability to marry my interest in mobile development to my Silverlight knowledge seemed like a perfect match. I’ve enjoyed taking the desktop/Web Silverlight experience I have and applying the same concepts to the phone. By being able to use Visual Stu- dio and Blend to craft beautiful user interface designs and quickly go from prototype to finished application, I have found that the workflow of using these tools and XAML makes the path of building my own applications much easier than on other platforms. In the middle of this learning process Microsoft continued to mature the platform by announcing and releasing Windows Phone 7.5 (code-named Mango). I was left questioning whether to finish my Windows Phone 7 book or rush forward and mold all the new features of Windows Phone 7.5 into a book for this next version of the phone. Obviously you know the answer to that question. It has been a long road to get the right story for this book, and to help both beginners and existing Silverlight developers to learn from the book. My goal was always to allow readers to get started writing apps quickly, while also including the information that leads to great apps. Because of the relative size of these minicomputers we keep in our pockets, knowing when to pull back is often the key to a great application. As you will see throughout this book, my goal has been to help you build great apps, not rich applications. This means I will try to hold your hand as you read the book, but I will also challenge your assumptions about how you approach the process of building applications for the phone.
  • 36. xxxi Acknowledgments Writing a book is a team sport. Anyone who thinks for a moment that writ- ing a book requires that you sit in a dark room and craft words that magi- cally get bound into Amazon currency hasn’t been through the sausage factory that is book writing. The fact is that I may have the skills to get words down on virtual paper, but I am not good at much of the rest of the process. It takes a strong editor who knows how to dole out praise and pressure in equal amounts. It takes technical reviewers who aren’t afraid to ruffle your feathers. It takes production people to take the mess of Visio ramblings you call figures and create something the reader will understand. Finally, it takes an army of people to listen to your questions about the ambiguity of writing a book based on a beta version of a product . . . and who will not stop responding to your constant pestering. So I’d like to thank my army of people by acknowledging their real contributions (in no particular order). First and foremost, I want to thank my editor at Addison-Wesley, Joan Murray. I am not an easy author to work with, and she’s been a trouper in getting me to stick to deadlines and coercing me to make the right deci- sions, not just the easy ones. The rest of the people at Addison-Wesley that I’ve had the pleasure to work with are all great, too. Of special note, Christopher Cleveland did a great job picking up the role of developmen- tal editor in the middle of the book, and has been great through the whole process.
  • 37. xxxii Acknowledgments To the litany of people on the Silverlight Insiders Mailing List and the Windows Phone 7 Advisors Mailing List, I would like to thank you for your patience as I pestered the lists with endless questions and hyperbolic rants. You all helped shape this book, even if you didn’t realize it. During this process, my blog’s readers and my followers on Facebook and Twitter remained a consistent sounding board. My polls and open questions helped me shape what is and isn’t in this book. For that I am indebted to you. I also want to thank my terrific technical reviewers, Jeremy Likeness, Ambrose Little, and Bruce Little. Not only did they help me find the tons of places I just plain got it wrong, but they also helped me when the story got off track and I missed that key piece of the puzzle. Of particular note, I want to thank Ambrose for his tenacious adherence to the designer’s voice. He helped me make sure I wasn’t coddling the developers into bad user experience design. To anyone else I forgot to mention, I apologize. —Shawn Wildermuth November 2011 http://wildermuth.com @shawnwildermuth
  • 38. xxxiii About the Author During his twenty-five years in software development, Shawn Wilder- muth has experienced a litany of shifts in software development. These shifts have shaped how he understands technology. Shawn is a nine-time Microsoft MVP, a member of the INETA Speaker’s Bureau, and an author of several books on .NET. He is also involved with Microsoft as a Silver- light Insider and a Data Insider. He has spoken at a variety of interna- tional conferences, including TechEd, MIX, VSLive, OreDev, SDC, WinDev, DevTeach, DevConnections, and DevReach. He has written dozens of arti- cles for a variety of magazines and websites including MSDN, DevSource, InformIT, CoDe Magazine, ServerSide.NET, and MSDN Online. He is cur- rently teaching workshops around the United States through his training company, AgiliTrain (http://agilitrain.com).
  • 40. 1 1 Introducing Windows Phone T o some, the cell phone is an annoying necessity; to others, it’s a critical need. Being able to use a phone to make calls everywhere has really changed the way people communicate. In the past few years these phones have taken another leap forward. With the introduc- tion of iPhone and Android devices, the consumer market for an always- connected device that can interact with the Internet, run applications, and make phone calls has changed people’s relationship with their phone. It has also raised the bar for consumer-level devices. Consumers now expect their phones to also function as GPSs, gaming devices, and Internet tablets. For some consumers, their phones are now their primary connections to the Internet, replacing the desktop/laptop computer for the first time. As developers, our challenge is to find the best way to create the experiences the user needs. Windows Phone provides the platform, and Silverlight is the engine to power those experiences. A Different Kind of Phone When Microsoft originally unveiled Windows Phone 7 many skeptics expected the phone would simply try to play catch-up with Apple’s and Google’s offerings. Microsoft had other plans, though. The new operating system for the phone was a departure from existing offerings from the other mobile operating system vendors (primarily Apple, Research in Motion,
  • 41. 2 Chapter 1: Introducing Windows Phone and Google). Instead of just mimicking the icon pattern screens that iPhone and Android seemed to love, Microsoft thought in a different way. Applica- tion and operating system design is defined in a new design language code- named Metro.1 This design language defines a set of guidelines and styles for creating Windows Phone applications. The design of the Start screen laid out by Metro is similar to other smartphone designs in that it is a list of icons. Instead of separating the icons into pages, Windows Phone lets users scroll through the icons. Windows Phone is also differentiated from other smartphones in that each icon can include information about the applica- tion. These icons are called Live Tiles, as shown in Figure 1.1. What Is a Design Language? Developers think about a language as a set of textual expressions that describe some machine operation(s). For designers, it is a set of rules for defining the look and feel of a set of applications (or an entire operating system in this case). Wikipedia.org defines it more generally as “. . . an overarching scheme or style that guides the design of a complement of products or architectural settings.” The Start screen should be a place where users can quickly review the status of the phone. The Live Tiles will give user information such as the number of missed phone calls and the number of email or SMS messages waiting, or even third-party information such as the current weather. When you develop your own applications you can either create a simple icon for the Start screen or build a Live Tile for your users. For applications, the Windows Phone screen is divided into three areas in which the user can interact with the phone: the system tray, the logical client, and the application bar (see Figure 1.2). The system tray area is managed by the phone’s operating system. This is where the time, signal strength, and alerts will appear to the user. Most applications will leave this area of the screen visible to the user. Some 1. UIDesignandInteractionGuideforWindowsPhone:http://shawnw.me/wpmetroguide
  • 42. 3 A Different Kind of Phone FIGURE 1.1 Windows Phone Start screen FIGURE 1.2 Phone screen real estate
  • 43. 4 Chapter 1: Introducing Windows Phone applications (e.g., games) may hide this area, but you should only do so when critical to the success of your application. The logical client area is where your application will exist. This area shows your user interface and any data and points of interaction. The application bar shows options for your application. While using the application bar is not a requirement, it is a very common practice as it gives users access to your application’s options and menus. For example, Figure 1.3 shows a simple note-taking application that uses the applica- tion bar to allow users to create new notes or show the menu (note that the ellipsis can be clicked to open the list of menu items). One big distinction that users will see in many of the applications built into Windows Phone is the use of hubs. The central idea of a hub is to pro- vide a starting point to get the user to use natural curiosity to learn what is available in the application. Usually these hubs take the form of applica- tions that are larger than the phone screen. Instead of the typical page-based FIGURE 1.3 The application bar in action
  • 44. 5 A Different Kind of Phone applications that are fairly commonplace on smartphones, the Metro style guide introduces something called a panorama application. For panorama applications the phone is used as a window that looks into a larger applica- tion surface. You’ll notice in Figure 1.4 that the content of the screen takes up most of the horizontal real estate, but the next section of the panorama application shows up on the right side of the screen to help the user under- stand that there is more content. As the user navigates through the panorama application, the virtual space is moved within the window. For example, in Figure 1.5 you can see how, after sliding the application to the left, the rightmost part of the pano- rama becomes visible. FIGURE 1.4 Panorama application FIGURE 1.5 Last pane of a panorama application
  • 45. 6 Chapter 1: Introducing Windows Phone The use of the panorama application results in a simple but powerful user interface design that users should find very intuitive. By following the guidelines specified by Metro, you can create applica- tions that should be consistent with the rest of the phone, while giving you the freedom to create applications of any kind. In this way, Metro helps by defining basic ideas of how a Windows Phone application should look so that the user can see complete consistency. At the same time, Metro says you can simply take over the entire user interface and not use the basic ideas of the Metro chrome, leaving you the flexibility to create either cus- tom experiences or applications that look like they belong on the phone. Figure 1.6 shows example apps with and without the chrome applied. Integrated Experiences One of the main purposes of the phone is to be an integrated platform on which applications can interact with each other and with the core phone experiences. This means you can write applications that integrate with the phone in unprecedented ways. Table 1.1 outlines some of the core experi- ences users will be able to interact with and use on the phone. FIGURE 1.6 Using Metro chrome, or not
  • 46. 7 Phone Specifications As developers, your code might or might not look like the code in tra- ditional applications. Because you can write straightforward applications that can be launched in a traditional sense, the integrated experiences let your applications also interact with and even be embedded into these experiences. This means you can write applications that extend and power these experiences. Phone Specifications For Windows Phone, the stakes were high in terms of Microsoft’s ability to not only create the software but also encourage its partners to build the phone. Learning a lesson from its past Windows Mobile platform, Micro- soft decided to be very specific about the hardware to ensure a great user experience while giving phone designers some flexibility with feature sets so that they could compete with one another. Table 1.2 shows the hardware requirements. In addition, Windows Phone has physical requirements. The most obvi- ous of these is that each phone must have seven standard inputs, as shown in Figure 1.7. Table 1.3 lists and describes these seven hardware inputs. TABLE 1.1 Integrated Experiences Experience Description People The people on your phone, including contacts and past phone calls/SMS messages Office Integration with email, Word, Excel, and PowerPoint files Music+Videos The media on your device Marketplace Access to try, buy, and install applications on the phone Pictures View, share, and take pictures on your device Games Playing games on the device; this includes Xbox Live integration
  • 47. 8 Chapter 1: Introducing Windows Phone TABLE 1.2 Hardware Specifications Category Requirement Screen resolution WVGA (480 x 800) Capacitive touch At least four points of touch support Memory 256MB RAM, 8GB Flash Sensors A-GPS, Accelerometer, Compass, Light and Proximity, Gyro CPU ARM7 Scorpion/Cortex or better (typically 1GHz+) GPU DirectX 9 acceleration Camera 5 megapixels minimum, flash required Bluetooth Bluetooth 2.1 + EDR; Bluetooth profiles provided are Hand-Free Profile (HFP), Headset Profile (HSP), Advanced Audio Distribu- tion Profile (A2DP), and Phone Book Access Profile (PBAP) Multimedia Codec acceleration required; support for DivX 4, 5, and 6 as well as H.264 High Profile required (High Profile is used by Blu-ray) Wi-Fi 802.11g radio required Radio FM radio receiver required FIGURE 1.7 Seven points of input
  • 48. 9 Input Patterns Now that we have seen what the phone consists of, let’s see how users will interact with the phone. Input Patterns You are the developer. You want users to want to use your applications. That means you must deal with the different ways the phone can accept user input. Developing for the Web or desktop means you are primarily dealing with designing for the keyboard and mouse. But when developing for the phone, you have to change the way you look at input and consider that the user is going to interact with your application in different ways. Interaction patterns for the phone include touch, keyboards (hardware and software), hardware buttons, and sensors. TABLE 1.3 Hardware Inputs Input Expected Behavior 1 Power button When powered off, a long press will power on the device. If powered on and screen is active, will turn off screen and lock device. If screen is off, will enable screen and present unlock UI. 2 Volume control A rocker switch will adjust volume for current activity’s sound profile (e.g., phone call volume while on a call). Pressing volume during a phone call will disable the ringer. Adjusting volume when no activity is presently happening will allow user to switch between sound profiles. 3 Touch screen The capacitive touch screen will support at least four points of touch. 4 Camera button A long press on this dedicated button will launch the camera application. 5 Back button This button issues a “back” operation. This may take the user back in an individual application or from one applica- tion to the previous application as presented by the page API. 6 Start button This takes the user to the Start screen of the device. 7 Search button This launches the search experience to allow searching across the device.
  • 49. 10 Chapter 1: Introducing Windows Phone Designing for Touch The Metro design language is specifically constructed to make sure the interface is treating touch as a first-class citizen and that the interface requires no training (i.e., is intuitive). By building a design language that defines the elements of a touch-based interface, Microsoft has made it eas- ier to build such interfaces. The design language includes guidelines for what touch gestures are supported, as well as how to space and size ele- ments for finger-size interactions. Figure 1.8 shows an example from Metro to define the minimum sizes for touch points and their spacing. Metro also defines the types of interactions (e.g., touch gestures) the device supports. Most of these interactions are well-worn gestures that have been the vocabulary of other touch devices such as the iPhone, Zune HD, and Android. These interactions include • Single touch: − Tap − Double-Tap − Pan − Flick − Touch and Hold • Multitouch: − Pinch/Stretch/Rotate 2 mm/8 px Minimum Space between Touch Targets 7 mm/26 px Minimum Object Size 9 mm/34 px Touch Target FIGURE 1.8 Metro’s interactive element sizes
  • 50. Random documents with unrelated content Scribd suggests to you:
  • 51. moral nature, and to contemplate, as beings existing external to himself, angels and devils. For, the origin of both representations remains merely subjective, the angel being simply the ideal of created perfection: which, as it was formed from the subordinate point of view of a fanciful imagination, disappears from the higher and more comprehensive observation of the intellect.18 Olshausen, on the other hand, seeks to deduce a positive argument in favour of the reality of the apparition in question, from those very reasonings of the present day which, in fact, negative the existence of angels; and he does so by viewing the subject on its speculative side. He is of opinion that the gospel narrative does not contradict just views of the world, since God is immanent in the universe and moves it by his breath.19 But if it be true that God is immanent in the world, precisely on that account is the intervention of angels superfluous. It is only a Deity who dwells apart, throned in heaven, who requires to send down his angels to fulfil his purposes on earth. It would excite surprise to find Olshausen arguing thus, did we not perceive from the manner in which this interpreter constantly treats of angelology and demonology, that he does not consider angels to be independent personal entities; but regards them rather as divine powers, transitory emanations and fulgurations of the Divine Being. Thus Olshausen’s conception of angels, in their relation to God, seems to correspond with the Sabellian doctrine of the Trinity; but as his is not the representation of the Bible, as also the arguments in favour of the former prove nothing in relation to the latter, it is useless to enter into further explanation. The reasoning of this same theologian, that we must not require the ordinariness of every-day life for the most pregnant epochs in the life of the human race; that the incarnation of the eternal word was accompanied by extraordinary manifestations from the world of spirits, uncalled for in
  • 52. times less rich in momentous results,20 rests upon a misapprehension. For the ordinary course of every-day life is interrupted in such moments, by the very fact that exalted beings like the Baptist are born into the world, and it would be puerile to designate as ordinary those times and circumstances which gave birth and maturity to a John, because they were unembellished by angelic apparitions. That which the spiritual world does for ours at such periods is to send extraordinary human intelligences, not to cause angels to ascend and descend. Finally, if, in vindication of this narrative, it be stated that such an exhibition by the angel, of the plan of education for the unborn child, was necessary in order to make him the man he should become,21 the assumption includes too much; namely, that all great men, in order by their education to become such, must have been introduced into the world in like manner, or cause must be shown why that which was unnecessary in the case of great men of other ages and countries was indispensable for the Baptist. Again, the assumption attaches too much importance to external training, too little to the internal development of the mind. But in conclusion, many of the circumstances in the life of the Baptist, instead of serving to confirm a belief [100]in the truth of the miraculous history, are on the contrary, as has been justly maintained, altogether irreconcilable with the supposition, that his birth was attended by these wonderful occurrences. If it were indeed true, that John was from the first distinctly and miraculously announced as the forerunner of the Messiah, it is inconceivable that he should have had no acquaintance with Jesus prior to his baptism; and that, even subsequent to that event, he should have felt perplexed concerning his Messiahship (John i. 30 ; Matt. xi. 2 ).22
  • 53. Consequently the negative conclusion of the rationalistic criticism and controversy must, we think, be admitted, namely, that the birth of the Baptist could not have been preceded and attended by these supernatural occurrences. The question now arises, what positive view of the matter is to replace the rejected literal orthodox explanation? [Contents] § 18. NATURAL EXPLANATION OF THE NARRATIVE. In treating the narrative before us according to the rationalistic method, which requires the separation of the pure fact from the opinion of interested persons, the simplest alteration is this: to retain the two leading facts, the apparition and the dumbness, as actual external occurrences; but to account for them in a natural manner. This were possible with respect to the apparition, by supposing that a man, mistaken by Zacharias for a divine messenger, really appeared to him, and addressed to him the words he believed he heard. But this explanation, viewed in connexion with the attendant circumstances, being too improbable, it became necessary to go a step further, and to transform the event from an external to an internal one; to remove the occurrence out of the physical into the psychological world. To this view the opinion of Bahrdt, that a flash of lightning was perhaps mistaken by Zacharias for an angel,23 forms a transition; since he attributes the greater part of the scene to
  • 54. Zacharias’s imagination. But that any man, in an ordinary state of mind, could have created so long and consecutive a dialogue out of a flash of lightning is incredible. A peculiar mental state must be supposed; whether it be a swoon, the effect of fright occasioned by the lightning,24 but of this there is no trace in the text (no falling down as in Acts ix. 4 ); or, abandoning the notion of the lightning, a dream, which, however, could scarcely occur whilst burning incense in the temple. Hence, it has been found necessary, with Paulus, to call to mind that there are waking visions or ecstasies, in which the imagination confounds internal images with external occurrences.25 Such ecstasies, it is true, are not common; but, says Paulus, in Zacharias’s case many circumstances combined to produce so unusual a state of mind. The exciting causes were, firstly, the long- cherished desire to have a posterity; secondly, the exalted vocation of administering in the Holy of Holies, offering up with the incense the prayers of the people to the throne of Jehovah, which seemed to Zacharias to foretoken the acceptance of his own prayer; and thirdly, perhaps an exhortation from his wife as he left his house, similar to that of Rachel to Jacob. Gen. xxx. 1 (!) In [101]this highly excited state of mind, as he prays in the dimly-lighted sanctuary, he thinks of his most ardent wish, and expecting that now or never his prayer shall be heard, he is prepared to discern a sign of its acceptance in the slightest occurrence. As the glimmer of the lamps falls upon the ascending cloud of incense, and shapes it into varying forms, the priest imagines he perceives the figure of an angel. The apparition at first alarms him; but he soon regards it as an assurance from God that his prayer is heard. No sooner does a transient doubt cross his mind, than the sensitively pious priest looks upon himself as sinful, believes himself reproved by the angel, and—here two explanations are possible—either an apoplectic seizure actually deprives him of
  • 55. speech, which he receives as the just punishment of his incredulity, till the excessive joy he experiences at the circumcision of his son restores the power of utterance: so that the dumbness is retained as an external, physical, though not miraculous, occurrence;26 or the proceeding is psychologically understood, namely, that Zacharias, in accordance with a Jewish superstition, for a time denied himself the use of the offending member.27 Reanimated in other respects by the extraordinary event, the priest returns home to his wife, and she becomes a second Sarah. With regard to this account of the angelic apparition given by Paulus, —and the other explanations are either of essentially similar character, or are so manifestly untenable, as not to need refutation— it may be observed that the object so laboriously striven after is not attained. Paulus fails to free the narrative of the marvellous; for by his own admission, the majority of men have no experience of the kind of vision here supposed.28 If such a state of ecstasy occur in particular cases, it must result either from a predisposition in the individual, of which we find no sign in Zacharias, and which his advanced age must have rendered highly improbable; or it must have been induced by some peculiar circumstances, which totally fail in the present instance.29 A hope which has been long indulged is inadequate to the production of ecstatic vehemence, and the act of burning incense is insufficient to cause so extraordinary an excitement, in a priest who has grown old in the service of the temple. Thus Paulus has in fact substituted a miracle of chance for a miracle of God. Should it be said that to God nothing is impossible, or to chance nothing is impossible, both explanations are equally precarious and unscientific.
  • 56. Indeed, the dumbness of Zacharias as explained from this point of view is very unsatisfactory. For had it been, as according to one explanation, the result of apoplexy; admitting Paulus’s reference to Lev. xxi. 16 , to be set aside by the contrary remark of Lightfoot,30 still, we must join with Schleiermacher in wondering how Zacharias, notwithstanding this apoplectic seizure, returned home in other respects healthy and vigorous;31 and that in spite of partial paralysis his general strength was unimpaired, and his long-cherished hope fulfilled. It must also be regarded as a strange coincidence, that the father’s tongue should have been loosed exactly at the time of the circumcision; for if the recovery of speech is to be considered as the effect of joy,32 surely the father must have been far more elated at the birth of the [102]earnestly-desired son, than at the circumcision; for by that time he would have become accustomed to the possession of his child. The other explanation: that Zacharias’s silence was not from any physical impediment, but from a notion, to be psychologically explained, that he ought not to speak, is in direct contradiction to the words of Luke. What do all the passages, collected by Paulus to show that οὐ δύναμαι may signify not only a positive non posse, but likewise a mere non sustinere,33 prove against the clear meaning of the passage and its context? If perhaps the narrative phrase (v. 22 ), οὐκ ἠδύνατο λαλῆσαι αὐτοῖς might be forced to bear this sense, yet certainly in the supposed vision of Zacharias, had the angel only forbidden him to speak, instead of depriving him of the power of speech, he would not have said: καὶ ἔσῃ σιωπῶν, μὴ δυνάμενος λαλῆσαι, but ἴσθι σιωπῶν, μηδ’ ἐπιχειρήσῃς λαλῆσαι. The words διέμενε κωφὸς (v. 21 ) also most naturally mean actual dumbness. This view assumes, and indeed necessarily so, that the gospel history is a correct report of the account given by Zacharias
  • 57. himself; if then it be denied that the dumbness was actual, as Zacharias affirms that actual dumbness was announced to him by the angel, it must be admitted that, though perfectly able to speak, he believed himself to be dumb, which leads to the conclusion that he was mad: an imputation not to be laid upon the father of the Baptist without compulsory evidence in the text. Again, the natural explanation makes too light of the incredibly accurate fulfilment of a prediction originating, as it supposes, in an unnatural, over-excited state of mind. In no other province of inquiry would the realization of a prediction which owed its birth to a vision be found credible, even by the Rationalist. If Dr. Paulus were to read that a somnambulist, in a state of ecstasy, had foretold the birth of a child, under circumstances in the highest degree improbable; and not only of a child, but of a boy; and had moreover, with accurate minuteness, predicted his future mode of life, character, and position in history; and that each particular had been exactly verified by the result: would he find such a coincidence credible? Most assuredly to no human being, under any conditions whatsoever, would he concede the power thus to penetrate the most mysterious workings of nature; on the contrary he would complain of the outrage on human free-will, which is annihilated by the admission that a man’s entire intellectual and moral development may be predetermined like the movements of a clock. And he would on this very ground complain of the inaccuracy of observation, and untrustworthiness of the report which represented, as matters of fact, things in their very nature impossible. Why does he not follow the same rule with respect to the New Testament narrative? Why admit in the one case what he rejects in the other? Is biblical history to be judged by one set of laws, and profane history by another?—An assumption which the Rationalist is compelled to make, if he admits as credible in the
  • 58. Gospels that which he rejects as unworthy of credit in every other history—which is in fact to fall back on the supranaturalistic point of view, since the assumption, that the natural laws which govern in every other province are not applicable to sacred history, is the very essential of supranaturalism. No other rescue from this self-annihilation remains to the anti- supernatural mode of explanation, than to question the verbal accuracy of the history. This is the simplest expedient, felt to be such by Paulus himself, who remarks, that his efforts may be deemed superfluous to give a natural explanation of a narrative, which is nothing more than one of those stories invented either after the death or even during the lifetime of every distinguished man to embellish [103]his early history. Paulus, however, after an impartial examination, is of opinion that the analogy, in the present instance, is not applicable. The principal ground for this opinion is the too short interval between the birth of the Baptist, and the composition of the Gospel of Luke.34 We, on the contrary, in harmony with the observations in the introduction, would reverse the question and inquire of this interpreter, how he would render it credible, that the history of the birth of a man so famed as the Baptist should have been transmitted, in an age of great excitement, through a period of more than sixty years, in all its primitive accuracy of detail? Paulus’s answer is ready: an answer approved by others (Heidenreich, Olshausen):—the passage inserted by Luke i. 5 ; ii. 39 was possibly a family record, which circulated among the relatives of the Baptist and of Jesus; and of which Zacharias was probably the author.35 K. Ch. L. Schmidt controverts this hypothesis with the remark, that it is impossible that a narrative so disfigured (we should rather say, so
  • 59. embellished) could have been a family record; and that, if it does not belong altogether to the class of legends, its historical basis, if such there be, is no longer to be distinguished.36 It is further maintained, that the narrative presents certain features which no poet would have conceived, and which prove it to be a direct impression of facts; for instance, the Messianic expectations expressed by the different personages introduced by Luke (chap. i. and ii.) correspond exactly with the situation and relation of each individual.37 But these distinctions are by no means so striking as Paulus represents; they are only the characteristics of a history which goes into details, making a transition from generalities to particulars, which is natural alike to the poet and to the popular legend; besides, the peculiar Judaical phraseology in which the Messianic expectations are expressed, and which it is contended confirm the opinion that this narrative was written, or received its fixed form, before the death of Jesus, continued to be used after that event Acts i. 6 38. Moreover we must agree with Schleiermacher when he says:39 least of all is it possible to regard these utterances as strictly historical; or to maintain that Zacharias, in the moment that he recovered his speech, employed it in a song of praise, uninterrupted by the exultation and wonder of the company, sentiments which the narrator interrupts himself to indulge. It must, at all events, be admitted that the author has made additions of his own, and has enriched the history by the lyric effusions of his muse. Kuinöl supposes that Zacharias composed and wrote down the canticle subsequent to the occasion; but this strange surmise contradicts the text. There are some other features which, it is contended, belong not to the creations of the poet; such as, the signs made to the father, the debate in the family, the position of the angel on the right hand of the altar.40 But this criticism is merely a
  • 60. proof that these interpreters have, or determine to have, no just conception of poetry or popular legend; for the genuine characteristic of poetry and mythus is natural and pictorial representation of details.41 [104] [Contents] § 19. MYTHICAL VIEW OF THE NARRATIVE IN ITS DIFFERENT STAGES. The above exposition of the necessity, and lastly, of the possibility of doubting the historical fidelity of the gospel narrative, has led many theologians to explain the account of the birth of the Baptist as a poetical composition; suggested by the importance attributed by the Christians to the forerunner of Jesus, and by the recollection of some of the Old Testament histories, in which the births of Ishmael, Isaac, Samuel, and especially of Samson, are related to have been similarly announced. Still the matter was not allowed to be altogether invented. It may have been historically true that Zacharias and Elizabeth lived long without offspring; that, on one occasion whilst in the temple, the old man’s tongue was suddenly paralyzed; but that soon afterwards his aged wife bore him a son, and he, in his joy at the event, recovered the power of speech. At that time, but still more when John became a remarkable man, the history excited attention, and out of it the existing legend grew.42
  • 61. It is surprising to find an explanation almost identical with the natural one we have criticised above, again brought forward under a new title; so that the admission of the possibility of an admixture of subsequent legends in the narrative has little influence on the view of the matter itself. As the mode of explanation we are now advocating denies all confidence in the historical authenticity of the record, all the details must be in themselves equally problematic; and whether historical validity can be retained for this or that particular incident, can be determined only by its being either less improbable than the rest, or else less in harmony with the spirit, interest, and design of the poetic legend, so as to make it probable that it had a distinct origin. The barrenness of Elizabeth and the sudden dumbness of Zacharias are here retained as incidents of this character: so that only the appearing and prediction of the angel are given up. But by taking away the angelic apparition, the sudden infliction and as sudden removal of the dumbness loses its only adequate supernatural cause, so that all difficulties which beset the natural interpretation remain in full force: a dilemma into which these theologians are, most unnecessarily, brought by their own inconsequence; for the moment we enter upon mythical ground, all obligation to hold fast the assumed historical fidelity of the account ceases to exist. Besides, that which they propose to retain as historical fact, namely, the long barrenness of the parents of the Baptist, is so strictly in harmony with the spirit and character of Hebrew legendary poetry, that of this incident the mythical origin is least to be mistaken. How confused has this misapprehension made, for example, the reasoning of Bauer! It was a prevailing opinion, says he, consonant with Jewish ideas, that all children born of aged parents, who had previously been childless, became distinguished personages. John was the child of aged parents, and became a
  • 62. notable preacher of repentance; consequently it was thought justifiable to infer that his birth was predicted by an angel. What an illogical conclusion! for which he has no other ground than the assumption that John was the son of aged parents. Let this be made a settled point, and the conclusion follows without difficulty. It was readily believed, he proceeds, of remarkable men that they were born of aged parents, and that their birth, no longer in the ordinary course of nature to be expected, was announced [105]by a heavenly messenger43; John was a great man and a prophet; consequently, the legend represented him to have been born of an aged couple, and his birth to have been proclaimed by an angel. Seeing that this explanation of the narrative before us, as a half (so called historical) mythus, is encumbered with all the difficulties of a half measure, Gabler has treated it as a pure philosophical, or dogmatical mythus.44 Horst likewise considers it, and indeed the entire two first chapters of Luke, of which it forms a part, as an ingenious fiction, in which the birth of the Messiah, together with that of his precursor, and the predictions concerning the character and ministry of the latter, framed after the event, are set forth; it being precisely the loquacious circumstantiality of the narration which betrays the poet.45 Schleiermacher likewise explains the first chapter as a little poem, similar in character to many of the Jewish poems which we meet with in their apocrypha. He does not however consider it altogether a fabrication. It might have had a foundation in fact, and in a widespread tradition; but the poet has allowed himself so full a license in arranging, and combining, in moulding and embodying the vague and fluctuating representations of tradition, that the attempt to detect the purely historical in such narratives, must prove a fruitless and useless effort.46 Horst goes so far as to suppose the author of the piece to have been a Judaising
  • 63. Christian; whilst Schleiermacher imagines it to have been composed by a Christian of the famed Jewish school, at a period when it comprised some who still continued strict disciples of John; and whom it was the object of the narrative to bring over to Christianity, by exhibiting the relationship of John to the Christ as his peculiar and highest destiny; and also by holding out the expectation of a state of temporal greatness for the Jewish people at the reappearance of Christ. An attentive consideration of the Old Testament histories, to which, as most interpreters admit, the narrative of the annunciation and birth of the Baptist bears a striking affinity, will render it abundantly evident that this is the only just view of the passage in question. But it must not here be imagined, as is now so readily affirmed in the confutation of the mythical view of this passage, that the author of our narrative first made a collection from the Old Testament of its individual traits; much rather had the scattered traits respecting the late birth of different distinguished men, as recorded in the Old Testament, blended themselves into a compound image in the mind of their reader, whence he selected the features most appropriate to his present subject. Of the children born of aged parents, Isaac is the most ancient prototype. As it is said of Zacharias and Elizabeth, “they both were advanced in their days” (v. 7 ) προβεβηκότες ἐν ταῖς ἡμέραις αὐτῶν, so Abraham and Sarah “were advanced in their days” ‫ַּבָיִמים‬ ‫‏ָּבִאים‬ ‎(Gen. xviii. 11 ; LXX: προβεβηκότες ἡμερῶν), when they were promised a son. It is likewise from this history that the incredulity of the father, on account of the advanced age of both [106]parents, and the demand of a sign, are borrowed in our narrative. As Abraham, when Jehovah promises him he shall have a son and a numerous posterity who shall inherit the land of Canaan, doubtingly inquires, “Whereby shall I know that I shall inherit it?”
  • 64. κατὰ τί γνώσομαι, ὄτι κληρονομήσω αὐτήν; (sc. τὴν γῆν. Gen. xv. 8 . LXX.): so Zacharias—“Whereby shall I know this?” κατὰ τί γνώσομαι τοῦτο; (v. 18 .) The incredulity of Sarah is not made use of for Elizabeth; but she is said to be of the daughters of Aaron, and the name Elizabeth may perhaps have been suggested by that of Aaron’s wife (Exod. vi. 23 . LXX.). The incident of the angel announcing the birth of the Baptist is taken from the history of another late-born child, Samson. In our narrative, indeed, the angel appears first to the father in the temple, whereas in the history of Samson he shows himself first to the mother, and afterwards to the father in the field. This, however, is an alteration arising naturally out of the different situations of the respective parents (Judges xiii .). According to popular Jewish notions, it was no unusual occurrence for the priest to be visited by angels and divine apparitions whilst offering incense in the temple.47 The command which before his birth predestined the Baptist—whose later ascetic mode of life was known—to be a Nazarite, is taken from the same source. As, to Samson’s mother during her pregnancy, wine, strong drink, and unclean food, were forbidden, so a similar diet is prescribed for her son,48 adding, as in the case of John, that the child shall be consecrated to God from the womb.49 The blessings which it is predicted that these two men shall realize for the people of Israel are similar (comp. Luke i. 16, 17 , with Judges xiii. 5 ), and each narrative concludes with the same expression respecting the hopeful growth of the child.50 It may be too bold to derive the Levitical descent of the Baptist from a third Old Testament history of a late- born son—from the history of Samuel (compare 1 Sam. i. 1 ; Chron. vii. 27 ); but the lyric effusions in the first chapter of Luke are imitations of this history. As Samuel’s mother, when consigning him to the care of the high priest, breaks forth into a hymn (1 Sam. ii.
  • 65. 1 ), so the father of John does the same at the circumcision; though the particular expressions in the Canticle uttered by Mary—of which we shall have to speak hereafter—have a closer resemblance to Hannah’s song of praise than that of Zacharias. The significant appellation John (‫‏ְיהֹוָחָנן‬ ‎= Θεόχαρις), predetermined by the angel, had its precedent in the announcements of the names of Ishmael and Isaac51; but the ground of its selection was the apparently providential coincidence between the signification of the name and the historical destination of the man. The [107]remark, that the name of John was not in the family (v. 61 ), only brought its celestial origin more fully into view. The tablet (πινακίδιον) upon which the father wrote the name (v. 63 ), was necessary on account of his incapacity to speak; but it also had its type in the Old Testament. Isaiah was commanded to write the significant names of the child Maher-shalal-hash-baz upon a tablet (Isaiah viii. 1 ff. ). The only supernatural incident of the narrative, of which the Old Testament may seem to offer no precise analogy, is the dumbness; and this is the point fixed upon by those who contest the mythical view.52 But if it be borne in mind that the asking and receiving a sign from heaven in confirmation of a promise or prophecy was usual among the Hebrews (comp. Isaiah vii. 11 ff. ); that the temporary loss of one of the senses was the peculiar punishment inflicted after a heavenly vision (Acts ix. 8 , 17 ff. ); that Daniel became dumb whilst the angel was talking with him, and did not recover his speech till the angel had touched his lips and opened his mouth (Dan. x. 15 f. ): the origin of this incident also will be found in the legend, and not in historical fact. Of two ordinary and subordinate features of the narrative, the one, the righteousness of the parents of the Baptist (v. 6 ), is merely a conclusion founded upon the belief that to a pious couple alone would the blessing of such a son be vouchsafed, and
  • 66. 1 2 3 4 5 6 7 8 consequently is void of all historical worth; the other, the statement that John was born in the reign of Herod (the Great) (v. 5 ), is without doubt a correct calculation. So that we stand here upon purely mythical-poetical ground; the only historical reality which we can hold fast as positive matter of fact being this:—the impression made by John the Baptist, by virtue of his ministry and his relation to Jesus, was so powerful as to lead to the subsequent glorification of his birth in connection with the birth of the Messiah in the Christian legend.53 [108] It may here be observed, once for all, that whenever in the following inquiry the names “Matthew,” “Luke,” etc., are used, it is the author of the several Gospels who is thus briefly indicated, quite irrespective of the question whether either of the Gospels was written by an apostle or disciple of that name, or by a later unknown author. ↑ See Kuinöl Comm. in Luc., Proleg., p. 247. ↑ Paulus, exeget. Handbuch, 1 a. s. 78 f. 96. Bauer, hebr. Mythol., 2 Bd. s. 218 f. ↑ Here Michael is called one of the chief princes. ↑ Here Raphael is represented as one of the seven angels which go in and out before the glory of the holy One; (Tobit, xii. 15 ), almost the same as Gabriel in Luke i. 19 , excepting the mention of the number. This number is in imitation of the Persian Amschaspands. Vid. De Wette, bibl. Dogmatik, § 171 b. ↑ Hieros. rosch haschanah f. lvi. 4. (Lightfoot, horæ hebr. et talmud. in IV. Evangg., p. 723): R. Simeon ben Lachisch dicit: nomina angelorum ascenderunt in manu Israëlis ex Babylone. Nam antea dictum est: advolavit ad me unus τῶν Seraphim, Seraphim steterunt ante eum, Jes. vi.; at post: vir Gabriel, Dan. ix. 21 , Michaël princeps vester, Dan. x. 21 . ↑ Olshausen, biblischer Commentar zum N.T., 1 Thl. s. 29 (2te Auflage). Comp. Hoffmann, s. 124 f. ↑ Olshausen, ut sup. Hoffmann, s. 135. ↑
  • 67. 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 Ut sup. s. 77. ↑ Geschichte der drei letzten Lebensjahre Jesu, sammt dessen Jugendgeschichte. Tübingen, 1779. 1 Bd. s. 12. ↑ Bibl. Comm. 1, s. 115. ↑ Hebr. Mythol. ii. s. 218. ↑ Bauer, ut sup. i. s. 129. Paulus, exeget. Handbuch, i. a, 74. ↑ Paulus, Commentar, i. s. 12. ↑ Bauer, ut sup. ↑ Glaubenslehre, 1 Thl. § 42 und 43 (2te Ausgabe). ↑ Binder, Studien der evang. Geistlichkeit Würtembergs, ix. 2, 5. 11 ff. ↑ Compare my Dogmatik, i. § 49. ↑ Bibl. Comm., 1. Thl. s. 119. ↑ Ut sup. s. 92. ↑ Hess, Geschichte der drei letzten Lebensjahre Jesu u. s. w., 1. Thl. s. 13, 33. ↑ Horst in Henke’s Museum, i. 4. s. 733 f. Gabler in seinem neuest. theol. Journal, vii. 1. s. 403. ↑ Briefe über die Bibel im Volkstone (Ausg. Frankfurt und Leipzig, 1800), 1tes Bändchen, 6ter Brief, s. 51 f. ↑ Bahrdt, ut sup. s. 52. ↑ Exeget. Handb. 1, a. s. 74 ff. ↑ Bahrdt, ut sup. 7ter Brief, s. 60.—E. F. über die beiden ersten Kapitel des Matthäus und Lukas, in Henke’s Magazin, v. 1. s. 163. Bauer, hebr. Mythol. 2, s. 220. ↑ Exeget. Handb. 1, a. s. 77–80. ↑ Ut sup. s. 73. ↑ Comp. Schleiermacher über die Schriften des Lukas, s. 25. ↑ Horæ hebr. et talmud., ed. Carpzov. p. 722. ↑
  • 68. 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 Ut sup. s. 26. ↑ Examples borrowed from Aulus Gellius, v. 9, and from Valerius Maximus, i. 8, are cited. ↑ Ut sup. s. 26. ↑ Ut sup. s. 72 f. ↑ Ut sup. s. 69. ↑ In Schmidt’s Bibliothek für Kritik und Exegese, iii. 1, s. 119. ↑ Paulus, ut sup. ↑ Comp. De Wette, exeg. Handb., 1. 2, s. 9. ↑ Über die Schriften des Lukas, s. 23. ↑ Paulus und Olshausen z. d. St., Heydenreich a. a. O. 1, s. 87. ↑ Comp. Horst, in Henke’s Museum, i. 4, s. 705; Vater, Commentar zum Pentateuch, 3, s. 597 ff.; Hase L. J., § 35; auch George, s. 33 f. 91. ↑ E. F. über die zwei ersten Kapitel u. s. w. in Henke’s Magazin, v. 1, s. 162 ff., und Bauer hebr. Mythol., ii. 220 f. ↑ The adoption of this opinion is best explained by a passage—with respect to this matter classical—in the Evangelium de nativitate Mariæ, in Fabricius codex apocryphus N. Ti. 1, p. 22 f., and in Thilo 1, p. 322, “Deus”—it is here said,—cum alicujus uterum claudit, ad hoc facit, ut mirabilius denuo aperiat, et non libidinis esse, quod nascitur, sed divini muneris cognoscatur. Prima enim gentis vestræ Sara mater nonne usque ad octogesimum annum infecunda fuit? et tamen in ultimâ senectutis ætate genuit Isaac, cui repromissa erat benedictio omnium gentium. Rachel quoque, tantum Domino grata tantumque a sancto Jacob amata diu sterilis fuit, et tamen Joseph genuit, non solum dominum Ægypti, sed plurimarum gentium fame periturarum liberatorem. Quis in ducibus vel fortior Sampsone, vel sanctior Samuele? et tamen hi ambo steriles matres habuere.—ergo—crede— dilatos diu conceptus et steriles partus mirabiliores esse solere. ↑ Neuestes theol. Journal, vii. 1, s. 402 f. ↑ In Henke’s Museum, i. 4, s. 702 ff. ↑
  • 69. 46 47 48 49 50 51 Hase in his Leben Jesu makes the same admission; compare § 52 with § 32. ↑ Wetstein zu Luke i. 11 , s. 647 f. adduces passages from Josephus and from the Rabbins recording apparitions seen by the high priests. How readily it was presumed that the same thing happened to ordinary priests is apparent from the narrative before us. ↑ Judges xiii. 14 (LXX.): καὶ οἶνον καὶ σίκερα (al. μέθυσμα, hebr. ‫‏ֵׁשָכר‬ ‎ ) μὴ πιέτω. Luc. i. 15 .: καὶ οἶνον καὶ σίκερα οὐ μὲ πίῃ. Judg. xiii. 5 : ὅτι ἡγιασμένον ἔσται τῷ θεῷ (al. Ναζὶρ θεοῦ ἔσται) τὸ παιδάριον οὐκ τῆς γαστρός (al. ἀπὸ τῆς κοιλίας). Luc. i. 15 .: καὶ πνεύματος ἁγίου πλησθήσεται ἔτι ἐκ κοιλίας μητρός αὐτοῦ. Judg. xiii. 24 f. : καὶ ηὐλόγησεν αὐτὸν Κύριος, καὶ η ’ξήθη (al. ἡδρύνθη) τὸ παιδάριον· καὶ ἤρξατο πνεῦμα Κυρίου συμπορεύεσθαι αὐτῷ ἐν παρεμβολῇ Δὰν, ἀναμὲσον Σαρὰ καὶ ἀναμέσον Ἐσθαόλ. Luc. i. 80 : τὸ δὲ παιδίον ηὔξανε καὶ ἐκραταιοῦτο πνεύματι, κὰι ἦν ἐν ταῖς ἐρήμοις, ἕως ἡμέρας ἁναδείξεως αὐτοῦ πρὸς τὸν Ἰσραήλ. Comp. Gen. xxi. 20. ↑ Gen. xvi. 11 . (LXX.): καὶ καλέσεις τὸ ὄνομα αὐτοῦ Ἰσμαήλ. Luc. i. 13 : καὶ καλέσεις τὸ ὄνομα αὐτοῦ Ἰωάννην. xvii. 19 : — — Ἰσαάκ. ↑
  • 70. 52 53 Olshausen, bibl. Commentar, 1. s. 116. Hoffmann, s. 146. ↑ With this view of the passage compare De Wette, Exeg. Handbuch zum N. T., 1, 2, s. 12. ↑
  • 73. DAVIDICAL DESCENT OF JESUS, ACCORDING TO THE GENEALOGICAL TABLES OF MATTHEW AND LUKE. [Contents] § 20. THE TWO GENEALOGIES OF JESUS CONSIDERED SEPARATELY AND IRRESPECTIVELY OF ONE ANOTHER. In the history of the birth of the Baptist, we had the single account of Luke; but regarding the genealogical descent of Jesus we have also that of Matthew; so that in this case the mutual control of two narrators in some respects multiplies, whilst in others it lightens, our critical labour. It is indeed true that the authenticity of the two first chapters of Matthew, which contain the history of the birth and childhood of Jesus, as well as that of the parallel section of Luke, has been questioned: but as in both cases the question has originated merely in a prejudiced view of the subject, the doubt has been silenced by a decisive refutation.1 Each of these two Gospels contains a genealogical table designed to exhibit the Davidical descent of Jesus, the Messiah. That of Matthew (i. 1–17) precedes, that of Luke (iii. 23–38) follows, the history of the announcement and birth of Jesus. These two tables, considered each in itself, or both compared together, afford so important a key to the character of the evangelic records in this section, as to render
  • 74. a close examination of them imperative. We shall first consider each separately, and then each, but particularly that of Matthew, in comparison with the passages in the Old Testament to which it is parallel. In the Genealogy given by the author of the first Gospel, there is a comparison of the account with itself which is important, as it gives a result, a sum at its conclusion, whose correctness may be proved by comparing it with the previous statements. In the summing up it is said, that from Abraham to Christ there are three divisions of fourteen generations each, the first from Abraham to David, the second from David to the Babylonish exile, the third from the exile to Christ. Now if we compute the number of names for ourselves, we find the first fourteen from Abraham to David, both included, complete (2–5 ); also that from Solomon to Jechonias, after whom the Babylonish exile is mentioned (6–11 ); but from Jechonias to Jesus, even reckoning the latter as one, we can discover only thirteen (12–16 ). How shall we explain this discrepancy? The supposition that one of the names has escaped from the third division by an error of a transcriber,2 is in the highest degree improbable, [109]since the deficiency is mentioned so early as by Porphyry.3 The insertion, in some manuscripts and versions, of the name Jehoiakim4 between Josias and Jechonias, does not supply the deficiency of the third division; it only adds a superfluous generation to the second division, which was already complete. As also there is no doubt that this deficiency originated with the author of the genealogy, the question arises: in what manner did he reckon so as to count fourteen generations for his third series? Truly it is possible to count in various ways, if an arbitrary inclusion and exclusion of the first and last members of the several series be permitted. It might indeed have been presupposed, that a generation already
  • 75. included in one division was necessarily excluded from another: but the compiler of the genealogy may perhaps have thought otherwise; and since David is twice mentioned in the table, it is possible that the author counted him twice: namely, at the end of the first series, and again at the beginning of the second. This would not indeed, any more than the insertion of Jehoiakim, fill up the deficiency in the third division, but give too many to the second; so that we must, with some commentators,5 conclude the second series not with Jechonias, as is usually done, but with his predecessor Josias: and now, by means of the double enumeration of David, Jechonias, who was superfluous in the second division, being available for the third, the last series, including Jesus, has its fourteen members complete. But it seems very arbitrary to reckon the concluding member of the first series twice, and not also that of the second: to avoid which inconsistency some interpreters have proposed to count Josias twice, as well as David, and thus complete the fourteen members of the third series without Jesus. But whilst this computation escapes one blunder, it falls into another; namely, that whereas the expression ἀπὸ Ἀβραὰμ ἕως Δαβὶδ κ.τ.λ. (v. 17 ) is supposed to include the latter, in ἀπὸ μετοικεσίας Βαβυλῶνος ἕως τοῦ Χριστοῦ, the latter is excluded. This difficulty may be avoided by counting Jechonias twice instead of Josias, which gives us fourteen names for the third division, including Jesus; but then, in order not to have too many in the second, we must drop the double enumeration of David, and thus be liable to the same charge of inconsistency as in the former case, since the double enumeration is made between the second and third divisions, and not between the first and second. Perhaps De Wette has found the right clue when he remarks, that in v. 17 , in both transitions some member of the series is mentioned twice, but in the first case only that member is a person (David), and
  • 76. therefore to be twice reckoned. In the second case it is the Babylonish captivity occurring between Josias and Jechonias, which latter, since he had reigned only three months in Jerusalem (the greater part of his life having passed after the carrying away to Babylon), was mentioned indeed at the conclusion of the second series for the sake of connexion, but was to be reckoned only at the beginning of the third.6 If we now compare the genealogy of Matthew (still without reference to that of Luke) with the corresponding passages of the Old Testament, we shall also find discrepancy, and in this case of a nature exactly the reverse of the preceding: for as the table considered in itself required the duplication of one member in order to complete its scheme, so when compared with the Old Testament, we find that many of the names there recorded have been omitted, in order that the number fourteen might not be exceeded. That is to say, the Old Testament affords data for comparison with this genealogical [110]table as the famed pedigree of the royal race of David, from Abraham to Zorobabel and his sons; after whom, the Davidical line begins to retire into obscurity, and from the silence of the Old Testament the genealogy of Matthew ceases to be under any control. The series of generations from Abraham to Judah, Pharez, and Hezron, is sufficiently well known from Genesis; from Pharez to David we find it in the conclusion of the book of Ruth, and in the 2nd chapter of the 1st Chronicles ; that from David to Zerubbabel in the 3rd chapter of the same book; besides passages that are parallel with separate portions of the series. To complete the comparison: we find the line from Abraham to David, that is, the whole first division of fourteen in our genealogy, in exact accordance with the names of men given in the Old
  • 77. Testament: leaving out however the names of some women, one of which makes a difficulty. It is said v. 5 that Rahab was the mother of Boaz. Not only is this without confirmation in the Old Testament, but even if she be made the great-grandmother of Jesse, the father of David, there are too few generations between her time and that of David (from about 1450 to 1050 b.c.), that is, counting either Rahab or David as one, four for 400 years. Yet this error falls back upon the Old Testament genealogy itself, in so far as Jesse’s great- grandfather Salmon, whom Matthew calls the husband of Rahab, is said Ruth iv. 20 , as well as by Matthew, to be the son of Nahshon, who, according to Numbers i. 7 , lived in the time of the march through the wilderness:7 from which circumstance the idea was naturally suggested, to marry his son with that Rahab who saved the Israelitish spies, and thus to introduce a woman for whom the Israelites had an especial regard (compare James ii. 25 , Heb. xi. 31 ) into the lineage of David and the Messiah. Many discrepancies are found in the second division from David to Zorobabel and his son, as well as in the beginning of the third. Firstly, it is said v. 8 Joram begat Ozias; whereas we know from 1 Chron. iii. 11 , 12 , that Uzziah was not the son, but the grandson of the son of Joram, and that three kings occur between them, namely, Ahaziah, Joash, and Amaziah, after whom comes Uzziah (2 Chron. xxvi. 1 , or as he is called 1 Chron. iii. 12 , and 2 Kings xiv. 21 , Azariah). Secondly: our genealogy says v. 11 , Josias begat Jechonias and his brethren. But we find from 1 Chron. iii. 16 , that the son and successor of Josiah was called Jehoiakim, after whom came his son and successor Jechoniah or Jehoiachin. Moreover brethren are ascribed to Jechoniah, whereas the Old Testament mentions none. Jehoiakim, however, had brothers: so that the mention of the brethren of Jechonias in Matthew appears to have
  • 78. Welcome to Our Bookstore - The Ultimate Destination for Book Lovers Are you passionate about books and eager to explore new worlds of knowledge? At our website, we offer a vast collection of books that cater to every interest and age group. From classic literature to specialized publications, self-help books, and children’s stories, we have it all! Each book is a gateway to new adventures, helping you expand your knowledge and nourish your soul Experience Convenient and Enjoyable Book Shopping Our website is more than just an online bookstore—it’s a bridge connecting readers to the timeless values of culture and wisdom. With a sleek and user-friendly interface and a smart search system, you can find your favorite books quickly and easily. Enjoy special promotions, fast home delivery, and a seamless shopping experience that saves you time and enhances your love for reading. Let us accompany you on the journey of exploring knowledge and personal growth! ebookgate.com