public QuestionsPage(int position = 0) : base()
        {
            InitializeComponent();

            BindingContext = new QuestionsViewModel(position);

            var cancel = new ToolbarItem
            {
                Text    = "添加",
                Command = new Command(async() =>
                {
                    if (UserTokenSettings.Current.HasExpiresIn())
                    {
                        MessagingService.Current.SendMessage(MessageKeys.NavigateLogin);
                    }
                    else
                    {
                        await NavigationService.PushAsync(Navigation, new QuestionsEditPage(new Questions(), new Action <Questions>(OnResult)));
                    }
                })
            };

            ToolbarItems.Add(cancel);

            if (Device.Android == Device.RuntimePlatform)
            {
                cancel.Icon = "toolbar_add.png";
            }


            this.QuestionsListView.ItemSelected += async delegate
            {
                var questions = QuestionsListView.SelectedItem as Questions;
                if (questions == null)
                {
                    return;
                }

                var questionsDetails = new QuestionsDetailsPage(questions);

                await NavigationService.PushAsync(Navigation, questionsDetails);

                this.QuestionsListView.SelectedItem = null;
            };
        }
        public QuestionsSearchPage() : base()
        {
            InitializeComponent();
            BindingContext = new SearchViewModel(3);
            this.SearchsListView.ItemSelected += async delegate
            {
                var search = SearchsListView.SelectedItem as Search;
                if (search == null)
                {
                    return;
                }
                var id        = search.Uri.Substring(search.Uri.LastIndexOf("/") + 1);
                var questions = new Questions()
                {
                    Qid              = int.Parse(id),
                    Title            = search.Title,
                    Content          = search.Content,
                    Award            = 0,
                    QuestionUserInfo = new QuestionUserInfo
                    {
                        UserName = search.UserName,
                        IconName = search.UserAlias
                    },
                    DateAdded   = search.PublishTime,
                    DiggCount   = search.VoteTimes,
                    AnswerCount = search.CommentTimes,
                    ViewCount   = search.ViewTimes
                };

                var articlesDetails = new QuestionsDetailsPage(questions);

                await NavigationService.PushAsync(Navigation, articlesDetails);

                this.SearchsListView.SelectedItem = null;
            };
        }