第一個Windows Phone程式PhoneApp1

  • warning: Declaration of views_handler_argument::init(&$view, &$options) should be compatible with views_handler::init(&$view, $options) in /home/xnvgu7/public_html/sites/all/modules/views/handlers/views_handler_argument.inc on line 745.
  • warning: Declaration of views_handler_filter::options_validate(&$form, &$form_state) should be compatible with views_handler::options_validate($form, &$form_state) in /home/xnvgu7/public_html/sites/all/modules/views/handlers/views_handler_filter.inc on line 585.
  • warning: Declaration of views_handler_filter::options_submit(&$form, &$form_state) should be compatible with views_handler::options_submit($form, &$form_state) in /home/xnvgu7/public_html/sites/all/modules/views/handlers/views_handler_filter.inc on line 585.
  • warning: Declaration of views_handler_filter_boolean_operator::value_validate(&$form, &$form_state) should be compatible with views_handler_filter::value_validate($form, &$form_state) in /home/xnvgu7/public_html/sites/all/modules/views/handlers/views_handler_filter_boolean_operator.inc on line 149.
  • warning: Declaration of views_plugin_style_default::options(&$options) should be compatible with views_object::options() in /home/xnvgu7/public_html/sites/all/modules/views/plugins/views_plugin_style_default.inc on line 25.
  • warning: Declaration of views_plugin_row::options_validate($form, &$form_state) should be compatible with views_plugin::options_validate(&$form, &$form_state) in /home/xnvgu7/public_html/sites/all/modules/views/plugins/views_plugin_row.inc on line 135.
  • warning: Declaration of views_plugin_row::options_submit($form, &$form_state) should be compatible with views_plugin::options_submit(&$form, &$form_state) in /home/xnvgu7/public_html/sites/all/modules/views/plugins/views_plugin_row.inc on line 135.

使用Windows7。

先下載Microsoft Visual Studio 2010 Express,以後一律稱其為Visual Studio,在桌面做個捷徑。

雙擊Visual Studio後, 出現Start Page。點上方的New Project或點File/New Project。出現New Project頁面。

選左方Recent Templates/Visual C#/Silverlight for Windows Phone,右方template樣本顯示板會出現許多樣本,選Windows Phone Application後,在左下方Name:右鍵入PhoneApp1,此時其下方Solution name:右的內容會跟著改,接著在Location:最右方點Browse,並選好資料夾(C:\Users\liz\Desktop\Mango Project\),確定Browse下Create directory for solution已勾選後,點右下方OK。 注意:

在這一連串的選擇裡,Visual C#/Silverlight for Windows Phone是關鍵字,C#表示用C#語言(C#唸為CShop),Silverlight for Windows Phone表示非遊戲類(另一種是XNA Game Studio 4.0)。

此時右方應出現Solution Explorer視窗,若沒有,點View/Other Windows/Solution Explorer即可。

同時,點View/Other Windows/Error List打開Error List視窗(出現在下方)。兩視窗均可點其右上方向下小箭頭再點Dock固定位置。

打開Solution Explorer後,點MainPage.xaml(xaml唸為zamal),結果如下,左邊是MainPage.xaml的圖象,右邊是產生圖像的語法。MainPage.xaml就是PhoneApp1 project的第一個畫面。左邊的MY APPLICATION及Page Name兩句均可在右邊<TextBlock../>中找到。

點F5或Debug/Start Debugging即可用simulator跑這第一個 Windows Phone 程式。結果如下:

注意,我的vista在按下F5後會出現訊息,不管它,繼續。

 

第一個Windows Phone程式PhoneApp1:2012-05-18星期六