Install ติดตั้ง Visual Studio 2013 สำหรับเขียน Windows Phone 8 |
Install ติดตั้ง Visual Studio 2013 สำหรับเขียน Windows Phone 8 สำหรับ Visual Studio 2013 ในปัจจุบันสามารถเขียน Apps บน Windows Phone 8.0 และ 8.1 และสามารถ Download Version ที่เป็น Express เพื่อนำมาติดตั้งและใช้งานได้ฟรี โดย Feature ใหม่ที่น่าสนใจคือ Windows Phone จะสามารถใช้ภาษา JavaScript เขียนได้ ด้วยการใช้ API ของ JavaScript ที่ถูกสร้างไว้สำหรับ Windows Phone โดยเฉพาะ
Windows Phone จะใช้ Visual Studio Express 2013 for Windows โดย Version นี้สามารถรองรับการเขียน Windows Phone 8.0,8.1 และ Windows Store apps และสามารถติดตั้งได้ใน OS ของ Windows 8.1 เป็นต้นไปเท่านั้น
Supported operating systems
- Windows 8.1 (x86 and x64)
Download Visual Studio Express 2013 for Windows

Visual Studio Express 2013 for Windows

หลังจากที่ Download ได้แล้วให้ทำการติดตั้ง

โปรแกรมอาจจะให้เราทำการ Restart เครื่องซะ 1 ครั้ง จากนั้นค่อยติดตั้งใหม่อีกครั้ง

การติดตั้งอาจจะใช้เวลาประมาณ 30-60 นาที ขึ้นอยู่กับความเร็วของอินเตอร์เน็ต โดยไฟล์ที่ Download จะมีขนาดประมาณ 9xx MB

ติดตั้งเรียบร้อยแล้ว

หลังจากที่ติดตั้งเรียบร้อยแล้ว สามารถเปิดโปรแกรม Visual Studio 2013 ได้ทันที โดยหน้าจอของ Visual Studio 2013 ธีมที่เป็นค่า Default จะออกเป็นธีมสีดำ ๆ (ซึ่งทางผมเองก็ไม่ค่อยอย่างมาก)

ขั้นตอนการสร้างโปรเจคของ Windows Phone บน Visual Studio 2013

เลือกเมนู FILE -> New Project

ใน Visual Studio 2013 หรือ Windows Phone 8 จะรองรับการเขียนด้วย JavaScript , VB.Net ,C# และ C++ แต่ภาษาที่ได้รับความนิยมมากที่สุดยังเป็น C#

สามารถสร้างด้วยภาษา VB.Net

ให้เลือกเป็น Visual C# -> Store Apps -> Blank App (Windows Phone Silverlight)

สามารถเลือก Version ของ Windows Phone โดยใน VS 2013 รองรับการเขียนได้ทั้ง Version 8.0 และ 8.1

หลังจากที่สร้างโปรเจคเรียบร้อยแล้ว ถ้าเลือกเขียนด้วย C# จะประกอบด้วย 2 ไฟล์คือ .xaml (Layout) และ .xaml.cs (C#)
MainPage.xaml
<phone:PhoneApplicationPage
x:Class="myPhoneApp.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
shell:SystemTray.IsVisible="True">
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!--TitlePanel contains the name of the application and page title-->
<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
<TextBlock Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}" Margin="12,0"/>
<TextBlock Text="page name" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
</StackPanel>
<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
</Grid>
</Grid>
</phone:PhoneApplicationPage>
MainPage.xaml.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using myPhoneApp.Resources;
namespace myPhoneApp
{
public partial class MainPage : PhoneApplicationPage
{
// Constructor
public MainPage()
{
InitializeComponent();
}
}
}
การรัน Windows Phone

หน้าจอของ Emulator ไว้สำหรับรันโปรแกรม Windows Phone

สามารถรันบน Emulator ได้โดยมีให้เลือกในหลาย ๆ รุ่น

ทดสอบการทำงานของ Apps บน Emulator
.
|
ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท
|
|
|
By : |
ThaiCreate.Com Team (บทความเป็นลิขสิทธิ์ของเว็บไทยครีเอทห้ามนำเผยแพร่ ณ เว็บไซต์อื่น ๆ) |
|
Score Rating : |
   |
|
|
Create/Update Date : |
2014-07-23 12:11:40 /
2017-03-25 21:31:07 |
|
Download : |
No files |
|
Sponsored Links / Related |
|
|
|
|
|
|
|