Ejemplo n.º 1
0
        private void InitServices()
        {
#if ENV_PROD
            var serverInfo = new ServerInfo()
            {
                SSL     = true,
                RootUrl = "api.nuviot.com",
            };
#elif ENV_DEV
            var serverInfo = new ServerInfo()
            {
                SSL     = true,
                RootUrl = "dev-api.nuviot.com",
            };
#elif ENV_LOCAL
            var serverInfo = new ServerInfo()
            {
                SSL     = false,
                RootUrl = "localhost:5001",
            };
#elif ENV_LIVE
            var serverInfo = new ServerInfo()
            {
                SSL     = true,
                RootUrl = "api.nuviot.com",
            };
#endif



            /* Configuring he IoC is something like this...be warned
             *
             * https://www.youtube.com/watch?v=7-FbfkUD78w
             */

            var clientAppInfo = new ClientAppInfo();

            SLWIOC.RegisterSingleton <IClientAppInfo>(clientAppInfo);
            SLWIOC.RegisterSingleton <IAppConfig>(new AppConfig());

            var navigation = new ViewModelNavigation(this);
            LagoVista.XPlat.Core.Startup.Init(this, navigation);
            LagoVista.Client.Core.Startup.Init(serverInfo);

            navigation.Add <MainViewModel, Views.MainView>();
            navigation.Add <DeviceExplorerViewModel, Views.DeviceExplorerView>();
            navigation.Add <ProvisionDeviceViewModel, Views.ProvisionDeviceView>();
            navigation.Add <DeviceTypePickerViewModel, Views.DeviceTypePickerView>();
            navigation.Add <MonitorDeviceViewModel, Views.MonitorDeviceView>();
            navigation.Add <ManageDeviceViewModel, Views.ManageDeviceView>();

            navigation.Add <SplashViewModel, Views.SplashView>();

            navigation.Start <SplashViewModel>();

            SLWIOC.RegisterSingleton <IViewModelNavigation>(navigation);
        }
Ejemplo n.º 2
0
        private void InitServices()
        {
#if ENV_STAGE
            var serverInfo = new ServerInfo()
            {
                SSL     = true,
                RootUrl = "api.nuviot.com",
            };
#elif ENV_DEV
            var serverInfo = new ServerInfo()
            {
                SSL     = true,
                RootUrl = "dev-api.nuviot.com",
            };
#elif ENV_LOCALDEV
            var serverInfo = new ServerInfo()
            {
                SSL     = false,
                RootUrl = "localhost:5001",
            };
#elif ENV_MASTER
            var serverInfo = new ServerInfo()
            {
                SSL     = true,
                RootUrl = "api.nuviot.com",
            };
#endif

            var clientAppInfo = new ClientAppInfo();

            _appConfig = new AppConfig();
            SLWIOC.RegisterSingleton <IClientAppInfo>(clientAppInfo);
            SLWIOC.RegisterSingleton <IAppConfig>(_appConfig);

            var navigation = new ViewModelNavigation(this);
            LagoVista.XPlat.Core.Startup.Init(this, navigation);
            LagoVista.Client.Core.Startup.Init(serverInfo, new AppStyle());

            navigation.Add <MainViewModel, Views.MainView>();
            navigation.Add <DeviceExplorerViewModel, Views.DeviceExplorerView>();
            navigation.Add <ProvisionDeviceViewModel, Views.ProvisionDeviceView>();
            navigation.Add <DeviceTypePickerViewModel, Views.DeviceTypePickerView>();
            navigation.Add <MonitorDeviceViewModel, Views.MonitorDeviceView>();
            navigation.Add <DeviceMapViewModel, Views.DeviceMapView>();
            navigation.Add <ManageDeviceViewModel, Views.ManageDeviceView>();

            navigation.Add <SplashViewModel, Views.SplashView>();

            navigation.Start <SplashViewModel>();

            SLWIOC.Register <IDeviceManagementClient, DeviceManagementClient>();
            SLWIOC.RegisterSingleton <IViewModelNavigation>(navigation);
        }