示例#1
0
        public async override void OnSelectItem(Item item)
        {
            if (item == null)
            {
                return;
            }
            if (IsInitialize == false)
            {
                return;
            }
            if (item.StationName == "通信异常!" || item.StationName == "查询时间无数据")
            {
                return;
            }
            int index;

            try
            {
                index = int.Parse(item.Id);
            }
            catch
            {
                return;
            }
            var itemViewModel = new StationDetailViewModel(item.StationName, index);

            Apphelper.HomeTabPage.RepportViewModel.Items.Add(string.Format("您在{0}查看了{1}",
                                                                           DateTime.Now, item.StationName));
            Apphelper.HomeTabPage.RepportView.RefreshData();

            await Apphelper.HomeTabPage.Navigation.PushAsync(
                new Pages.StationDetailPage(itemViewModel));
        }
示例#2
0
        async void OnSelectItem(Item item)
        {
            if (item == null)
            {
                return;
            }
            if (item == Items.LastOrDefault())
            {
                return;
            }
            if (itemTapBusy == true)
            {
                return;
            }
            itemTapBusy = true;

            int index;

            try
            {
                index = int.Parse(item.Id);
            }
            catch
            {
                itemTapBusy = false;
                return;
            }
            Apphelper.HomeTabPage.RepportViewModel.Items.Add(string.Format("您在{0}查看了{1}",
                                                                           DateTime.Now, item.StationName));
            Apphelper.HomeTabPage.RepportView.RefreshData();
            var itemViewModel = new StationDetailViewModel(Stations[index].Name, index);
            await Apphelper.HomeTabPage.Navigation.PushAsync(new Pages.StationDetailPage(itemViewModel));

            itemTapBusy = false;
        }