private void OnAppearingLoad() { SetLoadingMessage("Loading Settings...", true); //Add finished binding message to display when loading data done. //more unit tests. _settings.GetConsumingEnumerable(); _settings = new BlockingCollection <Setting>(); foreach (var setting in _settingAccess.GetSettings()) { _settings.Add(setting); } _settings.CompleteAdding(); var baseURLSetting = GetSettingByID((int)SettingsIDs.BaseURL); if (baseURLSetting == null) { throw new NullReferenceException("Base URL Setting not found...app will not be functional"); } if (Uri.TryCreate(baseURLSetting.SettingValue, UriKind.Absolute, out _baseUri)) { _baseUri = new Uri(baseURLSetting.SettingValue); SetLoadingMessage("Done!", false); } else { SetLoadingMessage("BaseURL Formatting Error", false); _platformToast.ShowToast($"Base URL {baseURLSetting.SettingValue} is an incorrect URL Format"); } }
public void LoadSettings() { Settings = new ObservableCollection <Setting>(_settingAccess.GetSettings()); }