title: PasswordBox Binding
body: <p>I'm just getting started with M-V-VM and WPF and having issues understanding some binding issues.</p>
  
  <p>I have a login page that has a <code>ComboBox</code> and a <code>PasswordBox</code>.  The <code>ComboBox</code> looks like this:</p>
  
  <pre><code>&lt;ComboBox Name="comboBox1" SelectedItem="{Binding Path=Username}"&gt;
  </code></pre>
  
  <p>This works just fine - my values get updated everytime the <code>SelectedItem</code> changes on the <code>ComboBox</code>!</p>
  
  <p>In my ViewModel I have an <code>ICommand</code> which uses this method to determine if the Login button is active:</p>
  
  <pre><code>public bool CanLogin()
  {
      return !string.IsNullOrEmpty(Username) &amp;&amp; !string.IsNullOrEmpty(Password);
  }
  </code></pre>
  
  <p>So my problem is I don't have the <code>PasswordBox</code> bound to the Password property on the ViewModel - so I have no way to tell when it is updated.</p>
  
  <p>So how do I get the value of the <code>PasswordBox</code> to my ViewModel?  Everything I've read just says don't bind a <code>PasswordBox</code> for security reasons.  I would simply take off the password restriction on the CanLogin() but I need the value to pass along to an AccountService.</p>