public async Task LoadUDS() { if (NotNetOrConnection) { return; } try { if (UserDefinedSelectionViewModels.Count == 0) { UserDefinedSelectionViewModels.Clear(); List <UserDefinedSelection> list = await NAV.LoadUDS(Zone.LocationCode, Zone.Code, ACD.Default).ConfigureAwait(true); if ((NotDisposed) && (list is List <UserDefinedSelection>)) { FillUDSList(list); } } } catch (OperationCanceledException e) { System.Diagnostics.Debug.WriteLine(e.Message); } catch (Exception e) { System.Diagnostics.Debug.WriteLine(e.Message); State = ModelState.Error; ErrorText = e.ToString(); } }
public async Task LoadUDS() { if (NotNetOrConnection) { return; } try { UserDefinedSelectionViewModels.Clear(); List <UserDefinedSelection> list = await NAV.LoadUDS(Zone.LocationCode, Zone.Code, ACD.Default).ConfigureAwait(true); if (list is List <UserDefinedSelection> ) { foreach (UserDefinedSelection uds in list) { UserDefinedSelectionViewModel udsvm = new UserDefinedSelectionViewModel(Navigation, uds) { UDSWidth = UDSPanelHeight, }; udsvm.OnTap += RunUDS; UserDefinedSelectionViewModels.Add(udsvm); } } MessagingCenter.Send(this, "UDSListIsLoaded"); } catch (OperationCanceledException e) { System.Diagnostics.Debug.WriteLine(e.Message); } catch (Exception e) { System.Diagnostics.Debug.WriteLine(e.Message); State = ModelState.Error; ErrorText = e.ToString(); } }