protected override async void OnAppearing() { base.OnAppearing(); #region get forms to be processed try { _processFormRecords = await ViewModel.ProcessFormsAsync(); } catch { await DisplayAlert("Sorry!", "Something went wrong", "OK"); } if (_processFormRecords != null) { if (_processFormRecords.Success) { if (_processFormRecords.URLs.Count > 0) { Domain.Models.RequestModels.ProcessPatientFormModel domainUser = new Domain.Models.RequestModels.ProcessPatientFormModel(); domainUser.Forms = Settings.GetFormsList(); _processFormRecordsPvt = _processFormRecords; listUrlPvt = new List <UrlPvt>(); int x = 0; foreach (var url in _processFormRecordsPvt.URLs) { UrlPvt pvtu = new UrlPvt(); pvtu.UrlName = url; pvtu.FormName = domainUser.Forms[x].Name; listUrlPvt.Add(pvtu); x = x + 1; } listForms.ItemsSource = listUrlPvt; //end } else { await DisplayAlert("eForms", MessageNoFormsFound, "OK"); } } else { await DisplayAlert("eForms", MessageNoFormsFound, "OK"); } } #endregion listForms.IsVisible = true; ac.IsVisible = false; stkFinal.IsVisible = true; }
public Forms(UrlPvt item, int index) { var indexReceived = ListToProcessForms.listUrlPvtToBeProcessed.IndexOf(item); _urlReceived = item.UrlName; InitializeComponent(); webV.Source = _urlReceived; btnDone.Clicked += (snd, args) => { if ((ListToProcessForms.listUrlPvtToBeProcessed.Count - 1) > indexReceived) { indexReceived = indexReceived + 1; Navigation.PushAsync(new Forms(ListToProcessForms.listUrlPvtToBeProcessed[indexReceived], indexReceived)); } else { Application.Current.MainPage = new NavigationPage(new MainViewsMasters()); } }; }