Esempio n. 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);
                }
            };
        }
Esempio n. 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);
                }
            };
        }