|
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.