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); } }; }
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); } }; }