public void ExitModelContext(NavigationContext oldContext, NavigationContext newContext) { // copy all CinemaIds in a List to compare with the old Cinemas var l = _selectedCinemas.Select(c => c.Id).ToList(); var b = false; if (_lSettings.LocationSetupList != null) { // compare with old Cinemas b |= _lSettings.LocationSetupList.Any(c => !l.Contains(c.Id)); // Cinema Added or Removed b |= _selectedCinemas.Count != _lSettings.LocationSetupList.Count; } else { // If there was no old list b = true; } // Save the Settings _lSettings.LocationSetupList = _selectedCinemas; _lSettings.Changed = b; ServiceRegistration.Get <ISettingsManager>().Save(_lSettings); // Fix the Datebug Settings.CinemaSettings _settings = new Settings.CinemaSettings(); _settings.LastUpdate = DateTime.Today; ServiceRegistration.Get <ISettingsManager>().Save(_settings); }
public void ExitModelContext(NavigationContext oldContext, NavigationContext newContext) { // copy all CinemaIds in a List to compare with the old Cinemas var l = _selectedCinemas.Select(c => c.Id).ToList(); var b = false; if (_lSettings.LocationSetupList != null) { // compare with old Cinemas b |= _lSettings.LocationSetupList.Any(c => !l.Contains(c.Id)); // Cinema Added or Removed b |= _selectedCinemas.Count != _lSettings.LocationSetupList.Count; } else // If there was no old list b = true; // Save the Settings _lSettings.LocationSetupList = _selectedCinemas; _lSettings.Changed = b; ServiceRegistration.Get<ISettingsManager>().Save(_lSettings); // Fix the Datebug Settings.CinemaSettings _settings = new Settings.CinemaSettings(); _settings.LastUpdate = DateTime.Today; ServiceRegistration.Get<ISettingsManager>().Save(_settings); }