public MainWindowViewModel() { this.OkCommand.Subscribe(_ => { Debug.WriteLine("OKボタンがクリックされました。"); if (this.Password.Length > 0) { Debug.WriteLine(SecureStringExtension.SecureStringToText(this.Password)); } }); this.ResetCommand.Subscribe(_ => { this.Password.Clear(); }); this.SetPasswordCommand.Subscribe(_ => { this.Password.Clear(); foreach (char c in "ABCDEFG") { this.Password.AppendChar(c); } Messenger.Instance.GetEvent <PubSubEvent <SecureString> >().Publish(Password); }); }
public MainWindow() { InitializeComponent(); Messenger.Instance.GetEvent <PubSubEvent <SecureString> >().Subscribe(x => { this.TestPassword.Password = SecureStringExtension.SecureStringToText(x); Debug.WriteLine(SecureStringExtension.SecureStringToText(x)); }); }