NavFx Part 2 - Setting Up

Hopefully you have at least skimmed through NavFx Part 1 - Quick Reference and have a basic idea of what NavFx brings to your Silverlight applications.  In this an subsequent articles I am going to walk you through how I use NavFx to build the next version of http://www.vrcyclist.com.  I am not going to go into every gory detail, I will be focussing on the NavFx aspects of the application, but feel free to comment or ask questions about any aspect, I will do my best to answer them.  Do bear in mind though I am not re-writing this application in Silverlight necessarily because it is best practice or the best way to do it.  I am doing it because I can and I want to, although vrcyclist.com is an active community site, I provide it free to members on the basis that I can use it as a lab for improving and maintaining my skills and knowledge.

In this article I am going to walk through the process of setting up my Visual Studio 2008 solution using the C# NavFx templates (you can download these from the http://www.codeplex.com/NavFx).  If you have downloaded these and created an application may have been dissappointed that you did not get the Sillverlight Application Wizard that handles wiring the project up to a web site and/or page.  The templates were using the Export Template feature of VS 2008, which does not replicate the wizard so the wiring up has to be done manually, it is not a huge job but one that has to be done if you want to just hit F5 to run and debug your application.  The following are the steps I took to get setup:

  1. Fire up VS 2008 and create a new Web Site (I called my solution VRC3 and my site Vrc3App)
    New solution created in VS 2008
  2. Next add the Silverlight Application that will provide the shell for my new VRC, right click on the solution in Solution Explorer and choose Add, New Project...
  3. In the Project Types tree expand Visual C# and select the Silverlight sub type
    Adding a new NavFx Application
  4. Select the NavFxApplication template
  5. Set the name and location of the project (I called my project Vrc3Shell as you can see) and activate the OK button
    VS Solution with shell project added
  6. So no wizard to wire up the Silverlight project with the web site project.  When VS 2008 Tool for Silverlight were installed the properties sheet for web projects was extended to include a new tab, this is where we do the wiring up manually
  7. Right click on the root of the web site project (Vrc3App in my solution) and choose Properties
  8. Activate the Silverlight Applications tab
    Tab added to web site properted for Silverlight Applications
  9. Click on the Add button to wire up the new NavFx project
    Adding a Silverlight Application to a web site project
  10. The options should be familiar to you if you have use the default Silverlight Application template before.  The first part is as required, we want to wire up the existing application that was created from the NavFx template (you can use this dialog to add new Silverlight Application projects but you can't select a template to use)
  11. The default Destination folder is fine for us
  12. Select Copy to configuration specific folders this will ensure seperate Debug and Release versions are maintained within the site when you build and run the solution.  In previous versions you only had one version based on the current Configuration selected for the project
  13. Adding a test page is optional (I left it on so I could copy and paste the generated code into my Default.aspx page)
  14. Enable Silverlight debugging is recommended
  15. Activate the Add button when you have all the settings as required
  16. The application is added to the Silverlight Applications tab
  17. A ClientBin folder is created in the web site project
  18. A test page is generated
    VS Solution after wiring up web site and Silverlight Application

That's it for setting up, I  copied the code from my test page to Default.aspx and set this as my Startup Page and moved on to preparing my Shell.xaml to provide all of the navigation for my new Silverlight version of VRC.  I walk you through the NavFx specifics of that step in my next article.

Previous Article   Next Article

 

Print | posted @ Tuesday, July 01, 2008 8:55 AM

Comments on this entry:

Gravatar # re: NavFx Part 2 - Setting Up
by Leonardi at 7/11/2008 9:41 AM

Hello, i try to download your 14348 source code build and rebuild then run the code from VS2008. The test page is not showing on Firefox-3. It is however work perfectly on my IE-5.

I'm currently using windows XP, VS-2008, Silverlight 2 beta 2 SDK, Silverlight 2 beta 2 runtime, Firefox 3 and IE 5.

Is there any issues of your framework working with firefox-3? Because i have tried some Silverlight 2 tutorial on the web and it seems working fine with the firefox-3.

Thanks.
  
Gravatar # re: NavFx Part 2 - Setting Up
by Mike Hanson at 7/11/2008 1:08 PM

There are some known issues with running Silverlight 2 with Firefox. There is nothing I can think of in the NavFx that would prevent it from running if Silverlight is able to run. I will try some tests to see if I can find anything
  
Gravatar # re: NavFx Part 2 - Setting Up
by Leonardi at 7/11/2008 3:35 PM

Thanks mike, and sorry it's Internet explorer 6, not 5. I kinda forgot the version number :P
  
Gravatar # re: NavFx Part 2 - Setting Up
by Paul at 11/27/2008 4:56 PM

I've installed the templates into VS2008 SP1, but they don't appear in the My Templates section when doing the Add Project>Silverlight step.
Any thoughts on what the problem might be?
  
Gravatar # re: NavFx Part 2 - Setting Up
by MikeHanson at 11/27/2008 9:39 PM

I found a problem and will upload a working VSI at the weekend.
  
Gravatar # re: NavFx Part 2 - Setting Up
by MikeHanson at 11/29/2008 11:50 AM

New version uploaded that should install correctly.
  
Gravatar # re: NavFx Part 2 - Setting Up
by a.garcia at 12/16/2008 6:07 PM

First of all, thank you so much for the template.

I have 2 doubts. The first one: Where can I find the VSI file? The file that I download at www.codeplex.com/NavFx is a .zip file. If I change the extension to .vsi, appears a message that sais: File .vscontent not found in the file.

The second one: Is this template implemented also in Visual Basic?

Thank you for your attention

P.S.: Sorry about my english :P
  
Gravatar # re: NavFx Part 2 - Setting Up
by MikeHanson at 12/16/2008 7:12 PM

I have downloaded the file from the Templates release page and it is definitely a .vsi file. Did you by any chance download the NavFxBinaries.zip instead?

There are templates in both C# and VB.NET although I can't guarantee the VB templates are 100% because I never use VB and didn't test them.
  
Gravatar # re: NavFx Part 2 - Setting Up
by a.garcia at 12/17/2008 5:50 PM

That was the problem xD. Finally I have found it.

Thank you so much
  
Gravatar # re: NavFx Part 2 - Setting Up
by Coupon Codes at 5/15/2009 3:30 PM

I had a go with this on VB, it certainly works well enough. Great resource.
  

Your comment:

Title:
Name:
Email:
Website:
 
Italic Underline Blockquote Hyperlink
 
 
Please add 2 and 5 and type the answer here: