async void doAddEvent()
        {
            if (viewModel.SelectedCalendar == null)
            {
                return;
            }

            bool result = await CalendarService.AddReminderAsync(viewModel.SelectedCalendar, viewModel.Item);

            if (result == true)
            {
                await DisplayAlert("Success", "Event has been added to your calendar", "OK");
            }
            else
            {
                if (viewModel.SelectedCalendar != null)
                {
                    viewModel.SelectedCalendar = null;
                    await DisplayAlert("Error", "Select another calendar", "OK");
                }
                else
                {
                    await DisplayAlert("Error", "Cannot add event", "OK");
                }
            }
        }
Beispiel #2
0
        async void AddToCalendar_Clicked(object sender, System.EventArgs e)
        {
            bool result = await CalendarService.AddReminderAsync(viewModel.Item.Event);

            if (result == true)
            {
                await DisplayAlert("Success", "Event has been added to your calendar", "OK");
            }
            else
            {
                await DisplayAlert("Error", "Cannot add event", "OK");
            }
        }