Skip to main content

Microsoft Silverlight

Answered Question call a silverlight application from another silverlight applicationRSS Feed

(0)

shanjoseph
shanjoseph

Member

Member

4 points

3 Posts

call a silverlight application from another silverlight application

how can i call a silverlight application from another silverlight application.

Just like we r calling one SWF from another  SWF  in Flash.

 

chad.campbell
chad.cam...

Participant

Participant

1918 points

332 Posts

Silverlight MVP
Answered Question

Re: call a silverlight application from another silverlight application

Silverlight is a browser-based plugin.  Because of this, each Silverlight application runs within an instance of the plugin.  Each instance is basically just an HTML object element.  Because of this, if you want to call a Silverlight application from another application you must call the application through the HTML DOM. 

If you are using Silverlight 2, you can use the classes in the System.Windows.Browser namespace to help you do this from managed code.  If you are using Silverlight 1.0, you can do this using standard JavaScript. 

If this answers your question, please select "mark as answer", otherwise, please post a follow up question. Thanks!
Chad Campbell

Author of Silverlight 2.0 in Action Blog: http://cornucopia30.blogspot.com

shanjoseph
shanjoseph

Member

Member

4 points

3 Posts

Re: call a silverlight application from another silverlight application

 thank you  very much.

i  serached for an example of  this. but i didn't get it.

can u please help me with an example  or a  proper link. 

am using silverlight 2.0 

 

AngryYoungMan
AngryYou...

Member

Member

12 points

1 Posts

Answered Question

Re: call a silverlight application from another silverlight application

With in your silverlight application you can write the following code to get the HTMl elements

HtmlDocument _doc = HtmlPage.Document;

 _doc.GetElementById("ValueText").SetProperty("Value", txtName.Text);

Now the html textbox value is set from the Silverlight application.Like wise you can get the value of the HTML element inside the second silverlight pluggin. 

 

shanjoseph
shanjoseph

Member

Member

4 points

3 Posts

Re: Re: call a silverlight application from another silverlight application

 thank you very much for your answer.


suppose  we have a silverlight application and the usercontrol of this contains two canvases.

On the second canvas i want to load another silverlight application. And i also need to communicate with these two silverlight applications.

Is this  possible?

Yi-Lun Luo - MSFT
Yi-Lun L...

All-Star

All-Star

25052 points

2,747 Posts

Answered Question

Re: Re: Re: call a silverlight application from another silverlight application

Hello, if what you mean is you want to have another Silverlight application inside a Canvas of the first one, I suggest you to use a single Silverlight application with two UserControls. You can just put another UserControl in that Canvas. This will be much easier than creating two separate Silverlight applications and handle the communication stuffs.

 

shanaolanxing - I'll transfer to the Windows Azure team, and will have limited time to participate in the Silverlight forum. Apologize if I don't answer your questions in time.
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities