Exemple #1
0
        private async Task LaunchApplicationAsync(string page, object launchParam)
        {
            try
            {
                _applicationDataService     = Container.Resolve <IApplicationDataService>();
                _userDatagramService        = Container.Resolve <IUserDatagramService>();
                _transmissionControlService = Container.Resolve <ITransmissionControlService>();
                _databaseService            = Container.Resolve <IDatabaseService>();
                if (string.IsNullOrEmpty(_applicationDataService.GetSetting <string>("Guid")))
                {
                    _applicationDataService.SaveSetting("Guid", Guid.NewGuid().ToString());
                }
                ThemeSelectorService.SetRequestedTheme();
                await SetSelectedLanguage();

                NavigationService.Navigate(page, launchParam);
                Window.Current.Activate();
            }
            catch (Exception e)
            {
                if (_databaseService != null)
                {
                    await _databaseService.AddExceptionLogItem(new ExceptionLogItem()
                    {
                        Message = e.Message, Source = e.Source, StackTrace = e.StackTrace
                    });
                }
            }
            if (_databaseService != null && _exceptionLogItems != null && _exceptionLogItems.Count > 0)
            {
                _exceptionLogItems.ForEach(x => _databaseService.AddExceptionLogItem(x));
            }

            //return Task.CompletedTask;
        }
Exemple #2
0
 public UserDatagramService(IApplicationDataService applicationDataService, IBackgroundTaskService backgroundTaskService, ITransmissionControlService transmissionControlService, IEventAggregator eventAggregator, IIotService iotService)
 {
     _applicationDataService     = applicationDataService;
     _backgroundTaskService      = backgroundTaskService;
     _transmissionControlService = transmissionControlService;
     _eventAggregator            = eventAggregator;
     _iotService = iotService;
     _backgroundTaskRegistration = null;
 }
 public ShellViewModel(INavigationService navigationServiceInstance, IUnityContainer unityContainer)
 {
     _navigationService          = navigationServiceInstance;
     _applicationDataService     = unityContainer.Resolve <IApplicationDataService>();
     _backgroundTaskService      = unityContainer.Resolve <IBackgroundTaskService>();
     _liveTileUpdateService      = unityContainer.Resolve <ILiveTileUpdateService>();
     _userDatagramService        = unityContainer.Resolve <IUserDatagramService>();
     _transmissionControlService = unityContainer.Resolve <ITransmissionControlService>();
     ItemInvokedCommand          = new DelegateCommand <WinUI.NavigationViewItemInvokedEventArgs>(OnItemInvoked);
 }