示例#1
0
        async void navigateToDecisionPage(object sender, System.EventArgs e)
        {
            if (titleText.Text == "")
            {
                await DisplayAlert("Empty Name", "Please enter decision name", "OK");
            }
            else
            {
                List <Decision> allDecisions = await service.GetAllDecisions();

                int      id = allDecisions.Count + 1;
                Decision d  = new Decision(id, titleText.Text, 50, 50);
                await service.AddDecision(id, titleText.Text, 50, 50);

                titleText.Text = "";
                await Navigation.PushAsync(new DecisionPage(id));
            }
        }