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

原创
云计算
本文用插图的形式展示了如何在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中

 


 

责任编辑:王勇 来源: 来源:51CTO
相关推荐

2011-03-22 09:45:56

Windows AzuSilverlight

2010-11-25 10:05:22

Visual StudSilverlightWCF

2011-05-05 18:08:43

云计算Windows AzuPaaS

2009-04-16 10:15:34

Windows AzuSilverLight托管

2011-03-23 16:44:22

AzureASP.NET应用程序

2011-03-10 10:20:37

应用程序Windows Azu

2011-03-15 16:12:00

Windows AzuWCF

2015-02-02 15:46:59

Web应用架构大数据

2011-03-10 10:45:47

Azure“Hello Worl

2023-06-04 17:28:19

数字驱动开发Azure

2010-06-08 09:40:46

jQueryWindows Azu

2012-02-15 13:26:56

IndexedDB

2011-03-21 15:22:04

Azure应用程序

2010-01-04 10:41:14

Silverlight

2011-03-15 16:07:33

Windows AzuWCF

2011-03-15 19:45:27

Windows Azu

2011-11-23 10:06:32

Azure微软移动应用

2011-03-15 15:43:39

Windows AzuWCF

2009-08-28 16:43:08

AutoCAD托管C#

2022-12-25 18:03:13

Debug原理软件
点赞
收藏

51CTO技术栈公众号