private void LoadSettingExecute(SettingsMetaEntry sender)
        {
            var uiWorkflow  = IoC.Resolve <IUiWorkflow>();
            var textService = IoC.Resolve <ITextService>();

            SimpleWorkAsync(async() =>
            {
                if (!PersistantSettingsService.LoadSettings(sender))
                {
                    await DialogCoordinator.Instance.ShowMessageAsync(uiWorkflow,
                                                                      textService.Compile("Application.LoadSettings.Error.Title", CultureInfo.CurrentUICulture,
                                                                                          out _)
                                                                      .ToString(),
                                                                      textService.Compile("Application.LoadSettings.Error.Message", CultureInfo.CurrentUICulture,
                                                                                          out _).ToString()
                                                                      );
                    return;
                }

                foreach (var wizardStepBaseViewModel in uiWorkflow.Steps)
                {
                    await wizardStepBaseViewModel.ReadSettings(PersistantSettingsService.LoadedSettings.Values);
                }


                _forceCanGoNext = true;
                uiWorkflow.NextPageCommand.Execute(null);
                _forceCanGoNext = false;
            });
        }
Esempio n. 2
0
 public bool LoadSettings(SettingsMetaEntry settings)
 {
     try
     {
         LoadedSettings = JsonSerializer.Deserialize <SettingsEntry>(File.ReadAllText(settings.Path));
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
 private bool CanLoadSettingExecute(SettingsMetaEntry sender)
 {
     return(sender != null);
 }