コード例 #1
0
        void Handle_AnswerClicked(object sender, System.EventArgs e)
        {
            String answer = AskFeild.Text;

            if (answer == null)
            {
                DisplayAlert("Alert", "You must answer the question!", "Ok");
            }
            else
            {
                try
                {
                    //return page
                    AskAnyonePage basePage = (AskAnyonePage)Navigation.NavigationStack[0];
                    basePage.AnswerFirstAnswer(answer);
                    Navigation.PopAsync();
                }
                catch (Exception ex)
                {
                    DisplayAlert("Exception", ex.Message, "Ok", "Cancel");
                }
            }
        }
コード例 #2
0
        void Ask_Clicked(object sender, System.EventArgs e)
        {
            String question = AskFeild.Text;

            if (question == null)
            {
                DisplayAlert("Alert", "You must enter a question!", "Ok");
            }
            else
            {
                try
                {
                    //return page
                    AskAnyonePage basePage = (AskAnyonePage)Navigation.NavigationStack[0];
                    basePage.InsertNewQuestion(question);
                    basePage.StartAnswerTimer();
                    Navigation.PopAsync();
                }
                catch (Exception ex)
                {
                    DisplayAlert("Exception", ex.Message, "Ok", "Cancel");
                }
            }
        }