Create something in Blend and use in Visual Studio?
Last post 05-08-2008 11:10 AM by dudeNumber4. 10 replies.
Sort Posts:
05-06-2008 6:11 PM
Create something in Blend and use in Visual Studio?

I'm using blend  2.0 and VS2008 with the silverlight tools Beta 1.  I've been looking for quite some time and I can't figure out how to:

  • Create some kind of user control in blend.
  • Import that as a new item into an existing web application project (that I could reference with a silverlight control).
  • Have some code behind the user control.
I'd like to be able to keep user controls as separate entities that could be edited in blend.  I see that I can create a new silverlight application, and that I can create a user control within that, but I'd like to be able to use blend, and further, I can't seem to add anything to that kind of user control visually.
dudeNumber4

Joined on 12-03-2007
Posts 10
05-06-2008 10:00 PM
Re: Create something in Blend and use in Visual Studio?

>> Create something in Blend and use in Visual Studio?

You can open VS 2008 from Blend.

- Right click on XAML file.

- Choose "Edit in Visual Studio" 

You can also open Blend from VS 2008.

- There is one option called "Open in Blend" in Right-click menu of Solution Explorer.

(If this has answered your question, please click on "Mark as Answer" on this post. Thank you!)

Best Regards,
Michael Sync

Blog : http://michaelsync.net
Feed : http://michaelsync.net/feed

mchlSync

Joined on 09-16-2005
Singapore
Posts 2,021
05-07-2008 9:52 AM
Re: Create something in Blend and use in Visual Studio?

- I don't see either option (in blend or VS2008).  Anything I can try other than simply uninstalling/reinstalling?

- If I have an existing web application project, how can I create a new user control for that project (the option isn't available unless I'm in a silverlight project)?
 

dudeNumber4

Joined on 12-03-2007
Posts 10
05-07-2008 12:43 PM
Re: Create something in Blend and use in Visual Studio?

You may need Blend 2.5 to work with sivlerlight 2 project:
 

 http://www.microsoft.com/downloads/details.aspx?FamilyId=32A3E916-E681-4955-BC9F-CFBA49273C7C&displaylang=en

Software Engineer
Aprimo, Inc

Please remember to mark the replies as answers if they answered your question

sladapter

Joined on 03-05-2008
Indiana, US
Posts 404
05-07-2008 3:09 PM
Re: Create something in Blend and use in Visual Studio?

Blend 2.5 allows me to cross edit from blend to VS2008, but my question remains.  How do I create a user control (in VS or in blend) that I can visually edit with blend but still use in an existing web application VS2008 project?  Do I have to create a new silverlight application in VS, add a user control, then import that into my existing web application?

Neither blend nor VS2008 web application projects give me the option to create a user control.  Can I just wrap some existing XAML in a UserControl element?  Would that still be editable in blend?

dudeNumber4

Joined on 12-03-2007
Posts 10
05-07-2008 3:16 PM
Re: Create something in Blend and use in Visual Studio?

In your VS2008 silverlight project, add an UserControl (or find an existing one). Right Click the XAML file and Click "Open In Express Blend...". It will take you to the Blend. After you are done you just save it, and come back to VS2008 you should see the XAML file been updated.

dudeNumber4:

Neither blend nor VS2008 web application projects give me the option to create a user control.  Can I just wrap some existing XAML in a UserControl element?  Would that still be editable in blend?



Are you sure you have created a silverlight project? How did you create you silverlight project? When you right click your project try to add a new item did you see Silverlight UserControl Template listed under the Visual Studio installed templates?

 

Software Engineer
Aprimo, Inc

Please remember to mark the replies as answers if they answered your question

sladapter

Joined on 03-05-2008
Indiana, US
Posts 404
05-07-2008 5:58 PM
Re: Create something in Blend and use in Visual Studio?

This is what I have been trying to ask.  I need to add silverlight user controls to an existing VS2008 web application project

dudeNumber4

Joined on 12-03-2007
Posts 10
05-07-2008 7:05 PM
Re: Create something in Blend and use in Visual Studio?

You can not add a silverlight control to a Web application project. You need to add it to a Silverlight project. Then you can add Silverlight link to your Web Project.

The Web project is running on the Server under ASP.Net service. The silverlight code is running on the Client side in the browser. That's why you can not mix them up.

 

 

Software Engineer
Aprimo, Inc

Please remember to mark the replies as answers if they answered your question

sladapter

Joined on 03-05-2008
Indiana, US
Posts 404
05-08-2008 9:30 AM
Re: Create something in Blend and use in Visual Studio?
  • Add a silverlight link to my web project?  How do I do that?
  • I can't mix client side and server side code?  All web developers have been doing that since the beginning... 
dudeNumber4

Joined on 12-03-2007
Posts 10
05-08-2008 9:59 AM
Marked as Answer
Re: Create something in Blend and use in Visual Studio?

Here is the quick start for Silverlight. Follow the instruction you should be able to create your silverlight project and Web project.
 

http://silverlight.net/quickstarts/managed.aspx 

 

You can use Server side code to build pages, and put client side code on your page. The client side code will be running on the client side like javascript. But you never compile the server side code and client side code into one DLL. That's I meant you can not mix them up.

When we talk about silverlight 2 development most people here are taking the advantage of managed code silverlight 2 provide to write their silverlight application in C# or VB.  So the code will be compiled into a .XAP file. When you create a silverlight link to your Web project the XAP file will be copied to your web project ClientBin folder. The code for your web project running on the Server will still be in the Bin folder. The Xap file will be downloaded to the client side when user hit the page and be running there.

The code in silverlight project can only access the Silverlight runtime DLL which is a sub set of the WPF and common .Net Framework. But the server side code in your Web Project can access the full set of the .Net Framework.


 


 

 

Software Engineer
Aprimo, Inc

Please remember to mark the replies as answers if they answered your question

sladapter

Joined on 03-05-2008
Indiana, US
Posts 404
05-08-2008 11:10 AM
Re: Create something in Blend and use in Visual Studio?

Thanks.  Was still hung up on the option "link this silverlight control into an existing web site" which is disabled when creating a new silverlight application directly.  One must add a new silverlight application project to an existing web project in order to enable that option.

dudeNumber4

Joined on 12-03-2007
Posts 10