Example #1
0
 private async void OnConnectionLost()
 {
     if (StateWidget == WidgetState.NoConnection)
     {
         return;
     }
     await Task.Run((() =>
     {
         StateWidget = WidgetState.NoConnection;
         StarterViewModels.ForEach((model => model?.SetLostConnection()));
         DefectStateViewModel.SetLostConnection();
         OutgoingLinesViewModel?.SetConnectionLost();
         CustomItemsViewModel?.SetLostConnection();
     }));
 }
Example #2
0
 /// <summary>
 ///     Called when the implementer is being navigated away from.
 ///     Вызывается при переходе с вьюхи
 /// </summary>
 /// <param name="navigationContext">The navigation context</param>
 public void OnNavigatedFrom(NavigationContext navigationContext)
 {
     this.DeviceDate = null;
     navigationContext.Parameters.Add(ApplicationGlobalNames.CURRENT_DEVICE_VIEW_MODEL, _currentDeviceViewModel);
     _navigationContext.ForEach((pair =>
     {
         navigationContext.Parameters.Add(pair.Key, pair.Value);
     }));
     (_currentDeviceViewModel.Model as IRuntimeDevice).DeviceInitialized -= OnDeviceInitialized;
     (_currentDeviceViewModel.Model as IRuntimeDevice).SetUpdatingMode(false);
     OutgoingLinesViewModel?.Dispose();
     OutgoingLinesViewModel       = null;
     StarterDescriptions          = new List <string>();
     FiderDescriptions            = new List <string>();
     this._currentDeviceViewModel = null;
     _analogMeterViewModel?.Dispose();
     _analogMeterViewModel = null;
 }