Ejemplo n.º 1
0
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
            var rootFrame = Window.Current.Content as Frame;

            if (rootFrame == null)
            {
                rootFrame = new Frame();

                rootFrame.NavigationFailed += OnNavigationFailed;
                Xamarin.Forms.Forms.Init(e);

                LagoVista.Core.UWP.Startup.Init(this, rootFrame.Dispatcher, MOBILE_CENTER_KEY);

                SLWIOC.Register <ITCPClient, TCPClient>();
                SLWIOC.Register <IUDPClient, UDPClient>();

                SLWIOC.Register <IMqttNetworkChannel, MqttNetworkChannel>();

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                }

                Window.Current.Content = rootFrame;
            }

            if (e.PrelaunchActivated == false)
            {
                if (rootFrame.Content == null)
                {
                    rootFrame.Navigate(typeof(MainPage), e.Arguments);
                }

                Window.Current.Activate();
            }
        }
Ejemplo n.º 2
0
        public static void Init(Windows.UI.Xaml.Application app, CoreDispatcher dispatcher, string key)
        {
            SLWIOC.RegisterSingleton <ILogger>(new Loggers.AppCenterLogger(key));
            SLWIOC.RegisterSingleton <IDispatcherServices>(new DispatcherServices(dispatcher));
            SLWIOC.RegisterSingleton <IStorageService>(new StorageService());
            SLWIOC.RegisterSingleton <IPopupServices>(new PopupsService());

            SLWIOC.RegisterSingleton <IDeviceManager>(new DeviceManager());

            SLWIOC.RegisterSingleton <INetworkService>(new NetworkService());
            SLWIOC.Register <IImaging>(new Imaging());
            SLWIOC.Register <IBindingHelper>(new BindingHelper());

            SLWIOC.RegisterSingleton <ISSDPClient>(new SSDPClient());
            SLWIOC.RegisterSingleton <IWebServer>(new WebServer());

            SLWIOC.Register <ISSDPClient>(typeof(SSDPClient));
            SLWIOC.Register <IWebServer>(typeof(WebServer));
            SLWIOC.Register <ISecureStorage>(new SecureStorage());
            SLWIOC.Register <ISSDPServer>(new SSDPServer());

            SLWIOC.Register <ITimerFactory>(new TimerFactory());

            SLWIOC.Register <IDirectoryServices>(new DirectoryServices());

            IconFonts.IconFontSupport.RegisterFonts();
        }
Ejemplo n.º 3
0
        public void SimpleCreateAllTest()
        {
            SLWIOC.Register <IClassA, ClassA>();
            SLWIOC.Register <IClassB, ClassB>();
            SLWIOC.Register <IClassC, ClassC>();

            SLWIOC.Create <IClassC>();
        }
Ejemplo n.º 4
0
        public static void Init(Context context, string key)
        {
            SLWIOC.RegisterSingleton <ILogger>(new Loggers.MobileCenterLogger(key));
            SLWIOC.Register <IStorageService>(new StorageService());
            SLWIOC.Register <IPopupServices>(new LagoVista.XPlat.Core.Services.PopupServices());
            SLWIOC.Register <INetworkService>(new NetworkService());
            SLWIOC.Register <IDeviceInfo>(new DeviceInfo());
            SLWIOC.Register <IDispatcherServices>(new DispatcherServices(context));

            IconFonts.IconFontSupport.RegisterFonts();
        }
Ejemplo n.º 5
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);
        }
Ejemplo n.º 6
0
        public static void Init(Context context, string key)
        {
            SLWIOC.RegisterSingleton <ILogger>(new Loggers.AppCenterLogger(key));
            SLWIOC.Register <IStorageService>(new StorageService());
            SLWIOC.Register <IPopupServices>(new LagoVista.XPlat.Core.Services.PopupServices());
            SLWIOC.Register <INetworkService>(new NetworkService());
            SLWIOC.Register <ITCPClient, Services.TCPClient>();
            SLWIOC.Register <IUDPClient, Services.UDPClient>();
            SLWIOC.Register <IWebSocket, Services.WebSocket>();
            SLWIOC.Register <ISecureStorage>(new SecureStorage());
            SLWIOC.Register <IDispatcherServices>(new DispatcherServices(context));

            IconFonts.IconFontSupport.RegisterFonts();
        }
