Up Start
DevForce 2010 Resource Center » DevForce development » Start » Create new solutions with DevForce templates

Create new solutions with DevForce templates

Last modified on August 15, 2012 17:21

This topic shows you how to create new Visual Studio solutions that are pre-configured for DevForce development.

You can create a new Visual Studio application using any template, even a blank solution template. In general, it's easier to get a running start with a template that builds the projects, references and artifact files that you will surely need for development. DevForce installs many templates to suit many application types ... as seen in this snapshot taken shortly after choosing File | New | Project ... from the Visual Studio menu:

DevForce solution templates

DevForce templates are available in both C# and Visual Basic.

These templates appear regularly in our tutorial videos and we invite you to explore them on your own. Here we briefly introduce two of them.

Simple Silverlight Application

The Silverlight Application Template generates a bare bones solution consisting of the minimum two projects: a Silverlight application project and a web application project.

DevForce Silverlight Application template

Both projects are primed with references to the DevForce libraries. In the web project, the Global.asax and Web.config are prepared for DevForce and there's a log folder ready to receive the log file, DebugLog.xml, that captures the application's server-side activity.

Begin by adding an Entity Framework model to the web project. DevForce generates the full .NET entity classes in the web project and automatically adds links to them in the Silverlight application project. Those links ("shortcuts") appear in the "Shared Code" folder.

Continue by building out the Silverlight UI with views and presentation logic.

Production Silverlight applications typically have multiple projects. You can put the Entity Framework model and DevForce entity classes in a separate server-side project; the client entity classes can be compiled in their own Silverlight project and referenced by the Silverlight application project.

Silverlight Business Application

The DevForce Silverlight Business Application Template (BAT) is an adaptation of the one shipped as part of the Microsoft Silverlight toolkit - a template featured in many Microsoft demonstrations including BookShelf.

The BAT extends the basic Silverlight Application Template with three important features: 

  1. theme, style, and UserControl resources
  2. a working example of the Silverlight Navigation Framework 
  3. a demo example of logging in and registering new users with ASP.NET Forms Authentication.  

The BAT ships in several flavors, each functionally the same but styled differently with one of the Microsoft themes.

The Microsoft version of the BAT has RIA Services references and sample code for managing login and registration. Those are replaced with DevForce references and equivalent sample code. The Microsoft and DevForce BATs are otherwise equivalent and you can swap presentation code between them easily.

The developer workflow is essentially the same for the BAT as it was for the bare-bones template:

  1. Add an Entity Framework model to the web application project
  2. Build out the UI with Silverlight Navigation pages and views.

Here is a snapshot of the template generated Silverlight Business Application project structure.

DevForce Silverlight Business Application template - Silverlight project

We've highlighted some of the key artifacts added by this template: the resources for styles and themes, the models and views for login and registration, and the standard set of navigation pages. The AuthenticationManager is the DevForce equivalent of the RIA Services WebContext.

The web application project adds server-side ASP.NET Authentication support classes, the most important of which is User. The User class carries the security context (e.g., IPrincipal implementation) that is mirrored in the User class compiled on the Silverlight client.

DevForce Silverlight Business Application template - Web project

Tutorial videos and the DevForce BookShelf sample application are good places to learn about these templates in detail. 

Created by DevForce on February 22, 2011 17:22

This wiki is licensed under a Creative Commons 2.0 license. XWiki Enterprise 3.2 - Documentation. Copyright © 2015 IdeaBlade