View Single Post
Old May 29th, 2008, 08:39 AM
elwappo elwappo is offline
Authorized User
Points: 192, Level: 3
Points: 192, Level: 3 Points: 192, Level: 3 Points: 192, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Aug 2006
Location: God's country , United Kingdom.
Posts: 41
Thanks: 1
Thanked 0 Times in 0 Posts
Default Silverlight controls

Hi all,
I need some advice on Silverlight User Controls in VS2008 please.

I've created a new silverlight application in VS2008 and added a new web project to the solution to run the silverlight controls in web pages.

It creates a default silverlight control which I've added some basic functionality to, i.e. a button and click event, etc, and it all works fine.

This all builds and runs perfectly well in the test aspx page from within the web project attached to the solution.

What I've noticed is that the silverlight application references the control within the app.xaml file on the application_startup method which I assume instantaites the control for the project.

My main question is, can you only run one silverlight control per silverlight project? And what if you want to reference another silverlight control within your web project?

I can add a new control within the silverlight project, but I cannot instantiate that control unless it's first in the app.xaml's application_startup method, which means I can only reference one silverlight control in the project.

Also, on the aspx page within the silverlight control, the "source" property just references the silverlight application as a whole in the clientbin.

So my main question is, do you create only one silverlight control per project and then build seperate projects for each different control you want? Because you can't seem to reference more than one control with a silverlight project.
Thanks in advance.