Exemplo n.º 1
0
        protected override void OnAppearing()
        {
            base.OnAppearing();

            if (!hasInitialization)
            {
                var articles = new ArticlesSearchPage()
                {
                    Title = "博客"
                };
                var news = new NewsSearchPage()
                {
                    Title = "新闻"
                };
                var kbArticles = new KbArticlesSearchPage()
                {
                    Title = "知识库"
                };
                var questions = new QuestionsSearchPage()
                {
                    Title = "博问"
                };

                this.Children.Add(articles);
                this.Children.Add(news);
                this.Children.Add(kbArticles);
                this.Children.Add(questions);

                this.SearchChanged += delegate(object sender, SearchChangedEventArgs e) {
                    searchValue = e.Value;
                    Search(searchValue);
                };
                this.CurrentPageChanged += delegate(object sender, EventArgs e) {
                    Search(searchValue);
                };

                hasInitialization = true;
            }
        }
Exemplo n.º 2
0
        public SearchPage()
        {
            BarTextColor       = (Color)Application.Current.Resources["NavigationText"];
            BarIndicatorColor  = (Color)Application.Current.Resources["Divider"];
            BarBackgroundColor = (Color)Application.Current.Resources["Primary"];

            var articles = new ArticlesSearchPage()
            {
                Title = "博客"
            };
            var news = new NewsSearchPage()
            {
                Title = "新闻"
            };
            var kbArticles = new KbArticlesSearchPage()
            {
                Title = "知识库"
            };
            var questions = new QuestionsSearchPage()
            {
                Title = "博问"
            };

            this.Children.Add(articles);
            this.Children.Add(news);
            this.Children.Add(kbArticles);
            this.Children.Add(questions);

            this.SearchChanged += delegate(object sender, SearchChangedEventArgs e)
            {
                searchValue = e.Value;
                Search(searchValue);
            };
            this.CurrentPageChanged += delegate(object sender, EventArgs e)
            {
                Search(searchValue);
            };
        }