using GalaSoft.MvvmLight; using GalaSoft.MvvmLight.Command; using Muchinfo.MTPClient.Data.Enums; using Muchinfo.MTPClient.Infrastructure.Helpers; using Muchinfo.MTPClient.Infrastructure.MessageBox; using Muchinfo.MTPClient.Infrastructure.Utilities; using Muchinfo.MTPClient.Resources; using Muchinfo.MTPClient.UI.Views; using Muchinfo.WPF.Controls.Windows; using System.Windows; namespace Muchinfo.MTPClient.UI.ViewModels { public class InputTradePassWordViewModel : ViewModelBase { #region Command public RelayCommand ResetCommand { get { return new RelayCommand((v) => { TradePassWord = string.Empty; }) ; } } public RelayCommand ConfrimCommand { get { //判断 return new RelayCommand ((v) => { string passWord = UserManager.CurrentTradeAccount.TradePassword; if (TradePassWord == passWord) { UserManager.MainPanelIsUnLock = true; v.Close(); MessengerHelper.DefaultSend(UserManager.MainPanelIsUnLock, MessengerTokens.MainPanelIsUnlock); } else { UserManager.MainPanelIsUnLock = false; MessageBoxHelper.ShowInfo(Client_Resource.APP_WrongPassword, Client_Resource.APP_Tips); } }); } } public RelayCommand CancleCommand { get { return new RelayCommand(() => { var homePage = ViewModelLocator.MainPage; var messageResult = MessageBoxHelper.ShowQuestion(homePage, Client_Resource.UI2014_IsOrNotExit, Client_Resource.UI2014_Tips); if (messageResult == MessageBoxResult.Yes) { homePage.Close(); } }); } } #endregion #region Propreties /// /// 交易密码 /// private string _tradePassWord; public string TradePassWord { get { return _tradePassWord; } set { Set(() => TradePassWord, ref _tradePassWord, value); } } #endregion } }