void OnSelectInfo(object sender, SelectedItemChangedEventArgs e) { indicator = new ActivityIndicator { Color = Device.OnPlatform(Color.Black, Color.Gray, Color.Default), IsRunning = true, IsVisible = true, VerticalOptions = LayoutOptions.CenterAndExpand, }; ListView listView = sender as ListView; listView.SelectedItem = null; InfoOrder infoOrder = e.SelectedItem as InfoOrder; if (infoOrder != null && infoOrder.Page != InfoBasketPage.Empty) { switch (infoOrder.Page) { case InfoBasketPage.Delivery: lblInfo.Text = OrderResult.DeliveryForCustomer?.Title; OnePage.redirectApp.AddTransition(PageName.Order, "Доставка"); break; case InfoBasketPage.Address: lblInfo.Text = OrderResult.Country + ", " + OrderResult.Zone + ", " + OrderResult.City + ", " + OrderResult.Street; OnePage.redirectApp.AddTransition(PageName.Order, "Адрес"); break; case InfoBasketPage.Product: OnePage.redirectApp.AddTransition(PageName.Login, "Состав заказа", HistoryStep.OrdersList); Content = indicator; string url = OrderPosition.GetUrl(OrderResult.Id); ShowProducts(url); break; default: break; } layoutList.IsVisible = false; layoutLabel.IsVisible = true; // Content = layout; } else { // infoListView.SelectedItem = null; } }
async void ShowProducts(string url) { Url = url; ContentAndHeads <OrderPosition> contentList; try { contentList = await OrderPosition.GetOrderPositionAsync(url, CurrentPage, XPagination.CountProduct); } catch (Exception) { eventRefresh = null; eventRefresh += (sender, e) => { Button content = sender as Button; content.IsEnabled = false; ShowProducts(url); }; Content = OnePage.mainPage.ShowMessageError(eventRefresh); return; } if (contentList == null || contentList.ContentList == null || contentList.ContentList.Count == 0) { Content = new Label { Margin = new Thickness(8), Text = "Количество товаров 0" }; return; } if (contentList.countPage > 1) { SetPagination(paginationBegin, contentList); SetPagination(paginationEnd, contentList); paginationBegin.IsVisible = true; paginationEnd.IsVisible = true; } else { paginationBegin.IsVisible = false; paginationEnd.IsVisible = false; } listProduct.ItemsSource = OrderListToBasketList(contentList.ContentList);; EventImageClick += OnImageClick; listProduct.HeightRequest = listProduct.RowHeight * contentList.ContentList.Count; Content = scrollProduct; }