-
Notifications
You must be signed in to change notification settings - Fork 0
/
AppBootstrapper.cs
52 lines (46 loc) · 1.5 KB
/
AppBootstrapper.cs
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using Stylet;
using StyletIoC;
using CreditCalc.ViewModels;
using System.Windows;
using System;
using System.Windows.Threading;
using FluentValidation;
using System.Reflection;
using System.Linq;
namespace CreditCalc
{
class AppBootstrapper : Bootstrapper<MainViewModel>
{
//protected override void OnStart()
//{
// This is called just after the application is started, but before the IoC container is set up.
// Set up things like logging, etc
//}
protected override void ConfigureIoC(IStyletIoCBuilder builder)
{
// Bind your own types. Concrete types are automatically self-bound.
builder.Bind(typeof(IModelValidator<>)).To(typeof(ValidationAdapter<>));
builder.Bind(typeof(IValidator<>)).ToAllImplementations();
builder.Bind(typeof(TabItem)).ToAllImplementations();
}
//protected override void Configure()
//{
// // This is called after Stylet has created the IoC container, so this.Container exists, but before the
// // Root ViewModel is launched.
// // Configure your services, etc, in here
//}
//protected override void OnLaunch()
//{
// // This is called just after the root ViewModel has been launched
// // Something like a version check that displays a dialog might be launched from here
//}
//protected override void OnExit(ExitEventArgs e)
//{
// // Called on Application.Exit
//}
//protected override void OnUnhandledException(DispatcherUnhandledExceptionEventArgs e)
//{
// // Called on Application.DispatcherUnhandledException
//}
}
}