private void PresentUILoginScreen(OAuth2Authenticator authenticator) { if (forms_implementation_renderers) { // Renderers Implementaion Xamarin.Auth.XamarinForms.AuthenticatorPage ap; ap = new Xamarin.Auth.XamarinForms.AuthenticatorPage() { Authenticator = authenticator, }; NavigationPage np = new NavigationPage(ap); if (navigation_push_modal == true) { System.Diagnostics.Debug.WriteLine("Presenting"); System.Diagnostics.Debug.WriteLine(" PushModal"); System.Diagnostics.Debug.WriteLine(" Custom Renderers"); Navigation.PushModalAsync(np); } else { System.Diagnostics.Debug.WriteLine("Presenting"); System.Diagnostics.Debug.WriteLine(" Push"); System.Diagnostics.Debug.WriteLine(" Custom Renderers"); Navigation.PushAsync(np); } } else { // Presenters Implementation if (navigation_push_modal == true) { System.Diagnostics.Debug.WriteLine("Presenting"); System.Diagnostics.Debug.WriteLine(" PushModal"); System.Diagnostics.Debug.WriteLine(" Presenters"); Xamarin.Auth.Presenters.OAuthLoginPresenter presenter = null; presenter = new Xamarin.Auth.Presenters.OAuthLoginPresenter(); presenter.Login(authenticator); } else { System.Diagnostics.Debug.WriteLine("Presenting"); System.Diagnostics.Debug.WriteLine(" Push"); System.Diagnostics.Debug.WriteLine(" Presenters"); Xamarin.Auth.Presenters.OAuthLoginPresenter presenter = null; presenter = new Xamarin.Auth.Presenters.OAuthLoginPresenter(); presenter.Login(authenticator); } } return; }
private async void PresentUILoginScreen(OAuth2Authenticator authenticator) { if (authenticator != null) { var ap = new Xamarin.Auth.XamarinForms.AuthenticatorPage() { Authenticator = authenticator, }; await this.Navigation.PushAsync(ap); } }
private void PresentUILoginScreen(OAuth2Authenticator authenticator) { Xamarin.Auth.XamarinForms.AuthenticatorPage ap; ap = new Xamarin.Auth.XamarinForms.AuthenticatorPage() { Authenticator = authenticator, }; if (navigation_push_modal == true) { Application.Current.MainPage.Navigation.PushModalAsync(ap); } else { Application.Current.MainPage.Navigation.PushAsync(ap); } return; }
private void NavigateLoginPage() { // / * //--------------------------------------------------------------------- // ContentPage with CustomRenderers login_page = new Xamarin.Auth.XamarinForms.AuthenticatorPage() { Authenticator = authenticator, }; Navigation.PushAsync(login_page); //--------------------------------------------------------------------- // Xamarin.UNiversity Team Presenters Concept // Xamarin.Auth.Presenters.OAuthLoginPresenter presenter = null; // presenter = new Xamarin.Auth.Presenters.OAuthLoginPresenter(); //presenter.Login (authenticator); //--------------------------------------------------------------------- // * / return; }
protected override void OnElementChanged(ElementChangedEventArgs <Page> e) { base.OnElementChanged(e); // this is a ViewGroup - so should be able to load an AXML file and FindView<> global::Android.App.Activity activity = this.Context as global::Android.App.Activity; authenticator_page = (AuthenticatorPage)base.Element; Authenticator = authenticator_page.Authenticator; Authenticator.Completed += Authentication_Completed; Authenticator.Error += Authentication_Error; global::Android.Content.Intent ui_object = Authenticator.GetUI(activity); activity.StartActivity(ui_object); return; }
protected override async void OnElementChanged(ElementChangedEventArgs <Xamarin.Forms.Page> e) { try { base.OnElementChanged(e); System.Diagnostics.Debug.WriteLine("AuthenticatorPageRenderer.OnElementChanged"); if (e == null) { System.Diagnostics.Debug.WriteLine("AuthenticatorPageRenderer: e = {null}"); } else { if (e.NewElement == null) { System.Diagnostics.Debug.WriteLine("AuthenticatorPageRenderer: e.NewElement = {null}"); } if (e.OldElement == null) { System.Diagnostics.Debug.WriteLine("AuthenticatorPageRenderer: e.OldElement = {null}"); } } if (Element == null) { System.Diagnostics.Debug.WriteLine("AuthenticatorPageRenderer: Element is {null}"); } else { System.Diagnostics.Debug.WriteLine("AuthenticatorPageRenderer: Element is " + Element); } if (Control == null) { System.Diagnostics.Debug.WriteLine("AuthenticatorPageRenderer: Control is {null}"); } else { System.Diagnostics.Debug.WriteLine("AuthenticatorPageRenderer: Control is " + Control); } if (Control == null) { authenticator_page = (AuthenticatorPage)base.Element; Authenticator.Completed -= Authenticator_Completed; Authenticator.Completed += Authenticator_Completed; Authenticator.Error -= Authenticator_Error; Authenticator.Error += Authenticator_Error; Uri page_uri = Authenticator.GetUI(); Microsoft.Phone.Controls.PhoneApplicationPage this_page = null; this_page.NavigationService.Navigate(page_uri); } } catch (Exception ex) { throw new Xamarin.Auth.AuthException("WindowsPhone OnElementChanged"); } return; }
public static void PresentUILoginScreen ( this Page page, Xamarin.Auth.Authenticator authenticator ) { if (Settings.IsFormsImplementationRenderers) { // Renderers Implementaion Xamarin.Auth.XamarinForms.AuthenticatorPage ap; ap = new Xamarin.Auth.XamarinForms.AuthenticatorPage() { Authenticator = authenticator, }; NavigationPage np = new NavigationPage(ap); if (Settings.IsFormsNavigationPushModal) { System.Diagnostics.Debug.WriteLine("Presenting"); System.Diagnostics.Debug.WriteLine(" PushModal"); System.Diagnostics.Debug.WriteLine(" Custom Renderers"); page.Navigation.PushModalAsync(np); } else { System.Diagnostics.Debug.WriteLine("Presenting"); System.Diagnostics.Debug.WriteLine(" Push"); System.Diagnostics.Debug.WriteLine(" Custom Renderers"); page.Navigation.PushAsync(np); } } else { // Presenters Implementation if (Settings.IsFormsNavigationPushModal) { System.Diagnostics.Debug.WriteLine("Presenting"); System.Diagnostics.Debug.WriteLine(" PushModal"); System.Diagnostics.Debug.WriteLine(" Presenters"); Xamarin.Auth.Presenters.OAuthLoginPresenter presenter = null; presenter = new Xamarin.Auth.Presenters.OAuthLoginPresenter(); presenter.Login(authenticator); } else { System.Diagnostics.Debug.WriteLine("Presenting"); System.Diagnostics.Debug.WriteLine(" Push"); System.Diagnostics.Debug.WriteLine(" Presenters"); Xamarin.Auth.Presenters.OAuthLoginPresenter presenter = null; presenter = new Xamarin.Auth.Presenters.OAuthLoginPresenter(); presenter.Login(authenticator); } } return; }