public AppointmentViewModel(INavigation navigation) { if ((GlobalVariables.GlobalAppointmentList == null) || (GlobalVariables.GlobalAppointmentList.Count == 0)) { Initialize(); } else { foreach (var c in GlobalVariables.GlobalAppointmentList) { AppointmentList.Add(c); _appointmentlist.Add(c); } } }
public void FilterContactList(string text) { try { AppointmentList.Clear(); foreach (var c in _appointmentlist) { if (c.description.ToLower().Contains(text.ToLower())) { AppointmentList.Add(c); } } } catch (Exception err) { Debug.WriteLine(err.Message); } }
public async void Initialize() { try { IsBusy = true; _appointmentlist = await GetAppointmentList(); foreach (var c in _appointmentlist) { AppointmentList.Add(c); GlobalVariables.GlobalAppointmentList.Add(c); } IsBusy = false; } catch (Exception err) { IsBusy = false; Debug.WriteLine(err.Message); } }
public async void Refresh() { try { IsRefreshing = true; _appointmentlist.Clear(); AppointmentList.Clear(); GlobalVariables.GlobalAppointmentList.Clear(); _appointmentlist = await GetAppointmentList(); foreach (var c in _appointmentlist) { AppointmentList.Add(c); GlobalVariables.GlobalAppointmentList.Add(c); } IsRefreshing = false; } catch (Exception err) { IsRefreshing = false; Debug.WriteLine(err.Message); } }