Data binding

System.Windows.Forms.BindingSource is for WinForms. You say that you are using WPF. If you are doing WPF the way it is meant to be used, you would be using the MVVM pattern. So all that you would need to do is to persist your model when you save your app before closing. When you re-open your app, you load the same model.

See Data binding overview - WPF
 
Along with a MVVM pattern, would be wise to implement the INotifyPropertyChanged.PropertyChanged Event (System.ComponentModel) to interface with your bindings. I've found this helpful when working with binding data. Make use of interfaces, as they are needed for injecting. We always want to keep workflow logic out of the presentation layer, and that's what makes interfaces useful in WPF. In WPF Interfaces are your friend!

If I can get back on the PC during the week, I will share some example code I wrote a while ago which might get you started.

I am also assuming you are coming from a Winforms background, and if so, you will soon learn that certain controls won't be available as well as there being some variations in controls and the language and how you would write certain stuff in Winforms will not fly in WPF, and with that comes a whole new learning curve.
 
Along with a MVVM pattern, would be wise to implement the INotifyPropertyChanged.PropertyChanged Event (System.ComponentModel) to interface with your bindings. I've found this helpful when working with binding data. Make use of interfaces, as they are needed for injecting. We always want to keep workflow logic out of the presentation layer, and that's what makes interfaces useful in WPF. In WPF Interfaces are your friend!

If I can get back on the PC during the week, I will share some example code I wrote a while ago which might get you started.

I am also assuming you are coming from a Winforms background, and if so, you will soon learn that certain controls won't be available as well as there being some variations in controls and the language and how you would write certain stuff in Winforms will not fly in WPF, and with that comes a whole new learning curve.
HI,

Thanks for your reply, can you please send me some sample code to get me started. I am completely new to WPF. Thanks
 
Back
Top Bottom