Ejemplo n.º 7
0
        public static void Init(UIApplication app, string key)
        {
            SLWIOC.RegisterSingleton <ILogger>(new Loggers.MobileCenterLogger(key));
            SLWIOC.Register <IStorageService>(new StorageService());
            SLWIOC.Register <INetworkService>(new NetworkService());
            SLWIOC.Register <IDeviceInfo>(new DeviceInfo());
            SLWIOC.Register <IPopupServices>(new PopupServices());
            SLWIOC.Register <IWebSocket, Services.WebSocket>();
            SLWIOC.Register <IDispatcherServices>(new DispatcherService(app));
            SLWIOC.Register <IMqttNetworkChannel, MqttNetworkChannel>();
            SLWIOC.Register <IStorageService, SecureStorage>();

            IconFonts.IconFontSupport.RegisterFonts();
        }
Ejemplo n.º 8
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();

            DeviceInfo.Register();

            SLWIOC.Register <IMavLinkMessageParser, MavLinkMessageParser>();
            SLWIOC.Register <ISerialTelemetryLink, SerialTelemetryLink>();
            SLWIOC.Register <IDroneAdapter, APMDroneAdapter>();
            SLWIOC.Register <IMissionPlanner, MissionPlanner>();
            SLWIOC.RegisterSingleton <IClientAppInfo>(clientAppInfo);
            SLWIOC.RegisterSingleton <IAppConfig>(new AppConfig());

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

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

            navigation.Start <SplashViewModel>();

            SLWIOC.RegisterSingleton <IViewModelNavigation>(navigation);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = true;
            }
#endif

            SLWIOC.Register <IMQTTDeviceClient, MQTTDeviceClient>();
            SLWIOC.Register <IMqttNetworkChannel, MqttNetworkChannel>();

            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();

                rootFrame.NavigationFailed += OnNavigationFailed;

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (rootFrame.Content == null)
            {
                // When the navigation stack isn't restored navigate to the first page,
                // configuring the new page by passing required information as a navigation
                // parameter
                rootFrame.Navigate(typeof(MainPage), e.Arguments);
            }
            // Ensure the current window is active
            Window.Current.Activate();
        }
Ejemplo n.º 10
0
        private void RegisterUWPServices(CoreDispatcher dispatcher)
        {
            SLWIOC.RegisterSingleton <IDispatcherServices>(new DispatcherServices(dispatcher));
            SLWIOC.RegisterSingleton <IStorageService>(new StorageService());
            SLWIOC.RegisterSingleton <IPopupServices>(new PopupsService());

            SLWIOC.RegisterSingleton <IDeviceManager>(new DeviceManager());

            SLWIOC.RegisterSingleton <INetworkService>(new NetworkService());
            SLWIOC.Register <IImaging>(new Imaging());
            SLWIOC.Register <IBindingHelper>(new BindingHelper());

            SLWIOC.RegisterSingleton <ISSDPClient>(new SSDPClient());
            SLWIOC.RegisterSingleton <IWebServer>(new WebServer());

            SLWIOC.Register <ISSDPClient>(typeof(SSDPClient));
            SLWIOC.Register <IWebServer>(typeof(WebServer));
            SLWIOC.Register <ISSDPServer>(new SSDPServer());

            SLWIOC.Register <ITimerFactory>(new TimerFactory());
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();

                rootFrame.NavigationFailed += OnNavigationFailed;

                Xamarin.Forms.Forms.Init(e);

                DeviceInfo.Register();
                SLWIOC.Register <IWebSocket, WebSocket>();

                LagoVista.Core.UWP.Startup.Init(this, rootFrame.Dispatcher, "a8d44f67-212b-4357-aea8-d55d44156c59");
                SLWIOC.Register <IWiFiAdapter, Services.WiFiAdapter>();

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (rootFrame.Content == null)
            {
                // When the navigation stack isn't restored navigate to the first page,
                // configuring the new page by passing required information as a navigation
                // parameter
                rootFrame.Navigate(typeof(MainPage), e.Arguments);
            }
            // Ensure the current window is active
            Window.Current.Activate();
        }
