示例#1
0
        public DecryptCommand(CipherViewModel cipherViewModel, Action action)
        {
            this.cipherViewModel = cipherViewModel;
            this.action          = action;

            this.cipherViewModel.PropertyChanged += (s, e) =>
            {
                if (CanExecuteChanged != null &&
                    e.PropertyName == "Ciphertext")
                {
                    CanExecuteChanged(this, EventArgs.Empty);
                }
            };
        }
示例#2
0
        public EncryptCommand(CipherViewModel cipherViewModel, Action action)
        {
            this.cipherViewModel = cipherViewModel;
            this.action          = action;

            this.cipherViewModel.PropertyChanged += (s, e) =>
            {
                if (CanExecuteChanged != null &&
                    (e.PropertyName == "Plaintext" ||
                     e.PropertyName == "Passphrase" ||
                     e.PropertyName == "Salt"))
                {
                    CanExecuteChanged(this, EventArgs.Empty);
                }
            };
        }