Ejemplo n.º 1
0
        public SearchView()
        {
            Padding         = new Thickness(0, 12);
            VerticalOptions = LayoutOptions.FillAndExpand;
            OnePage.topView.SearchProduct += OnSearchProduct;

            int countColumn = 2;

            productsListTemplate = new ProductsListTemplate(countColumn, OnClickProduct);
            //productsListTemplate.ClickProduct += OnClickProduct;
            productTemplate = new ProductView();
            productTemplate.EventTableSizeClick += OnTableSize;
            productTemplate.ImageClick.Tapped   += ProductImageClick;

            indicator = new ActivityIndicator {
                Color           = Device.OnPlatform(Color.Black, Color.Gray, Color.Default),
                IsRunning       = true,
                VerticalOptions = LayoutOptions.CenterAndExpand,
            };
            scrollMain = new ScrollView()
            {
                Content = productsListTemplate
            };
            Content = scrollMain;
            SearchProduct();
            OnePage.topView.searchBar.Focus();
        }
Ejemplo n.º 2
0
        public CatalogView(bool isLoadAllCategories)
        {
            OnePage.mainPage.appRequest.AbortAll();

            filterParamDefault = new FilterParam {
                paramForSort = ParamSort.ParamsList.SingleOrDefault(g => g.Id == ProductsIDSort.products_date_added)
            };
            VerticalOptions = LayoutOptions.FillAndExpand;
            OnePage.topView.layoutImgFilter.IsVisible = false;

            InitializationIndication();
            Content = allActivityIndicator;

            int countColumn = 2;

            productsListTemplate = new ProductsListTemplate(countColumn, ClickProduct);

            InitializationProductSort();
            mainLayout = new StackLayout {
                VerticalOptions = LayoutOptions.FillAndExpand
            };

            InitializationCategoryList(isLoadAllCategories);

            layout = new StackLayout {
                Spacing         = 0,
                VerticalOptions = LayoutOptions.StartAndExpand,
                Children        =
                {
                    listViewCategory,
                    productsListTemplate
                }
            };
            scrollView = new ScrollView {
                VerticalOptions = LayoutOptions.FillAndExpand
            };
            scrollView.Content = layout;

            productTemplate = new ProductView {
                IsVisible = false
            };
            productTemplate.EventTableSizeClick += OnTableSize;
            productTemplate.ImageClick.Tapped   += ProductImageClick;

            mainLayout.Children.Add(productSort);
            mainLayout.Children.Add(scrollView);
            mainLayout.Children.Add(productTemplate);
        }