Ejemplo n.º 12
0
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Layout.Tabbar;
            ToolbarResource   = Layout.Toolbar;

            //https://play.google.com/apps/publish/?dev_acc=12258406958683843289
            LagoVista.XPlat.Droid.Startup.Init(BaseContext, MOBILE_CENTER_KEY);

            SLWIOC.Register <IMqttNetworkChannel, MqttNetworkChannel>();

            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);

            var packageInfo = PackageManager.GetPackageInfo(PackageName, 0);

            var versionParts = packageInfo.VersionName.Split('.');
            var versionInfo  = new VersionInfo();

            if (versionParts.Length != 4)
            {
                throw new Exception("Expecting android:versionName in AndroidManifest.xml to be a version conisting of four parts 1.0.218.1231 [Major].[Minor].[Build].[Revision]");
            }

            /* if this blows up our versionName in AndroidManaifest.xml is borked...make sure all version numbers are intergers like 1.0.218.1231 */
            versionInfo.Major    = Convert.ToInt32(versionParts[0]);
            versionInfo.Minor    = Convert.ToInt32(versionParts[1]);
            versionInfo.Build    = Convert.ToInt32(versionParts[2]);
            versionInfo.Revision = Convert.ToInt32(versionParts[3]);

            var app = new App();

            app.SetVersion(versionInfo);

            LoadApplication(app);
        }
Ejemplo n.º 13
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            LagoVista.XPlat.iOS.Startup.Init(app, MOBILE_CENTER_KEY);

            SLWIOC.Register <IMqttNetworkChannel, MqttNetworkChannel>();

            UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.LightContent;
            app.StatusBarHidden = false;

            global::Xamarin.Forms.Forms.Init();

            var version = NSBundle.MainBundle.InfoDictionary[new NSString("CFBundleVersion")].ToString();

            Console.WriteLine($"NSLog Version {version}");

            var versionParts = version.Split('.');
            var versionInfo  = new VersionInfo();

            if (versionParts.Length != 4)
            {
                throw new Exception("Expecting CFBundleVersion to be a version consisting of four parts 1.0.218.1231 [Major].[Minor].[Build].[Revision]");
            }

            var formsApp = new App();

            /* if this blows up our build version is borked...make sure all version numbers are intergers like 1.0.218.1231 */
            versionInfo.Major    = Convert.ToInt32(versionParts[0]);
            versionInfo.Minor    = Convert.ToInt32(versionParts[1]);
            versionInfo.Build    = Convert.ToInt32(versionParts[2]);
            versionInfo.Revision = Convert.ToInt32(versionParts[3]);
            formsApp.SetVersion(versionInfo);

            LoadApplication(formsApp);

            return(base.FinishedLaunching(app, options));
        }
Ejemplo n.º 14
0
        public static void Register()
        {
            var deviceInfo = new DeviceInfo();

            if (Device.RuntimePlatform == Device.Android)
            {
                deviceInfo.DeviceType = "Android";
            }
            else if (Device.RuntimePlatform == Device.iOS)
            {
                deviceInfo.DeviceType = "iOS";
            }
            else if (Device.RuntimePlatform == Device.UWP)
            {
                deviceInfo.DeviceType = "UWP";
            }
            else
            {
                deviceInfo.DeviceType = "Unknown";
            }

            var getidResult = Microsoft.AppCenter.AppCenter.GetInstallIdAsync().Result;

            if (getidResult.HasValue)
            {
                deviceInfo.DeviceUniqueId = getidResult.Value.ToString();
                Debug.WriteLine("Found unique id for xamarin forms app: " + deviceInfo.DeviceUniqueId);
            }
            else
            {
                deviceInfo.DeviceUniqueId = "UNKNOWN - NO ID FROM MOBILE CENTER.";
                Debug.WriteLine("Could not determine unique device id for Xamarin Forms app.");
            }

            SLWIOC.Register <IDeviceInfo>(deviceInfo);
        }
Ejemplo n.º 15
0
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
#if ENV_STAGE
            var mobileCenterKey = "d3f162da-76c5-4880-b19c-7a038d6af46f";
            var serverInfo      = new ServerInfo()
            {
                SSL     = true,
                RootUrl = "api.nuviot.com",
            };
#elif ENV_DEV
            var mobileCenterKey = "d3f162da-76c5-4880-b19c-7a038d6af46f";
            var serverInfo      = new ServerInfo()
            {
                SSL     = true,
                RootUrl = "dev-api.nuviot.com",
            };
#elif ENV_LOCALDEV
            var mobileCenterKey = "d3f162da-76c5-4880-b19c-7a038d6af46f";
            var serverInfo      = new ServerInfo()
            {
                SSL     = false,
                RootUrl = "localhost:5001",
            };
