Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class SCBootstrapper:BootstrapperBase
- {
- private readonly SimpleContainer _Container = new SimpleContainer();
- public SCBootstrapper()
- {
- Initialize();
- }
- protected override void Configure()
- {
- _Container.Singleton<IWindowManager, WindowManager>();
- _Container.Singleton<IEventAggregator, EventAggregator>();
- _Container.PerRequest<IShell, ShellViewModel>();
- }
- protected override object GetInstance(Type service, string key)
- {
- var instance = _Container.GetInstance(service, key);
- if (instance != null)
- return instance;
- throw new InvalidOperationException("Could not locate any instances.");
- }
- protected override IEnumerable<object> GetAllInstances(Type service)
- {
- return _Container.GetAllInstances(service);
- }
- protected override void BuildUp(object instance)
- {
- _Container.BuildUp(instance);
- }
- protected override void OnStartup(object sender, StartupEventArgs e)
- {
- DisplayRootViewFor<IShell>();
- }
- }
Add Comment
Please, Sign In to add comment