Beispiel #1
0
        private async Task SaveSettings()
        {
            try
            {
                await SETTINGS_STORE.SaveAsync(CurrentSettings);

                MessagingCenter.Send <object>(this, "SettingsUpdated");
                ToastService.ToastShortMessage(AppResources.Save_Success);
            }
            catch (Exception)
            {
                ToastService.ToastShortMessage(AppResources.Save_Failed);
            }
        }
Beispiel #2
0
        private async void InitialSettings()
        {
            CurrentSettings = await SETTINGS_STORE.GetAsync(1);

            if (CurrentSettings == null)
            {
                MessagingCenter.Subscribe <object>(this,
                                                   "DatabaseInitialized",
                                                   async sender =>
                {
                    CurrentSettings = await SETTINGS_STORE.GetAsync(1);
                    if (CurrentSettings != null)
                    {
                        MessagingCenter.Unsubscribe <object>(this,
                                                             "DatabaseInitialized");
                        NotifyPropertyChanged(nameof(CurrentSettings));
                    }
                });
            }
        }