#elif ENV_MASTER
            var mobileCenterKey = "d3f162da-76c5-4880-b19c-7a038d6af46f";
            var serverInfo      = new ServerInfo()
            {
                SSL     = true,
                RootUrl = "api.nuviot.com",
            };
#endif

            var rootFrame = Window.Current.Content as Frame;

            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();

                rootFrame.NavigationFailed += OnNavigationFailed;

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }

                Window.Current.Content = rootFrame;
            }

            var dispatcherService = new DispatcherService(Window.Current.Dispatcher);

            this.DebugSettings.EnableFrameRateCounter = false;

            var uasMgr = new ConnectedUasManager();


            var flightStick = new Controller.NiVekFlightStick(rootFrame.Dispatcher);

            SLWIOC.Register <INiVekFlightStick>(flightStick);
            SLWIOC.Register <IHeartBeatManager, HeartBeatManager>();
            SLWIOC.RegisterSingleton <IConnectedUasManager>(uasMgr);
            SLWIOC.Register <IMissionPlanner, MissionPlanner>();
            SLWIOC.RegisterSingleton <IConfigurationManager>(new ConfigurationManager());
            SLWIOC.RegisterSingleton <ITelemetryService, TelemetryService>();
            SLWIOC.RegisterSingleton <IFlightRecorder>(new FlightRecorder(dispatcherService));

            SLWIOC.RegisterSingleton <IClientAppInfo>(new ClientAppInfo());
            SLWIOC.RegisterSingleton <IAppConfig>(new UwpAppConfig());
            SLWIOC.RegisterSingleton <IDeviceInfo>(new UWPDeviceInfo());
            SLWIOC.RegisterSingleton <INavigation, LagoVista.Uas.Core.Services.Navigation>();

            LagoVista.Core.UWP.Startup.Init(this, rootFrame.Dispatcher, mobileCenterKey);

            Startup.Init(serverInfo);

            var navigation = new LagoVista.UWP.UI.Navigation();
            navigation.Initialize(rootFrame);

            navigation.Add <SplashViewModel, SplashView>();
            navigation.Add <LoginViewModel, LoginView>();
            navigation.Add <FlightViewModel, FlightView>();
            navigation.Add <DroneConnectViewModel, DroneConnectView>();

            _flightStickService = new FlightStickService(flightStick, rootFrame.Dispatcher, SLWIOC.Get <INavigation>());

            SLWIOC.Register <IViewModelNavigation>(navigation);

            //new DJIDrone(uasMgr, Window.Current.Dispatcher);
            new TelloDrone(uasMgr, Window.Current.Dispatcher);

            if (e.PrelaunchActivated == false)
            {
                if (rootFrame.Content == null)
                {
                    navigation.Navigate <SplashViewModel>();
                }

                Window.Current.Activate();
            }
        }
Ejemplo n.º 16
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();

            DeviceInfo.Register();

            SLWIOC.Register <IHeartBeatManager, HeartBeatManager>();
            SLWIOC.Register <IMissionPlanner, MissionPlanner>();
            SLWIOC.Register <Uas.Core.INavigation, Uas.Core.Services.Navigation>();

            SLWIOC.RegisterSingleton <IClientAppInfo>(clientAppInfo);
            SLWIOC.RegisterSingleton <IAppConfig>(new AppConfig());
            SLWIOC.RegisterSingleton <IConfigurationManager>(new ConfigurationManager());
            SLWIOC.RegisterSingleton <ITelemetryService, TelemetryService>();

            SLWIOC.RegisterSingleton <IConnectedUasManager>(new ConnectedUasManager());

            SLWIOC.Register <IDeviceManagementClient, DeviceManagementClient>();

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

            navigation.Add <MotorsTestViewModel, Views.Testing.MotorTestsView>();
            navigation.Add <CompassCalibrationViewModel, Views.Calibration.CompassCalibrationView>();
            navigation.Add <AccCalibrationViewModel, Views.Calibration.AccCalibrationView>();
            navigation.Add <MissionPlannerViewModel, Views.Missions.MissionPlannerView>();
            navigation.Add <UasDetailViewModel, Views.Uas.UasDetail>();
            navigation.Add <UasManagerViewModel, Views.Uas.UasManager>();
            navigation.Add <UasTypeManagerViewModel, Views.Uas.UasTypeManager>();
            navigation.Add <MainViewModel, Views.MainPage>();
            navigation.Add <HudViewModel, Views.HudView>();
            navigation.Add <SplashViewModel, Views.SplashView>();

            navigation.Start <SplashViewModel>();

            SLWIOC.RegisterSingleton <IViewModelNavigation>(navigation);
        }
