December 2019
Intermediate to advanced
528 pages
11h 19m
English
Calling IdentityServer is really just a matter of filling in the command that we created behind the login button. Let's change our command in LoginViewModel so that it looks something closer to this:
public LoginViewModel(IHttpStockClientHelper httpStockClientHelper){ _httpStockClientHelper = httpStockClientHelper; LoginCommand = new RelayCommand(() => { DoLogin(); }); }private async Task DoLogin(){ bool loggedIn = await _httpStockClientHelper.Login(Username, Password); if (loggedIn) { var frame = Window.Current.Content as Frame; frame.Navigate(typeof(MainPage), null); }}