Silverlight on Windows Phone Specific Features on Windows Phone Developing a Simple Windows Phone...

download Silverlight on Windows Phone Specific Features on Windows Phone Developing a Simple Windows Phone Application

of 157

  • date post

    23-Sep-2020
  • Category

    Documents

  • view

    0
  • download

    0

Embed Size (px)

Transcript of Silverlight on Windows Phone Specific Features on Windows Phone Developing a Simple Windows Phone...

  • i

  • ii

    FOREWORD All the praises and gratitude to Allah SWT for the chance and the strength to compile and finish this e-book

    titled “Silverlight for Windows Phone: LEARN & PRACTICE”. It has been a enjoyable journey because

    Windows Phone is Microsoft’s latest mobile platform that is fascinating for end users, and for developers as

    well. I also like to express my gratitude to Ronald Rajagukguk, for his introduction to the community, and for

    being an inspiration to keep learning, and always look for opportunities of self-improvement.

    WHAT WE CAN LEARN

     Windows Phone Overview

     Using Windows Phone Development Tools

     Silverlight on Windows Phone

     Specific Features on Windows Phone

     Developing a Simple Windows Phone Application

    TARGET READER

    This e-book is written for those who want to get to know, use, and develop applications for Windows Phone,

    Microsoft’s latest mobile platform. Of course, it would be naive to consider that this e-book covers the topic

    about Windows Phone entirely, but it can undoubtedly give you a good basic to learn. In this e-book you will

    not find topics that require advanced hardware supports such as multi-touch or FM, because this e-book is

    written based on the available emulator.

    The readers are assumed to at least understand the C# programming language. Readers are also expected to

    have used Visual Studio. An understanding in Silverlight is also advisable.

    Wise men say, “you bind knowledge by writing them”; therefore this e-book is dedicated to community

    members, and hopefully will be of use for us all.

    Enjoy! :)

    Puja Pramudya

    puja.pramudya@gmail.com

    http://geeks.netindonesia.net/blogs/poedja

    Microsoft Innovation Center

    Bandung Institute of Technology

    Indonesia

    mailto:puja.pramudya@gmail.com http://geeks.netindonesia.net/blogs/poedja

  • iii

    CONTENTS

    Foreword ............................................................................................................................................................. i

    What We Can Learn ....................................................................................................................................... ii

    Target Reader ................................................................................................................................................. ii

    PART I OVERVIEW ............................................................................................................................................... 1

    Windows Phone ............................................................................................................................................. 2

    Silverlight and Windows Phone ...................................................................................................................... 3

    Application Life Cycle ................................................................................................................................. 4

    Security....................................................................................................................................................... 7

    Development Requirements .......................................................................................................................... 9

    System Requirements................................................................................................................................. 9

    Windows Phone Emulator Requirements .................................................................................................. 9

    PART II LEARN ................................................................................................................................................... 10

    You Had Me At “Hello World” ...................................................................................................................... 11

    Navigations on Windows Phone ................................................................................................................... 14

    Navigating Between Pages ....................................................................................................................... 14

    Passing Parameters Between Pages ......................................................................................................... 16

    Pivot and Panorama ................................................................................................................................. 18

    Dealing with Page Orientations .................................................................................................................... 26

    Application Bar ............................................................................................................................................. 30

    Global Application Bar .............................................................................................................................. 30

    Local Application Bar ................................................................................................................................ 32

    Local Application Bar (Programmatic Approach) ...................................................................................... 34

    Inserting Event Handler ............................................................................................................................ 35

    Web Service Consumption ........................................................................................................................... 38

    Access via Generated Class....................................................................................................................... 38

    Using Standard HTTP Request .................................................................................................................. 46

    Working with Data ....................................................................................................................................... 48

    Using Isolated Storage .................................................................................................................................. 54

    SIP Layout ..................................................................................................................................................... 60

    Getting to Know Web Browser ..................................................................................................................... 64

    Globalization & Localization ......................................................................................................................... 68

    Globalization ............................................................................................................................................ 68

  • iv

    Localization............................................................................................................................................... 71

    Location Based System ................................................................................................................................. 79

    Getting to Know Accelerometer ................................................................................................................... 84

    Bing Maps Control for Windows Phone ....................................................................................................... 91

    Registering Bing Maps Account ................................................................................................................ 91

    Using Bing Maps Control .......................................................................................................................... 92

    PART III PRACTICE ............................................................................................................................................. 96

    #1 - Unit Converter ....................................................................................................................................... 97

    Preparing the Main Interface ................................................................................................................... 97

    Converting .............................................................................................................................................. 101

    Adding Culture List ................................................................................................................................. 104

    Saving User Preferences ......................................................................................................................... 107

    #2 – Stock Screen ....................................................................................................................................... 110

    Preparing Data for Company Stock Values ............................................................................................. 110

    Preparing Company Stock List Page........................................................................................................ 119

    Company Stock Detail Navigation .......................................................................................................... 126

    Preparing t