41 lines
1.1 KiB
C#
41 lines
1.1 KiB
C#
using LAEPS.PubEvent;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Input;
|
|
|
|
namespace LAEPS.ViewModels
|
|
{
|
|
public class LoginViewModel:BindableBase
|
|
{
|
|
#region 属性
|
|
private string _Password;
|
|
public string Password
|
|
{
|
|
get => _Password;
|
|
set => SetProperty(ref _Password, value);
|
|
}
|
|
private string _Account;
|
|
public string Account
|
|
{
|
|
get => _Account;
|
|
set => SetProperty(ref _Account, value);
|
|
}
|
|
#endregion
|
|
public ICommand LoginCommand { get; set; }
|
|
private IEventAggregator _eventAggregator;
|
|
public LoginViewModel(IContainerProvider containerProvider)
|
|
{
|
|
_eventAggregator = containerProvider.Resolve<IEventAggregator>();
|
|
LoginCommand = new AsyncDelegateCommand(OnLogin);
|
|
}
|
|
|
|
private async Task OnLogin()
|
|
{
|
|
_eventAggregator.GetEvent<LoginSuccessEvent>().Publish();
|
|
}
|
|
}
|
|
}
|