private void HandleAction(bool ok)
        {
            if (ok)
            {
                AppDelegate.InvokeOnMainThread(async() =>
                {
                    await ConversationsControls.Create().ShowAsync();
                });
            }

            _isOpen = false;
        }
Exemple #2
0
        private void ContactSupportButton_TouchUpInside(object sender, EventArgs e)
        {
            UIAlertController actionSheetAlert = UIAlertController.Create(
                "Dispute Charge",
                "Select an item from below",
                UIAlertControllerStyle.ActionSheet);

            // Add Actions
            actionSheetAlert.AddAction(UIAlertAction.Create(
                                           "Call",
                                           UIAlertActionStyle.Default,
                                           async(action) =>
            {
                var callview = ConversationsControls.Create();
                await callview.SendCallRequestAsync();
                await callview.ShowAsync();
            }));

            actionSheetAlert.AddAction(UIAlertAction.Create(
                                           "Message",
                                           UIAlertActionStyle.Default,
                                           (action) => NavigateToMessages()));

            actionSheetAlert.AddAction(UIAlertAction.Create(
                                           "Cancel",
                                           UIAlertActionStyle.Cancel,
                                           (action) => Console.WriteLine("Cancel button pressed.")));

            // Required for iPad - You must specify a source for the Action Sheet since it is
            // displayed as a popover
            var presentationPopover = actionSheetAlert.PopoverPresentationController;

            if (presentationPopover != null)
            {
                presentationPopover.SourceView = View;
                presentationPopover.PermittedArrowDirections = UIPopoverArrowDirection.Up;
            }

            // Display the alert
            PresentViewController(actionSheetAlert, true, null);
        }