Created login and error handling to get auth token. Refreshing not handled.

This commit is contained in:
Patrick Fic
2020-01-16 18:43:50 -08:00
parent 0daf17a3f0
commit cfec5327dd
17 changed files with 625 additions and 47 deletions

View File

@@ -1,24 +1,24 @@
using System;
using System.Windows;
using System.Windows.Input;
namespace BodyshopUploader.ViewModels
{
public partial class LoginViewModel : BaseViewModel
{
private ICommand _openMainCommand;
public ICommand OpenMainCommand
private ICommand _loginCommand;
public ICommand LoginCommand
{
get
{
if (_openMainCommand == null)
if (_loginCommand == null)
{
_openMainCommand = new RelayCommand(
p => true,
p => { Views.Main m = new Views.Main(); m.Show(); });
_loginCommand = new RelayCommand(
p => !string.IsNullOrEmpty(UserName) && UserPassword?.Length > 6,
async p => { await LoginAsync(p as Window); });
}
return _openMainCommand;
return _loginCommand;
}
}
}
}