How to get started?

Apr 26, 2013 at 1:55 PM

currently i'm working on a winforms project that i want to shift to the MVVM pattern. I found this project after a mention on stackoverflow. But i miss the starting point, Are there any samples or better real world samples out there, that i can use? Or did i miss something?
May 7, 2013 at 9:04 PM
Edited Jun 6, 2013 at 11:24 PM
Hi raisr,

There are no "real world" samples (as you put it). The idea is:
  • build your model (MVVM or no MVVM you should have a model)
  • design your view
  • do all bindings in the VM layer
  • use MVVM FX for everything that binds to singular properties
  • use DataSource binding to lists or collections (DGV etc.)
This way you should be able to replace your view with a test layer.

Tiago Freitas Leal

There are some illustrative and test samples.
Mar 25, 2014 at 4:12 PM
Edited Mar 25, 2014 at 4:18 PM
Can you provide and example for ComboBoxes too?
I successfully bound to the ComboBox DataSource property, but I am unable to do a Two-Way Binding for the SelectedItem property (when selected the ViewModel property is never set)
               new TypedBinding<ComboBox, MyViewModel>(this.modelCB, t => t.SelectedItem, this._MyViewModel, v => v.SelectedModel) { Mode = BindingMode.TwoWay }
What am I doing wrong?
Apr 24, 2014 at 3:51 PM
If you are using the standard combo box, I believe you want SelectedValue, not SelectedItem.