aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Tango.FSE.LogViewer.UI/ViewModelLocator.cs
blob: a9b9f85e862012d8918f76b0fc56c3e6b8f1d1c9 (plain)
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.Core.DI;
using Tango.FSE.BL;
using Tango.FSE.Common.Notifications;
using Tango.FSE.Common.Storage;
using Tango.FSE.LogViewer.UI.ViewModels;
using Tango.FSE.UI.Cryptography;
using Tango.FSE.UI.Notifications;
using Tango.FSE.UI.Storage;

namespace Tango.FSE.LogViewer.UI
{
    public static class ViewModelLocator
    {
        static ViewModelLocator()
        {
            TangoIOC.Default.Unregister<INotificationProvider>();
            TangoIOC.Default.Unregister<IStorageProvider>();
            TangoIOC.Default.Unregister<ICryptographyProvider>();

            TangoIOC.Default.Register<INotificationProvider, DefaultNotificationProvider>();
            TangoIOC.Default.Register<IStorageProvider, DefaultStorageProvider>();
            TangoIOC.Default.Register<ICryptographyProvider, DefaultCryptographyProvider>();

            TangoIOC.Default.Register<MainViewVM>();
            TangoIOC.Default.Register<LayoutViewVM>();
        }

        public static MainViewVM MainViewVM
        {
            get
            {
                return TangoIOC.Default.GetInstance<MainViewVM>();
            }
        }

        public static LayoutViewVM LayoutViewVM
        {
            get
            {
                return TangoIOC.Default.GetInstance<LayoutViewVM>();
            }
        }
    }
}