private async void Login() { if (string.IsNullOrWhiteSpace(UserName.Text)) { Tools.Message.ShowToast(AppResources.ToastUserName); return; } if (string.IsNullOrWhiteSpace(PassWord.Password)) { Tools.Message.ShowToast(AppResources.ToastPassword); return; } Tools.Tools.SetProgressIndicator(true); SystemTray.ProgressIndicator.Text = AppResources.ProgressRequestingAccess; using (var client = new VikingsApi()) { if (await client.Authorize(UserName.Text, PassWord.Password)) { var finished = new ApiBrowserEventArgs { Success = true }; OnLoginFinished(finished); Visibility = Visibility.Collapsed; } else { Tools.Message.ShowToast(AppResources.ToastLoginUnsuccessful); } } }
protected void OnLoginFinished(ApiBrowserEventArgs args) { if (LoginFinished != null) { LoginFinished(this, args); } }
protected void OnLoginFinished(ApiBrowserEventArgs args) { if (LoginFinished != null) { LoginFinished(this, args); } }
private async void Login() { if (string.IsNullOrWhiteSpace(UserName.Text)) { Tools.Message.ShowToast(AppResources.ToastUserName); return; } if (string.IsNullOrWhiteSpace(PassWord.Password)) { Tools.Message.ShowToast(AppResources.ToastPassword); return; } Tools.Tools.SetProgressIndicator(true); SystemTray.ProgressIndicator.Text = AppResources.ProgressRequestingAccess; using (var client = new VikingsApi()) { if (await client.Authorize(UserName.Text, PassWord.Password)) { var finished = new ApiBrowserEventArgs { Success = true }; OnLoginFinished(finished); Visibility = Visibility.Collapsed; } else { Tools.Message.ShowToast(AppResources.ToastLoginUnsuccessful); } } }
private async void OauthLoginFinished(object sender, ApiBrowserEventArgs args) { Pivot.Visibility = Visibility.Visible; ApplicationBar.IsVisible = true; LayoutRoot.Children.Remove(LayoutRoot.Children.First(c => c.GetType() == typeof(OauthLogin))); _isLoginControlEnabled = false; App.Viewmodel.MainPivotViewmodel.RenewToken(); await App.Viewmodel.MainPivotViewmodel.GetSimInfo(); }