public static void OnDialogFinished(string data, WebDialogStatus status, uint error)
        {
            WebDialogBroker.responseData = data;
            WebDialogBroker.responseStatus = status;
            WebDialogBroker.responseErrorDetail = error;

            WebDialogBroker.DialogInProgress = false;

            // Signal the waiting task that the authentication operation has finished.
            dialogFinishedEvent.Set();
        }
        /// <summary>
        /// Handler for the browser control's navigating event.  We use this to detect when login
        /// has completed.
        /// </summary>
        private void BrowserControl_Navigating(object sender, NavigatingEventArgs e)
        {
            if (e.Uri.OriginalString.IndexOf(WebDialogBroker.EndUri.OriginalString) == 0)
            {
                responseData = e.Uri.ToString();
                responseStatus = WebDialogStatus.Success;

                dialogFinished = true;

                // Navigate back now.
                browserControl.Source = new Uri("about:blank");
                NavigationService.GoBack();
            }
        }
        /// <summary>
        /// Handler for the page's back key events.  We use this to determine whether navigations
        /// away from this page are benign (such as going to the start screen) or actually meant
        /// to cancel the operation.
        /// </summary>
        void LoginPage_BackKeyPress(object sender, System.ComponentModel.CancelEventArgs e)
        {
            responseData = "";
            responseStatus = WebDialogStatus.UserCancel;

            dialogFinished = true;
        }
        /// <summary>
        /// Handler for the browser control's navigation failed event.  We use this to detect errors
        /// </summary>
        private void BrowserControl_NavigationFailed(object sender, NavigationFailedEventArgs e)
        {
            WebBrowserNavigationException navEx = e.Exception as WebBrowserNavigationException;

            if (navEx != null)
            {
                // Pass along the provided error information.
                responseErrorDetail = (uint)navEx.StatusCode;
            }
            else
            {
                // No error information available.
                responseErrorDetail = 0;
            }
            responseStatus = WebDialogStatus.ErrorHttp;

            dialogFinished = true;
            e.Handled = true;

            // Navigate back now.
            browserControl.Source = new Uri("about:blank");
            NavigationService.GoBack();
        }
 public WebDialogResult(string data, WebDialogStatus status, uint error)
 {
     ResponseData = data;
     ResponseStatus = status;
     ResponseErrorDetail = error;
 }