Created login and error handling to get auth token. Refreshing not handled.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user