在Windows Azure中托管和調(diào)試Silverlight應(yīng)用程序(下)
原創(chuàng)本文接《在Windows Azure中托管和調(diào)試Silverlight應(yīng)用程序(上)》
步驟4
在XAML中添加一些代碼。我在Silverlight頁面上添加了一個按鈕和這個按鈕的“Click”事件,在調(diào)試模式中,我會在一個消息框中顯示一個消息:
MainPage.Xaml
<UserControl x:Class="SilverlightApplication1.MainPage"
xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation
xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml
xmlns:d=http://schemas.microsoft.com/expression/blend/2008
xmlns:mc=http://schemas.openxmlformats.org/markup-compatibility/2006
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<Grid x:Name="LayoutRoot" Background="White">
<Button x:Name="myButton" Height="200" Width="300" Background="Navy" Content="ClickMe" Click="myButton_Click" />
</Grid>
</UserControl>
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.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
namespace SilverlightApplication1
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();
}
private void myButton_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show("I am Debugging Silverlight in Azure ");
}
}
}
輸出:
步驟5
在Azure中調(diào)試Silverlight。
在C#代碼中插入一個斷點,然后你就可以調(diào)試這個被托管在Azure中的Silverlight應(yīng)用程序了:
在運行中:
所以,Silverlight應(yīng)用程序是在調(diào)試模式中。
總結(jié)
在本文中,我討論了如何在Windows Azure中托管和調(diào)試一個Silverlight應(yīng)用程序。感謝您的閱讀!
原文名:Hosting and Debugging Silverlight in Windows Azure 作者:Dhananjay Kumar
本文接《在Windows Azure中托管和調(diào)試Silverlight應(yīng)用程序(上)》
【本文乃51CTO精選譯文,轉(zhuǎn)載請標(biāo)明出處!】
【編輯推薦】
- 微軟公布云計算平臺Azure收費模式細(xì)節(jié)
- 云計算意在長遠(yuǎn),微軟云計算服務(wù)Windows Azure已經(jīng)啟用
- 技術(shù)透析:Windows Azure Platform框架與組成
- 微軟Windows Azure Platform技術(shù)解析
- 走近微軟云:SQL Server到Azure數(shù)據(jù)同步
- 當(dāng)微軟Azure遭遇亞馬遜EC2:五大關(guān)鍵區(qū)別
- Windows Azure云計算平臺新增五大功能
- 云計算前途光明 Azure用戶數(shù)突破31000
- 如何把應(yīng)用程序部署到Windows Azure中