Namespaces
Variants
Actions
Revision as of 16:22, 28 December 2012 by vdharankar (Talk | contribs)

Creating your first Windows Phone app

Jump to: navigation, search

This article explains how to ...

WP Metro Icon Baby.png
Article Metadata

Article
Created: (23 Jan 2013)
Last edited: vdharankar (28 Dec 2012)

Introduction

This tutorial will explain how to create your first Windows Phone app using Expression Blend.

How to...

  • Start with the new project
  • Select ‘Windows Phone Application’
  • Assign some suitable name to the application
  • Click Finish
  • You should land up with the same screen like in the previous tutorial.
  • Set the view percentage to suitable value
  • Delete both the TextBlock controls from page
  • Drag a button from ToolBox to the page

T2im1.png

  • Click on the button to reposition it at the bottom center, using Selection Tool
  • Click two times inside the button and change its title to “About”

T2im2.png

  • Select button with selection tool
  • See all the events offered by button in properties window
  • Double click on empty click event to add event handler

T2im3.png

  • Observe the click event handler function in the class called as MainPage
  • MainPage is derived from PhoneApplicationPage

T2im4.png

  • Type following line of code in the click event handler function
MessageBox.Show("MyFirst WP application !");
  • Press F5 to run and test the app developer so far. Result will be as shown below

T2im5.png

Above image explains how the application will appear in emulator

  • Click on XAML page to go to design of the page

T2im6.png

  • Drag a TextBlock and two Buttons on Page and place them on page
  • User Selection too to reposition them on page

T2im7.png

  • Select the TextBlock and set its name property as “txtCount” ( this will be used to change the Properties of TextBlock)
  • Change name of first Button to “btnUp” and second to Button to “btnDown” by selecting the Buttons one by one

T2im8.png

  • Click two times (not the double click) on the Button to change title of first Button as “up” and then second Button to “down”
  • Click two times on TextBlock and change the title to “0”

T2im9.png

  • Now select Button first “btnUp” and goto “click” event in property window
  • Double click on property window to add click event handler
  • Change the code as follows then press F5 and test the app.

T2im10.png

  • Now switch to design view select second Button “btnDown” and goto “click” event in property window
  • Double click on property window to add click event handler
  • Change the code as follows then press F5 and test the app.

T2im11.png

This finishes the application which counts up the counter and down.

Summary

This tutorial gives handson experience of developing your first application on WP using expression blend.



237 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved