コード例 #1
0
ファイル: UserInfoView.cs プロジェクト: galoch-s/OMShopMobile
        async void OnSelectMyOrderStatus(object sender, EventArgs e)
        {
            CellTemplate orderStatusCell = sender as CellTemplate;

//			CellTemplate Content = sender as CellTemplate;
//			Content.BackgroundColor = ApplicationStyle.LineColor;
//			if (Content.SelectedItem != null) {
            if (listViewStatus.IsVisible)
            {
                await scrollBody.ScrollToAsync(0, 0, true);

                listViewStatus.IsVisible = false;
                orderStatusCell.SetLeft();
            }
            else
            {
                listViewStatus.IsVisible = true;
                await Task.Delay(10);

                await scrollBody.ScrollToAsync(listViewStatus, ScrollToPosition.End, true);

                orderStatusCell.SetDown();
            }
//			}
//			Content.SelectedItem = null;
        }
コード例 #2
0
ファイル: ProductsSort.cs プロジェクト: galoch-s/OMShopMobile
        async void OnSelectSize(object sender, EventArgs e)
        {
            CellTemplate orderStatusCell = sender as CellTemplate;

            if (listSizes.IsVisible)
            {
                await this.ScrollToAsync(0, 0, true);

                listSizes.IsVisible = false;
                orderStatusCell.SetLeft();
            }
            else
            {
                listSizes.IsVisible = true;
//				await this.ScrollToAsync (listSizes, ScrollToPosition.End, true);
                orderStatusCell.SetDown();
            }
        }
コード例 #3
0
ファイル: ProductsSort.cs プロジェクト: galoch-s/OMShopMobile
        public ProductsSortView(FilterParam _filterParam)
        {
            filterParamDefault = _filterParam;
            VerticalOptions    = LayoutOptions.FillAndExpand;

            indicator = new ActivityIndicator {
                Color           = Device.OnPlatform(Color.Black, Color.Gray, Color.Default),
                IsRunning       = true,
                VerticalOptions = LayoutOptions.CenterAndExpand,
            };

            Label lblSort = new Label {
                Text            = "Сортировать по:",
                VerticalOptions = LayoutOptions.CenterAndExpand
            };
            StackLayout titleSortLayout = new StackLayout {
                BackgroundColor = ApplicationStyle.LineColor,
                HeightRequest   = Utils.GetSize(22),
                Padding         = new Thickness(8, 0),
                Children        =
                {
                    lblSort
                }
            };

            sortList = new ListView {
                ItemTemplate    = new DataTemplate(typeof(SortItemCell)),
                ItemsSource     = ParamSort.ParamsList,
                VerticalOptions = LayoutOptions.Start,
                RowHeight       = Utils.GetSize(43),
            };
            sortList.SizeChanged += (sender, e) => {
                sortList.HeightRequest = (sortList.RowHeight + 0.5) * ParamSort.ParamsList.Count;
            };
            sortList.ItemTapped += OnClickSort;
            Sorted(sortList, _filterParam.paramForSort);

            Label lblFilter = new Label {
                Text            = "Фильтровать по:",
                VerticalOptions = LayoutOptions.CenterAndExpand
            };
            StackLayout titleFilterLayout = new StackLayout {
                BackgroundColor = ApplicationStyle.LineColor,
//				VerticalOptions = LayoutOptions.Start,
                HeightRequest = Utils.GetSize(22),
                Padding       = new Thickness(8, 0),
                Children      =
                {
                    lblFilter
                }
            };

            sizesCell = new CellTemplate("Размеру")
            {
                HeightRequest = Utils.GetSize(43)
            };
            TapGestureRecognizer tapOrderStatusList = new TapGestureRecognizer();

            tapOrderStatusList.Tapped += OnSelectSize;;
            sizesCell.GestureRecognizers.Add(tapOrderStatusList);

            listSizes = new ListView {
                ItemTemplate = new DataTemplate(typeof(RadioButtonItemCell)),
            };
            listSizes.ItemTapped += OnClickSize;

            layoutSize = new StackLayout {
                Spacing  = 0,
                Children =
                {
                    sizesCell,
                    new BoxView(),
                    listSizes
                }
            };

            entPriceBegin = new MyEntry {
                VerticalOptions         = LayoutOptions.CenterAndExpand,
                HorizontalTextAlignment = TextAlignment.Center,
                Padding           = new Thickness(5),
                BorderColor       = ApplicationStyle.LineColor,
                BorderRadius      = Utils.GetSize(3),
                BorderWidth       = Utils.GetSize(1),
                HeightRequest     = Utils.GetSize(26),
                WidthRequest      = Utils.GetSize(80),
                Placeholder       = "от",
                HorizontalOptions = LayoutOptions.EndAndExpand,
                Keyboard          = Keyboard.Numeric
            };
            entPriceEnd = new MyEntry {
                VerticalOptions         = LayoutOptions.CenterAndExpand,
                HorizontalTextAlignment = TextAlignment.Center,
                Padding       = new Thickness(5),
                BorderColor   = ApplicationStyle.LineColor,
                BorderRadius  = Utils.GetSize(3),
                BorderWidth   = Utils.GetSize(1),
                HeightRequest = Utils.GetSize(26),
                WidthRequest  = Utils.GetSize(80),
                Placeholder   = "до",
                Keyboard      = Keyboard.Numeric
            };

            Label lblPriceBegin = new Label {
                VerticalOptions = LayoutOptions.CenterAndExpand,
                TextColor       = ApplicationStyle.TextColor,
                Text            = "Цене"
            };

            Label lblPriceEnd = new Label {
                VerticalOptions = LayoutOptions.CenterAndExpand,
                Text            = " — "
            };

            StackLayout layoutPrice = new StackLayout {
                Orientation   = StackOrientation.Horizontal,
                Padding       = new Thickness(16, 0, 24, 0),
                HeightRequest = Utils.GetSize(43),
                Children      =
                {
                    lblPriceBegin,
                    entPriceBegin,
                    lblPriceEnd,
                    entPriceEnd,
                }
            };

            Button btnClear = new Button {
                BackgroundColor = Color.Transparent,
                TextColor       = ApplicationStyle.GreenColor,
                BorderColor     = ApplicationStyle.GreenColor,
                BorderWidth     = 1,
                WidthRequest    = Utils.GetSize(150),
                Text            = "СБРОСИТЬ ВСЕ",
            };

            btnClear.Clicked += OnClearClick;

            btnOk = new Button {
                BackgroundColor   = ApplicationStyle.RedColor,
                TextColor         = Color.White,
                HorizontalOptions = LayoutOptions.EndAndExpand,
                WidthRequest      = Utils.GetSize(150),
                Text = "ПРИМЕНИТЬ",
            };
            btnOk.Clicked += OnOkClick;

            StackLayout layoutBtn = new StackLayout {
                Padding       = new Thickness(8, 16),
                HeightRequest = Utils.GetSize(35),
                Orientation   = StackOrientation.Horizontal,
                Children      =
                {
                    btnClear,
                    btnOk,
                }
            };

            mainLayout = new StackLayout {
                VerticalOptions = LayoutOptions.FillAndExpand,
                Spacing         = 0,
                Children        =
                {
                    titleSortLayout,
                    sortList,
                    titleFilterLayout,
                    layoutSize,
                    layoutPrice,
                    new BoxView(),
                    layoutBtn,
                }
            };
            Content = mainLayout;
        }
