| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- 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<InputTradePassWordView> ResetCommand
- {
- get
- {
- return new RelayCommand<InputTradePassWordView>((v) =>
- {
- TradePassWord = string.Empty;
- })
- ;
- }
- }
- public RelayCommand<InputTradePassWordView> ConfrimCommand
- {
- get
- {
- //判断
- return new RelayCommand<InputTradePassWordView>
- ((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
- /// <summary>
- /// 交易密码
- /// </summary>
- private string _tradePassWord;
- public string TradePassWord
- {
- get { return _tradePassWord; }
- set
- {
- Set(() => TradePassWord, ref _tradePassWord, value);
- }
- }
- #endregion
- }
- }
|