in

WPF Design and Development

IdentityMine Team Blogs

David Kelley

A day in the life of a humble software architect... doing C#, WPF, Silverlight, Legos, Fuzzy Logic AI and/or whatever is the latest and greatest or more importantly the coolest techo mumbo jumbo...

Silverlight - Associating Files in Visual Studio

So here is a Visual Studio trick I picked up from Josh in WPF land that applies to Silverlight.  One issue we found in Silverlight was when we were building big Silverlight applications and custom user controls that the XAML and .js files were not associated to each other.  But in Visual Studio if you know what todo its pretty straight forward.  Then yoru 'XAML files can have JavaScript code files even if created seperating with different names. 

Here is how you do it. When you silverlight solution and project is open in Visual Studio Right click on the project in the visual studio solution explorer.  Click 'Unload Project'.  If the solution is tied to Source control you will get a dialog 'Attempt to unload projects with shared checkouts' and you can select the option you want.  So assuming you select 'continue' then the project is unloaded.  Right click on the project and select Edit [project filename].csproj.  You will see the project file open up in a raw xml edit mode.  Fine the 'itemgroup' collection that has the file you want to make dependent on another file.  Add a 'DependentUpon' node to the node that is your file and put the name of the file you want your file to be under.  Save and close the project file.  Then you right click the project and click 'reload' the project. 

Its a cool trick and sure helped me clean up a few huge messy projects.

 

Comments

No Comments

About david.kelley

David for the past 10 years has focused on distributed application design and emerging Microsoft technologies on the web. Having helped design and build some of the largest systems for companies like Microsoft, Onyx Software, Saltmine, Giordanous Group and more and of course our favorite company Identitymine, he has been on the leading edge of applying the latest tech to real world business problems. David’s technology breadth includes everything from SQL Server to Windows/WCF and Silverlight. David’s accomplishments also include developing new technologies such as self editing XML files and related XML technologies to fuzzy logic systems and advanced web user interface design.
© 2007 IdentityMine, Inc.
Powered by Community Server (Commercial Edition), by Telligent Systems