コード例 #4
0
ファイル: UserInfoView.cs プロジェクト: galoch-s/OMShopMobile
        public UserInfoView()
        {
            OrderStatusList = User.Singleton.OrderStatusList;
            indicator       = new ActivityIndicator {
                Color           = Device.OnPlatform(Color.Black, Color.Gray, Color.Default),
                IsRunning       = true,
                IsVisible       = true,
                VerticalOptions = LayoutOptions.CenterAndExpand,
            };
            Content = indicator;

            StackLayout          layoutInfo = GetLayoutInfo();
            TapGestureRecognizer tapInfo    = new TapGestureRecognizer();

            layoutInfo.GestureRecognizers.Add(tapInfo);
            tapInfo.Tapped += OnClickInfo;

            StackLayout lineOrderLayout = new StackLayout {
                BackgroundColor = ApplicationStyle.LineColor,
                HeightRequest   = Utils.GetSize(22),
            };

            CellTemplate orderCell = new CellTemplate("Мои заказы")
            {
                HeightRequest = Utils.GetSize(43)
            };
            TapGestureRecognizer tapOrdersList = new TapGestureRecognizer();

            tapOrdersList.Tapped += OnSelectMyOrder;
            orderCell.GestureRecognizers.Add(tapOrdersList);

            StackLayout lineStatusOrderLayout = new StackLayout {
                BackgroundColor = ApplicationStyle.LineColor,
                HeightRequest   = Utils.GetSize(22),
            };

            gridStatusOrder = new Grid {
                HeightRequest   = Utils.GetSize(200),
                RowSpacing      = 0,
                ColumnSpacing   = 0,
                BackgroundColor = ApplicationStyle.LineColor,
                RowDefinitions  =
                {
                    new RowDefinition {
                        Height = new GridLength(33, GridUnitType.Star)
                    },
                    new RowDefinition {
                        Height = Utils.GetSize(0.6)
                    },
                    new RowDefinition {
                        Height = new GridLength(33, GridUnitType.Star)
                    },
                    new RowDefinition {
                        Height = Utils.GetSize(0.6)
                    },
                    new RowDefinition {
                        Height = new GridLength(33, GridUnitType.Star)
                    },
                },
                ColumnDefinitions =
                {
                    new ColumnDefinition {
                        Width = new GridLength(50, GridUnitType.Star)
                    },
                    new ColumnDefinition {
                        Width = Utils.GetSize(0.6)
                    },
                    new ColumnDefinition {
                        Width = new GridLength(50, GridUnitType.Star)
                    }
                }
            };


            listViewStatus = new ListView {
                ItemTemplate    = new DataTemplate(typeof(ListCellTemplate)),
                VerticalOptions = LayoutOptions.Start,
//				ItemsSource = OrderStatusList,
                IsVisible = false,
            };
            listViewStatus.ItemSelected += ListViewStatusClick;

            SetOrderStatus();

            CellTemplate orderStatusCell = new CellTemplate("Статус заказов")
            {
                HeightRequest = Utils.GetSize(43),
            };
            TapGestureRecognizer tapOrderStatusList = new TapGestureRecognizer();

            tapOrderStatusList.Tapped += OnSelectMyOrderStatus;
            orderStatusCell.GestureRecognizers.Add(tapOrderStatusList);


            StackLayout layoutBody = new StackLayout {
                Spacing  = 0,
                Children =
                {
                    layoutInfo,
                    lineOrderLayout,
                    orderCell,
                    lineStatusOrderLayout,
                    gridStatusOrder,
                    new BoxView(),
                    orderStatusCell,
                    new BoxView(),
                    listViewStatus,
                }
            };

            scrollBody = new ScrollView {
                VerticalOptions = LayoutOptions.FillAndExpand,
                Content         = layoutBody,
            };

            Button btnExit = new Button {
                BackgroundColor   = Color.White,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                HeightRequest     = Utils.GetSize(42),
                TextColor         = ApplicationStyle.GreenColor,
                FontSize          = Utils.GetSize(17),
                Text = "Выйти"
            };

            btnExit.Clicked += (sender, e) => {
                if (EventExitUser != null)
                {
                    EventExitUser(sender, e);
                }
            };

            StackLayout layoutBottom = new StackLayout {
                Spacing         = 0,
                HeightRequest   = Utils.GetSize(43),
                VerticalOptions = LayoutOptions.End,
                Children        =
                {
                    new BoxView(),
                    btnExit
                }
            };

            layoutMain = new StackLayout {
                Spacing  = 0,
                Children =
                {
                    scrollBody,
                    layoutBottom
                }
            };
//			Content = layoutMain;
//			SetLayoutInfo ();
        }