本文接《在Windows Azure中托管和调试Silverlight应用程序(上)》
步骤4
在XAML中添加一些代码。我在Silverlight页面上添加了一个按钮和这个按钮的“Click”事件,在调试模式中,我会在一个消息框中显示一个消息:
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中调试Silverlight。
在C#代码中插入一个断点,然后你就可以调试这个被托管在Azure中的Silverlight应用程序了:
在运行中:
所以,Silverlight应用程序是在调试模式中。
总结
在本文中,我讨论了如何在Windows Azure中托管和调试一个Silverlight应用程序。感谢您的阅读!
原文名:Hosting and Debugging Silverlight in Windows Azure 作者:Dhananjay Kumar
本文接《在Windows Azure中托管和调试Silverlight应用程序(上)》
【本文乃51CTO精选译文,转载请标明出处!】
【编辑推荐】
- 微软公布云计算平台Azure收费模式细节
- 云计算意在长远,微软云计算服务Windows Azure已经启用
- 技术透析:Windows Azure Platform框架与组成
- 微软Windows Azure Platform技术解析
- 走近微软云:SQL Server到Azure数据同步
- 当微软Azure遭遇亚马逊EC2:五大关键区别
- Windows Azure云计算平台新增五大功能
- 云计算前途光明 Azure用户数突破31000
- 如何把应用程序部署到Windows Azure中