Ejemplo n.º 17
0
        private void InitServices()
        {
            _appConfig = new AppConfig();

#if ENV_MASTER
            var serverInfo = new ServerInfo()
            {
                SSL     = true,
                RootUrl = "api.nuviot.com",
            };
            _appConfig.Environment = Environments.Production;
#elif ENV_DEV
            var serverInfo = new ServerInfo()
            {
                SSL     = true,
                RootUrl = "dev-api.nuviot.com",
            };
            _appConfig.Environment = Environments.Development;
#elif ENV_LOCAL
            var serverInfo = new ServerInfo()
            {
                SSL     = false,
                RootUrl = "localhost:5001",
            };
            _appConfig.Environment = Environments.Local;
#elif ENV_STAGE
            var serverInfo = new ServerInfo()
            {
                SSL     = true,
                RootUrl = "stage-api.nuviot.com",
            };
            _appConfig.Environment = Environments.Staging;
#endif

            var clientAppInfo = new ClientAppInfo()
            {
                MainViewModel = typeof(MainViewModel)
            };

            DeviceInfo.Register();

            var deviceInfo = SLWIOC.Get <IDeviceInfo>();

            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);

            navigation.Add <MainViewModel, Views.MainView>();
            navigation.Add <SimulatorViewModel, Views.Simulator.SimulatorView>();
            navigation.Add <SimulatorEditorViewModel, Views.Simulator.SimulatorEditorView>();
            navigation.Add <MessageEditorViewModel, Views.Messages.MessageEditorView>();
            navigation.Add <SendMessageViewModel, Views.Messages.SendMessageView>();
            navigation.Add <MessageHeaderViewModel, Views.Messages.MessageHeaderView>();
            navigation.Add <PasswordEntryViewModel, Views.Simulator.PasswordEntryView>();
            navigation.Add <UnlockStorageViewModel, Views.Simulator.UnlockStorageView>();
            navigation.Add <SetStoragePasswordViewModel, Views.Simulator.SetStoragePasswordView>();
            navigation.Add <DynamicAttributeViewModel, Views.Messages.DynamicAttributeView>();

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

            navigation.Start <SplashViewModel>();

            SLWIOC.Register <IMQTTAppClient, MQTTAppClient>();
            SLWIOC.Register <IMQTTDeviceClient, MQTTDeviceClient>();

            SLWIOC.RegisterSingleton <IViewModelNavigation>(navigation);
        }
Ejemplo n.º 18
0
 public static void ConfigureSLWIOC()
 {
     SLWIOC.Register <ISimulatorManager, SimulatorManager>();
 }
Ejemplo n.º 19
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_TEST
            var serverInfo = new ServerInfo()
            {
                SSL     = true,
                RootUrl = "test-api.nuviot.com",
            };
#endif


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

            var clientAppInfo = new ClientAppInfo()
            {
                MainViewModel = typeof(MainViewModel)
            };

            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 <SimulatorViewModel, Views.Simulator.SimulatorView>();
            navigation.Add <SimulatorEditorViewModel, Views.Simulator.SimulatorEditorView>();
            navigation.Add <MessageEditorViewModel, Views.Messages.MessageEditorView>();
            navigation.Add <SendMessageViewModel, Views.Messages.SendMessageView>();
            navigation.Add <MessageHeaderViewModel, Views.Messages.MessageHeaderView>();
            navigation.Add <DynamicAttributeViewModel, Views.Messages.DynamicAttributeView>();

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

            navigation.Start <SplashViewModel>();

            SLWIOC.Register <IMQTTAppClient, MQTTAppClient>();
            SLWIOC.Register <IMQTTDeviceClient, MQTTDeviceClient>();

            SLWIOC.RegisterSingleton <IViewModelNavigation>(navigation);
        }
Ejemplo n.º 20
0
 /// <summary>
 /// Initializes the singleton application object.  This is the first line of authored code
 /// executed, and as such is the logical equivalent of main() or WinMain().
 /// </summary>
 public App()
 {
     this.InitializeComponent();
     this.Suspending += OnSuspending;
     SLWIOC.Register <IViewModelNavigation>(LagoVista.UWP.UI.Navigation.Instance);
 }
Ejemplo n.º 21
0
 public static void Register()
 {
     SLWIOC.Register <ILogger>(new FakeLogger());
 }