windows phone 7釋出快接近半年了,對它神往已久,最近想入手一台,可以手頭資金短缺,隻能再觀望一兩個月了。我看到網上流傳着“12歲少年開發WP7應用很受歡迎”,看了介紹他的視訊,不得不感慨。但這背後跟WP7簡單易用的開發環境是分不開的,我就想這會不會是微軟在做廣告......少說廢話了,還是來看看如何搭建WP7開發環境吧。
1、下載下傳開發工具
貌似是評估闆,免費的。
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=04704acf-a63a-4f97-952c-8b51b34b00ce
這個是2010-10的,今年1月微軟也有相應的更新,這個我還沒安裝。
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=49B9D0C5-6597-4313-912A-F0CCA9C7D277
2、入門示例
貌似WP7開發很簡單,界面開發使用WPF。建立一個項目:silverlight for Windows Phone 中選擇Windows Phone Application。接下來你可以随便拖動任意控件到界面上,使用C#進行開發,然後用仿真器進行調試。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
namespace WindowsPhoneApplication1
{
public partial class MainPage : PhoneApplicationPage
{
// Constructor
public MainPage()
{
InitializeComponent();
}
private void button1_Click(object sender, RoutedEventArgs e)
{
textBox1.Text = "Hello World!";
}
}
}