private async void Init() { StatusQuestions = new ObservableCollection <StatusQuestionsCardModel>(); BackToManagerQuestionsCommand = new RelayCommand(() => PopPushViewUtil.PopNavModalAsync <StatusSuggestionsView>(true)); using IMaterialModalPage dialog = await MaterialDialog.Instance.LoadingDialogAsync("Recolhendo informaçoes..."); IRestResponse response = await ManagerQuestionsService.StatusQuestionsTaskAsync(); if (response.StatusCode == HttpStatusCode.OK) { (await DeselializeAsync(response)).ForEach(question => { StatusQuestions.Add(new StatusQuestionsCardModel { Question = question, ViewStatusCommand = new RelayCommand <IQuestion>(ViewStatus) }); }); } else { await MaterialDialog.Instance.AlertAsync("Algo de errado nao está certo", "Ops"); } }
/// <inheritdoc /> public async Task ShowLoadingDialogAsync(string message = null) { if (loadingDialog != null) { await HideLoadingDialogAsync(); } loadingDialog = await MaterialDialog.Instance .LoadingDialogAsync(message ?? Strings.LoadingLabel, GetLoadingDialogConfiguration()); }
public static async Task OpenLoaderWithMessageAsync(string title) { if (DeviceApiHelpers.isUWP()) { await MainThread.InvokeOnMainThreadAsync(async() => UserDialogs.Instance.ShowLoading(title)); } else { await MainThread.InvokeOnMainThreadAsync(async() => LoaderDialogue = await MaterialDialog.Instance.LoadingDialogAsync("", title)); } }
private async void Registrar() { try { if (!string.IsNullOrEmpty(Usuario.Correo) && !string.IsNullOrEmpty(Usuario.Nick) && !string.IsNullOrEmpty(Usuario.Pass)) { if (!IsValidEmail(Usuario.Correo)) { Usuario.CorreoError = true; Usuario.CorreoMensajeError = "El correo no es válido"; Usuario.Error = false; Usuario.MensajeError = ""; } else { Usuario.CorreoError = false; Usuario.CorreoMensajeError = ""; Usuario.Error = false; Usuario.MensajeError = ""; using (IMaterialModalPage dialog = await MaterialDialog.Instance.LoadingDialogAsync(message: "Espere un momento...")) { await Task.Delay(5000); dialog.MessageText = "Estamos guardando sus datos"; await Task.Delay(5000); } await MaterialDialog.Instance.SnackbarAsync(message : "Gracias por registrarse"); } } else if (string.IsNullOrEmpty(Usuario.Nick) || string.IsNullOrEmpty(Usuario.Pass)) { Usuario.Error = true; Usuario.MensajeError = "El nick y la contraseña son obligatorios"; } } catch (Exception e) { Console.WriteLine(e); await MaterialDialog.Instance.SnackbarAsync(message : "Algo no salió bien :(", actionButtonText : "OK"); } }
public async Task ShowLoader(string message) { materialDialog = await MaterialDialog.Instance.LoadingDialogAsync(message : message); }
public async static Task ShowLoading(string message) { await Task.Run(async() => Loading = await MaterialDialog.Instance.LoadingDialogAsync(message: message)); Task.FromResult <object>(null); }
public MaterialLoadingRunningAlert(IMaterialModalPage materialPage) { IsRunning = true; Message = materialPage.MessageText; _materialPage = materialPage; }