-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBootstrapper.cs
More file actions
32 lines (27 loc) · 938 Bytes
/
Bootstrapper.cs
File metadata and controls
32 lines (27 loc) · 938 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
namespace WpfSample
{
using Stylet;
using StyletIoC;
using System.Windows.Threading;
using ViewModels;
public class Bootstrapper : Bootstrapper<ShellViewModel>
{
protected override void ConfigureIoC(IStyletIoCBuilder builder)
{
base.ConfigureIoC(builder);
builder.Bind<ILogger>().To<Logger>().InSingletonScope().AsWeakBinding();
builder.Bind<IViewModelFactory>().ToAbstractFactory();
}
protected override void Configure()
{
base.Configure();
SimpleIoC.GetInstance = this.Container.Get;
SimpleIoC.GetAllInstances = this.Container.GetAll;
SimpleIoC.BuildUp = this.Container.BuildUp;
}
protected override void OnUnhandledException(DispatcherUnhandledExceptionEventArgs e)
{
Container.Get<ILogger>("filelogger").Fatal(e.Exception);
}
}
}