using System;
using System.Windows;
using System.Windows.Input;

namespace BodyshopPartner.ViewModels
{
    public partial class LoginViewModel : BaseViewModel
    {
        private ICommand _loginCommand;
        public ICommand LoginCommand
        {
            get
            {
                if (_loginCommand == null)
                {
                    _loginCommand = new RelayCommand(
                        p => !string.IsNullOrEmpty(UserName) && UserPassword?.Length > 5,
                        async p => { await LoginAsync(p as Window); });
                }
                return _loginCommand;
            }
        }
    }
}
