Пример #1
0
        public SearchPage(string textSearch)
        {
            Title        = "Gallery";
            _dataImage   = ResquestAPI.getSearchImages(textSearch);
            _stackLayout = new StackLayout
            {
                BackgroundColor = Color.FromHex("101010"),
                Spacing         = 20,
                Padding         = new Thickness(20),
            };
            build(_dataImage);
            ScrollView scrollView = new ScrollView {
                Content = _stackLayout
            };

            Content = scrollView;
        }
Пример #2
0
        public void Searchview()
        {
            _textSearch   = new Editor {
            };
            _buttonSearch = new Button
            {
                BackgroundColor   = Color.FromHex("101010"),
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.Center,
                Text = "Search"
            };
            Frame search = new Frame
            {
                BackgroundColor = Color.FromHex("000000"),
                Content         = new StackLayout
                {
                    Children =
                    {
                        _textSearch,
                        _buttonSearch
                    }
                },
            };

            _buttonSearch.Clicked += delegate {
                if (_textSearch.Text == null || _textSearch.Text == "")
                {
                    _dataImage = ResquestAPI.getAllGallery("0");
                    reloadview();
                    return;
                }
                Console.WriteLine("--------------------\n" + _textSearch.Text + "\n--------------------");
                _dataImage = ResquestAPI.getSearchImages(_textSearch.Text);
                reloadview();
            };
            _stackLayout.Children.Add(search);
        }