Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I am definitely a WPF / MVVM / databinding noob, but have been working hard on this stuff lately. I don't know what you have wired up so far, but first you'll want to set the DataContext for your View. Since you're using MVVM, I assume you have a ViewModel, so that should be the DataContext for your View.</p> <p>i.e. if you have your View create / own your ViewModel, it could look something like this:</p> <pre><code>MyViewModel vm = new MyViewModel(); this.DataContext = vm; </code></pre> <p>You can easily databind your CheckBox, ComboBox, and TextBox to properties in your ViewModel. I have found the easiest way is to make your ViewModel inherit from a base viewmodel class, like the <a href="http://joshsmithonwpf.wordpress.com/2009/01/27/my-mvvm-article-in-msdn-magazine/" rel="nofollow noreferrer">one that Josh Smith wrote</a>. This will give you a method to call internally when you want the ViewModel to notify the GUI of any changes in values.</p> <p>Assuming you have properties like ImportColumn, LastName, and LastNameText (all C# properties, not <strong>fields</strong> that call OnPropertyChanged accordingly), then your XAML would look something like this:</p> <pre><code>&lt;CheckBox IsChecked="{Binding ImportColumn}" /&gt; &lt;ComboBox SelectedItem="{Binding LastName}" /&gt; &lt;TextBox Text="{Binding LastName Text, Mode=TwoWay}" /&gt; </code></pre> <p>I hope this helps you out. If not, please comment and I'll try to do as best as I can to try other things out.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload