示例#1
0
        public AuthenticationPage()
        {
            InitializeComponent();

            _service = ((App)Application.Current).ServiceInstance;

            Loaded += (s, e) =>
            {
                var uri = _service.GetStartUri();
                Web.Navigate(uri);
            };

            Web.NavigationCompleted += (s, e) =>
            {
                if (_service.CheckRedirectUrl(e.Uri.AbsoluteUri))
                {
                    _service.ContinueGetTokens(e.Uri);
                }
            };

            Web.NavigationFailed += (s, e) =>
            {
                _service.ContinueGetTokens(null);
            };
        }
示例#2
0
 private void WebView_Navigated(object sender, WebNavigatedEventArgs e)
 {
     if (_service.CheckRedirectUrl(e.Url))
     {
         _service.ContinueGetTokens(new Uri(e.Url));
     }
 }