Click here to Skip to main content
15,887,027 members
Articles / Programming Languages / C#

A ContactLOB line-of-business application sample - Login: Silverlight, MVVM, WCF RIA Services

Rate me:
Please Sign up or sign in to vote.
4.78/5 (7 votes)
20 Feb 2012CPOL6 min read 35.7K   1.1K   10  
A Silverlight LOB application tutorial.
using System.Windows;
using ContactLOB.Views;
using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.Prism.UnityExtensions;
using Microsoft.Practices.Unity;

namespace ContactLOB
{
	public class Bootstrapper : UnityBootstrapper
	{
		protected override DependencyObject CreateShell()
		{
			// Use the container to create an instance of the shell.
			ShellView view = this.Container.TryResolve<ShellView>();

			// Set it as the root visual for the application.
			Application.Current.RootVisual = view;

			return view;
		}

		protected override void InitializeShell()
		{
			base.InitializeShell();

			IRegionManager regionManager = RegionManager.GetRegionManager(Shell);
			if (regionManager == null) return;

			// Create a new instance of the LoginView using the Unity container.
			var view = this.Container.Resolve<LoginView>();
			if (view == null) return;
			// Add the view to the main region.
			regionManager.Regions["MainRegion"].Add(view, "LoginView");
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
BrizkCRM
United States United States
You can contact me using my website: BrizkCRM

Comments and Discussions