private async void LoginButton_Click(object sender, RoutedEventArgs e) { Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Wait, 10); await OAuthHelper.Authorize(); Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Arrow, 10); await Task.Delay(500); if (await OAuthHelper.CheckTokens()) { MainPage.rootFrame.Navigate(typeof(HomePage)); } }
private async void LoginButton_Click(object sender, RoutedEventArgs e) { Window.Current.CoreWindow.PointerCursor = new CoreCursor(CoreCursorType.Wait, 10); try { await OAuthHelper.Authorize(); if (BangumiApi.BgmOAuth.IsLogin) { this.Frame.Navigate(typeof(MainPage), null, new DrillInNavigationTransitionInfo()); } } catch (Exception ex) { await NotifyControl.AddNotification($"登录失败,请重试!\n{ex.Message}", Controls.NotifyType.Error); //NotificationHelper.Notify($"登录失败,请重试!\n{ex.Message}", NotificationHelper.NotifyType.Error); } finally { Window.Current.CoreWindow.PointerCursor = new CoreCursor(CoreCursorType.Arrow, 10); } }