Skip to main content
Home Forums Silverlight Design Designing with Silverlight call a silverlight application from another silverlight application
5 replies. Latest Post by Yi-Lun Luo - MSFT on May 20, 2008.
(0)
shanjoseph
Member
4 points
3 Posts
05-19-2008 7:25 AM |
how can i call a silverlight application from another silverlight application.
Just like we r calling one SWF from another SWF in Flash.
chad.cam...
Participant
1918 points
332 Posts
05-19-2008 8:10 AM |
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.
05-20-2008 12:09 AM |
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
AngryYou...
12 points
1 Posts
05-20-2008 2:00 AM |
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.
05-20-2008 2:58 AM |
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 L...
All-Star
25052 points
2,747 Posts
05-20-2008 11:20 PM |
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.