Ejemplo n.º 1
0
        /// <summary>
        /// Show dialog with title, message and positive button.
        /// </summary>
        /// <param name="title">dialog title</param>
        /// <param name="message">dialog message</param>
        /// <param name="buttonText">text for positive button</param>
        public static async Task ShowAsyncAlertWithTitleMessageAndOk(string title, string message,
                                                                     string buttonText)
        {
            UniroidDialog.ShowOk(title, message, buttonText);

            bool isDialogClosed = false;

            OnClickEvent += WaitForClickEvent;

            while (!isDialogClosed)
            {
                await Task.Delay(TimeSpan.FromMilliseconds(50));
            }


            void WaitForClickEvent(int clickResult)
            {
                OnClickEvent  -= WaitForClickEvent;
                isDialogClosed = true;
            }
        }