Exemplo n.º 1
0
        /// <summary>
        /// Mimics the WebviewAuthentication's AuthenticateAsync method.
        /// </summary>
        public static void AuthenticateAsync(WebAuthenticationOptions options, Uri startUri, Uri endUri)
        {
            if (options != WebAuthenticationOptions.None)
            {
                throw new NotImplementedException("This method does not support authentication options other than 'None'.");
            }
            Popup dialogPopup = new Popup();

            var webDialog = new WebDialogUserControl();

            webDialog.ParentControlPopup = dialogPopup;
            dialogPopup.Child            = webDialog;

#if WP8 || WINDOWS_PHONE
            // Set where the popup will show up on the screen.
            dialogPopup.VerticalOffset   = 40;
            dialogPopup.HorizontalOffset = 0;
#endif

#if WP8
            dialogPopup.Height = Application.Current.Host.Content.ActualHeight - 40;
            dialogPopup.Width  = Application.Current.Host.Content.ActualWidth;
#endif

#if WINDOWS_PHONE
            dialogPopup.Height = Window.Current.Bounds.Height - 40;
            dialogPopup.Width  = Window.Current.Bounds.Width;
#endif

#if WINDOWS
            dialogPopup.Height = Window.Current.Bounds.Height;
            dialogPopup.Width  = Window.Current.Bounds.Width;
#endif


            webDialog.Height = dialogPopup.Height;
            webDialog.Width  = dialogPopup.Width;

            webDialog.LoginViaWebview(startUri);

            // Open the popup.
            dialogPopup.IsOpen = true;
        }
Exemplo n.º 2
0
        public static void ShowFeedDialog()
        {
            Popup dialogPopup = new Popup();

            //dialogPopup.Loaded += dialogPopup_Loaded;

            var webDialog = new WebDialogUserControl();

            webDialog.ParentControlPopup = dialogPopup;
            dialogPopup.Child            = webDialog;

#if WP8 || WINDOWS_PHONE
            // Set where the popup will show up on the screen.
            dialogPopup.VerticalOffset   = 40;
            dialogPopup.HorizontalOffset = 0;
#endif

#if WP8
            dialogPopup.Height = Application.Current.Host.Content.ActualHeight - 40;
            dialogPopup.Width  = Application.Current.Host.Content.ActualWidth;
#endif

#if WINDOWS_PHONE
            dialogPopup.Height = Window.Current.Bounds.Height - 40;
            dialogPopup.Width  = Window.Current.Bounds.Width;
#endif

#if WINDOWS
            dialogPopup.Height = Window.Current.Bounds.Height;
            dialogPopup.Width  = Window.Current.Bounds.Width;
#endif


            webDialog.Height = dialogPopup.Height;
            webDialog.Width  = dialogPopup.Width;


            webDialog.ShowFeedDialog();

            // Open the popup.
            dialogPopup.IsOpen = true;
        }
Exemplo n.º 3
0
        public static void ShowAppRequestsDialog(WebDialogFinishedDelegate callback, String message = "Select your friends", List <string> appIdList = null)
        {
            Popup dialogPopup = new Popup();

            var webDialog = new WebDialogUserControl();

            webDialog.ParentControlPopup = dialogPopup;
            dialogPopup.Child            = webDialog;

#if WP8 || WINDOWS_PHONE
            // Set where the popup will show up on the screen.
            dialogPopup.VerticalOffset   = 40;
            dialogPopup.HorizontalOffset = 0;
#endif


#if WP8
            dialogPopup.Height = Application.Current.Host.Content.ActualHeight - 40;
            dialogPopup.Width  = Application.Current.Host.Content.ActualWidth;
#endif

#if WINDOWS_PHONE
            dialogPopup.Height = Window.Current.Bounds.Height - 40;
            dialogPopup.Width  = Window.Current.Bounds.Width;
#endif

#if WINDOWS
            dialogPopup.Height = Window.Current.Bounds.Height;
            dialogPopup.Width  = Window.Current.Bounds.Width;
#endif


            webDialog.Height = dialogPopup.Height;
            webDialog.Width  = dialogPopup.Width;


            webDialog.ShowAppRequestsDialog(callback, message, appIdList);

            // Open the popup.
            dialogPopup.IsOpen = true;
        }
Exemplo n.º 4
0
        public static Popup ShowFeedDialog(string toId = "", string link = "", string linkName = "", string linkCaption = "", string linkDescription = "", string picture = "")
        {
            //dialogPopup.Loaded += dialogPopup_Loaded;

            var webDialog = new WebDialogUserControl();

            webDialog.ParentControlPopup = dialogPopup;
            dialogPopup.Child            = webDialog;

#if WP8 || WINDOWS_PHONE
            // Set where the popup will show up on the screen.
            dialogPopup.VerticalOffset   = 40;
            dialogPopup.HorizontalOffset = 0;
#endif

#if WP8
            dialogPopup.Height = Application.Current.Host.Content.ActualHeight - 40;
            dialogPopup.Width  = Application.Current.Host.Content.ActualWidth;
#endif

#if WINDOWS_PHONE
            dialogPopup.Height = Window.Current.Bounds.Height - 40;
            dialogPopup.Width  = Window.Current.Bounds.Width;
#endif

#if WINDOWS
            dialogPopup.Height = Window.Current.Bounds.Height;
            dialogPopup.Width  = Window.Current.Bounds.Width;
#endif


            webDialog.Height = dialogPopup.Height;
            webDialog.Width  = dialogPopup.Width;


            webDialog.ShowFeedDialog(toId, link, linkName, linkCaption, linkDescription, picture);

            // Open the popup.
            dialogPopup.IsOpen = true;
            return(dialogPopup);
        }
Exemplo n.º 5
0
//#if WINDOWS_UNIVERSAL
//        async internal Task LoginWithApp()
//        {
//            await LoginWithApp(null);
//        }

//        async internal Task LoginWithApp(string permissions)
//        {
//            await LoginWithApp(permissions, null);
//        }

//        async internal Task LoginWithApp(string permissions, string state)
//        {
//            await AppAuthenticationHelper.AuthenticateWithApp(Session.AppId, permissions, state);
//        }
//#endif



#if !WINDOWS
        public static void ShowAppRequestDialogViaBrowser()
        {
            // TODO: Setup callback and message
            WebDialogUserControl.ShowAppRequestDialogViaBrowser();
        }
Exemplo n.º 6
0
 public static void ShowFeedDialogViaBrowser(string toId = "", string link = "", string linkName = "", string linkCaption = "", string linkDescription = "", string picture = "")
 {
     WebDialogUserControl.ShowFeedDialogViaBrowser(toId, link, linkName, linkCaption, linkDescription, picture);
 }
Exemplo n.º 7
0
//#if WINDOWS_UNIVERSAL
//        async internal Task LoginWithApp()
//        {
//            await LoginWithApp(null);
//        }

//        async internal Task LoginWithApp(string permissions)
//        {
//            await LoginWithApp(permissions, null);
//        }

//        async internal Task LoginWithApp(string permissions, string state)
//        {
//            await AppAuthenticationHelper.AuthenticateWithApp(Session.AppId, permissions, state);
//        }
//#endif



#if !WINDOWS
        public static void ShowAppRequestDialogViaBrowser(string message, string title = "", List <string> idList = null, string data = "")
        {
            WebDialogUserControl.ShowAppRequestDialogViaBrowser(message, title, idList, data);
        }