public async void TappedCommand(LoaclItemOfTaskDto dto) { try { if (SystemList == null || SystemList.Count == 0) { return; } if (null != SystemDto) { int seq = SystemDto.SeqNo; LoaclItemOfTaskDto currentDto = SystemList.Where(p => p.SeqNo == seq && p.TPId == SystemDto.TPId && p.TIId == SystemDto.TIId).FirstOrDefault(); try { await Navigation.PushAsync <LocalRegistScoreViewModel>((vm, v) => vm.Init(SystemList, currentDto), true); } catch (Exception) { } } } catch (Exception) { } }
public async void Init(List <LoaclItemOfTaskDto> list, LoaclItemOfTaskDto dto) { try { SystemList = list; CurrentSystem = new LoaclItemOfTaskDto(); CurrentSystem = dto; List <CheckStandard> cSList = await _localScoreService.SearchCheckStandard(CurrentSystem.TPId, CurrentSystem.TIId.ToString()); CSList = new ObservableCollection <CheckStandard>(); foreach (var item in cSList) { CSList.Add(item); } List <StandardPic> sPicList = await _localScoreService.SearchStandardPic(CurrentSystem.TPId, CurrentSystem.TIId); SPicList = new ObservableCollection <StandardPic>(); foreach (var item in sPicList) { SPicList.Add(item); } PStandardList = new ObservableCollection <PictureStandard>(); List <PictureStandard> pictureStandardLst = await _localScoreService.SearchPictureStandard(CurrentSystem.TPId, CurrentSystem.TIId); foreach (var item in pictureStandardLst) { PStandardList.Add(item); } IsPreview = true; int index = list.IndexOf(list.FirstOrDefault(p => p.SeqNo == dto.SeqNo));// list.IndexOf(dto) + 1; CurrentPage = index + 1; //CurrentPage = dto.SeqNo; JumpPage = 1; RowHeight = CSList.Count * 50; PicRowHeight = PStandardList.Count * 50; LossImageList = SPicList.Count * 50; IsLoading = false; CurrentScore = CurrentSystem.Score == -1 ? "" : CurrentSystem.Score.ToString(); if (SystemList != null && SystemList.Count > 1) { if (index == 0) { IsPreEnable = false; } else { IsPreEnable = true; } } else { IsPreEnable = false; } } catch (Exception) { } }