在Windows Azure中托管和调试Silverlight应用程序(下)

树叶云

在Windows Azure中托管和调试Silverlight应用程序(下)

原创
作者:编译/周雪峰 2011-03-22 10:03:55

云计算 本文用插图的形式展示了如何在Windows Azure的local development fabric中托管和调试一个Silverlight应用程序。

本文接《在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精选译文,转载请标明出处!】

【编辑推荐】 

  1. 微软公布云计算平台Azure收费模式细节
  2. 云计算意在长远,微软云计算服务Windows Azure已经启用
  3. 技术透析:Windows Azure Platform框架与组成
  4. 微软Windows Azure Platform技术解析
  5. 走近微软云:SQL Server到Azure数据同步
  6. 当微软Azure遭遇亚马逊EC2:五大关键区别
  7. Windows Azure云计算平台新增五大功能
  8. 云计算前途光明 Azure用户数突破31000
  9. 如何把应用程序部署到Windows Azure中

 

 

文章来源网络,作者:运维,如若转载,请注明出处:https://shuyeidc.com/wp/251729.html<

(0)
运维的头像运维
上一篇2025-04-29 02:57
下一篇 2025-04-29 02:58

相关推荐

发表回复

您的邮箱地址不会被公开。必填项已用 * 标注