10
Simple Interesting Hello World With Windows Phone 7  1 1 By Yoza Wiratama | yozawiratama.net Windows Phone 7 Simple Interesting Hello World By : Yoza Wiratama Objective : 1. Create simple hello world with click event in application bar button 1. Visual Studio and Windows Phone SDK 2. Create Textbox using XAML Code 3. Application Bar with XAML Code and Click Trigger 2. Use List<> in windows phone Visual Studio and Windows Phone SDK 1. Open Visual Studio Open Your Visual Studio and you will see the start page first : Solution Explorer 2. Click New Project Click New Project and select Silverlight for Windows Phone in Installed Templates for Visual C#. After That select Windows Phone Application, Change your project name : Hello World, or you can change with according what you want. Then Click OK 

Simple Interesting Hello World With Windows Phone 7

Embed Size (px)

Citation preview

Page 1: Simple Interesting Hello World With Windows Phone 7

8/3/2019 Simple Interesting Hello World With Windows Phone 7

http://slidepdf.com/reader/full/simple-interesting-hello-world-with-windows-phone-7 1/9

Simple Interesting Hello World With Windows Phone 7  1

1  By Yoza Wiratama | yozawiratama.net

Windows Phone 7

Simple Interesting Hello World

By : Yoza Wiratama

Objective : 

1.  Create simple hello world with click event in application bar button

1.  Visual Studio and Windows Phone SDK

2.  Create Textbox using XAML Code

3.  Application Bar with XAML Code and Click Trigger

2.  Use List<> in windows phone

Visual Studio and Windows Phone SDK

1.  Open Visual Studio

Open Your Visual Studio and you will see the start page first :

Solution Explorer

2.  Click New Project

Click New Project and select Silverlight for Windows Phone in Installed Templates for Visual C#. After That

select Windows Phone Application, Change your project name : Hello World, or you can change with

according what you want. Then Click OK 

Page 2: Simple Interesting Hello World With Windows Phone 7

8/3/2019 Simple Interesting Hello World With Windows Phone 7

http://slidepdf.com/reader/full/simple-interesting-hello-world-with-windows-phone-7 2/9

Simple Interesting Hello World With Windows Phone 7  2

2  By Yoza Wiratama | yozawiratama.net

New Project

3.  Target OS Version

Select Windows Phone OS 7.0 for the version, then click OK 

OS Version

4.  Solution ExplorerIn this solution explorer you can see all your document for the project you create.

Page 3: Simple Interesting Hello World With Windows Phone 7

8/3/2019 Simple Interesting Hello World With Windows Phone 7

http://slidepdf.com/reader/full/simple-interesting-hello-world-with-windows-phone-7 3/9

Simple Interesting Hello World With Windows Phone 7  3

3  By Yoza Wiratama | yozawiratama.net

5.  Change Page Title

Double Click in MainPage.xaml in Solution explorer and you will open MainPage.xaml.

MainPage.xaml

On design view click on text “page name” and code view directliy focus in :

<TextBlock 

x:Name="PageTitle" 

Text="page name" Margin="9,-7,0,0" 

Style="{StaticResource PhoneTextTitle1Style}"/>

Page 4: Simple Interesting Hello World With Windows Phone 7

8/3/2019 Simple Interesting Hello World With Windows Phone 7

http://slidepdf.com/reader/full/simple-interesting-hello-world-with-windows-phone-7 4/9

Simple Interesting Hello World With Windows Phone 7  4

4  By Yoza Wiratama | yozawiratama.net

Change page name in textblock

Change text in Text="page name"  page name to be Text="Hello World!"

Change to be Hello World! In textblock

6.  Insert Image

In solution explorer, right click on Hello World select add , then New Folder change name to be Images. And

also right click on Images Folder, add, then Existing File Or you can Shift + Alt + A.

Open File window will open, and open :C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v7.0\Icons\dark

Add three icon :

1.  appbar.back.rest.png

2.  appbar.check.rest.png

3.  appbar.next.rest.png

Then add.

Select three of that image using Hold shift + Click, look at properties. In Build Action change to Content.

Page 5: Simple Interesting Hello World With Windows Phone 7

8/3/2019 Simple Interesting Hello World With Windows Phone 7

http://slidepdf.com/reader/full/simple-interesting-hello-world-with-windows-phone-7 5/9

Simple Interesting Hello World With Windows Phone 7  5

5  By Yoza Wiratama | yozawiratama.net

Insert Images

7.  XAML Code

In xaml code write this code :

Page 6: Simple Interesting Hello World With Windows Phone 7

8/3/2019 Simple Interesting Hello World With Windows Phone 7

http://slidepdf.com/reader/full/simple-interesting-hello-world-with-windows-phone-7 6/9

Simple Interesting Hello World With Windows Phone 7  6

6  By Yoza Wiratama | yozawiratama.net

MainPage.xaml

8.  C# Code

Right Click in xaml and select View Code, and you will open MainPage.xaml.cs

MainPage.xaml.cs

9.  Run project with F5 

Page 7: Simple Interesting Hello World With Windows Phone 7

8/3/2019 Simple Interesting Hello World With Windows Phone 7

http://slidepdf.com/reader/full/simple-interesting-hello-world-with-windows-phone-7 7/9

Simple Interesting Hello World With Windows Phone 7  7

7  By Yoza Wiratama | yozawiratama.net

Page 8: Simple Interesting Hello World With Windows Phone 7

8/3/2019 Simple Interesting Hello World With Windows Phone 7

http://slidepdf.com/reader/full/simple-interesting-hello-world-with-windows-phone-7 8/9

Simple Interesting Hello World With Windows Phone 7  8

8  By Yoza Wiratama | yozawiratama.net

Use List<> in windows phone

1.  XAML Code

Update your ApplicationBar xaml code :

2.  C# Code

1.  Add List<> in class and can access for all method :

Page 9: Simple Interesting Hello World With Windows Phone 7

8/3/2019 Simple Interesting Hello World With Windows Phone 7

http://slidepdf.com/reader/full/simple-interesting-hello-world-with-windows-phone-7 9/9

Simple Interesting Hello World With Windows Phone 7  9

9  By Yoza Wiratama | yozawiratama.net

2.  ApplicationBarButton Event :

3.  Run Project with F5, you can click next, check and back button.