自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Expression Blend 4 for Windows Phone實踐教程

移動開發(fā)
本文將為您講述如何在Expression Blend 4中創(chuàng)建Windows Phone 7應用程序,其中包括安裝Expression Blend 4 for Windows Phone、新建第一個項目、運行程序以及調(diào)試程序等步驟。

 

之前51CTO移動開發(fā)頻道曾為您介紹過《Expression Blend 4基礎(chǔ)繪圖應用講解》,本文將為您講述如何在Expression Blend中創(chuàng)建Windows Phone 7 應用程序。

1.安裝Expression Blend 4 for Windows Phone

當安裝了Expression Blend 4英文版以及Microsoft Windows Developer Tools - ENU之后,再次運行安裝程序(下載地址http://www.microsoft.com/expression/service-packs/Blend.aspx,點擊DOWNLOAD THE WINDOWS PHONE DEVELOPER TOOLS(http://go.microsoft.com/fwlink/?LinkID=185584)。運行按照程序,選擇Installation Options:

Expression Blend 4 for Windows Phone 7實踐

勾選Microsoft Expression Blend 4 for Windows Phone后,點擊Next:

Expression Blend 4 for Windows Phone 7實踐 

Expression Blend 4 for Windows Phone 7實踐 

Expression Blend 4 for Windows Phone 7實踐

安裝完畢。

#p#

2.在Blend中新建WindowsPhoneHelloWorld項目

啟動Expression Blend,選擇新建項目:

選擇新建項目

輸入項目名稱WindowsPhoneHelloWorld:

輸入項目名稱WindowsPhoneHelloWorld

點擊OK按鈕創(chuàng)建項目完畢:

點擊OK按鈕創(chuàng)建項目

在上圖中,我們可以看到整個Blend的工作區(qū)了;在Blend中我們可以更好更方便的設(shè)計應用程序界面。

選中TextBlock控件PageTitle,設(shè)置其Text屬性為Hello World!

設(shè)置其Text屬性為Hello World

也可直接修改XAML:

  1. <!--TitlePanel contains the name of the application and page title--> 
  2.   <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28" Grid.ColumnSpan="2"> 
  3.    <TextBlock x:Name="ApplicationTitle" Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}"/> 
  4.    <TextBlock x:Name="PageTitle" Text="Hello World!" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/> 
  5.   </StackPanel> 

#p#

3.運行程序

點擊F5,Blend即會把程序部署到模擬器上,并且運行模擬器:

運行模擬器

#p#

4.調(diào)試程序

在MainPage.xaml.cs中添加一行代碼用于彈出一個對話框:

  1. using System;  
  2. using System.Collections.Generic;  
  3. using System.Linq;  
  4. using System.Net;  
  5. using System.Windows;  
  6. using System.Windows.Controls;  
  7. using System.Windows.Documents;  
  8. using System.Windows.Input;  
  9. using System.Windows.Media;  
  10. using System.Windows.Media.Animation;  
  11. using System.Windows.Shapes;  
  12. using Microsoft.Phone.Controls;  
  13.  
  14. namespace WindowsPhoneHelloWorld  
  15. {  
  16.     public partial class MainPage : PhoneApplicationPage  
  17.     {  
  18.         public MainPage()  
  19.         {  
  20.             InitializeComponent();  
  21.      
  22.    MessageBox.Show("Test Debug in Blend""Test", MessageBoxButton.OKCancel);  
  23.         }  
  24.     }  

 

由于Expression Blend本身是一個設(shè)計工具,并不支持調(diào)試功能,我們可以將項目在Visual Studio中運行調(diào)試。

在Projects面板中,選擇項目,單擊右鍵選擇Edit in Visual Studio:

單擊右鍵選擇Edit in Visual Studio

如果遇到錯誤Cannot open in visual studio  the requested operation requires elevation,請以管理員身份運行Blend:

請以管理員身份運行Blend

以下為程序在Visual Studio 2010中打開的界面:

Visual Studio 2010

打開MainPage.xaml.cs,添加斷點,點擊調(diào)試按鈕即可開始調(diào)試:

點擊調(diào)試按鈕 

調(diào)試 

調(diào)試

將Express Blend這個強大的設(shè)計工具與Visual Studio結(jié)合,可以更輕松的創(chuàng)建精彩的應用程序!

原文鏈接:http://kosmisch.net/archive/2011/06/15/6c7fc4199113d162dab4bd37.aspx

責任編輯:王曉東 來源: kosmisch.net
相關(guān)推薦

2012-04-25 09:52:05

Expression

2012-04-10 10:02:06

春Phone沙龍Windows Pho營銷

2013-04-23 17:11:47

Windows Pho用Express Bl

2009-07-14 11:03:07

Expression SketchFlowSilverlight

2009-07-30 10:09:14

Expression Make Into C

2009-07-14 10:55:26

Expression SketchFlow

2013-04-17 09:47:10

Windows PhoWindows Pho

2012-04-10 12:34:25

春Phone沙龍

2012-04-19 08:42:22

春Phone沙龍

2012-03-07 11:30:09

PhoneGapWindows Pho

2011-11-03 15:55:40

Windows Pho

2010-04-26 13:48:17

iPhone OSiOSWindows Pho

2011-11-21 09:15:22

Windows Pho應用商店

2011-12-22 14:36:36

PhoneGapWindows Pho環(huán)境搭建

2013-07-30 12:37:56

Windows PhoWindows Pho

2010-04-21 17:07:54

Windows Pho

2010-08-11 10:22:33

Windows Pho圖形特效插件

2011-04-08 10:02:06

日歷Windows Pho

2010-04-08 17:40:23

Windows Pho

2009-03-06 19:14:41

Windows Pho微軟
點贊
收藏

51CTO技術(shù)棧公眾號