Communicate with different Silverlight Application in the browser

来源:互联网 发布:淘宝优惠券有风险吗 编辑:程序博客网 时间:2024/06/08 07:30

1. Create two Silverlight Applications which are sharing the same asp.net application. When rebuilt the two SL application, the *.xap files will be generated to the folder ./ClientBin

 

2. Imported the two Silverlight xap to the same asp.net or html page.

 

3. In the two SilverLight Applications add the namespace "using System.Windows.Messaging;"

 

4. In the first SL application, which we call it sender, add the following code accordingly.

 

5. In the second SL application, which we call it Receiver, add the following code accordingly.

 

when we run the application, and click the button in the first application, the message will be displayed in the second Silverlight application.

原创粉丝点击