Thursday, May 02, 2019

Windows Form and Data Binding

Windows Form and Data Binding

When building desktop applications for Windows, there are plenty of options, such as:
  • WPF
  • QT
  • Chromium + JS, such as AppJS, Electron
  • Windows Form
If I get to choose, Windows Form would be my last option. But a lot of times, there is no such choice, such as when we are adding features to existing Winform applications, or the whole team is familar with Winform and is not receptive to new techonologies.
I have developed WPF applications before, and I know that WPF applications tend to be much clean in code aspect than Winform. The key feature of WPF is we can make UI with templates (XAML) with in turn binding with model cleanly (The MVVM model)
But even with Winform we can make code as clean as possible by using DataBinding. But I have seen many projecst written in Winform that barely adapt DataBinding quite well. If your project is in such situation, you should try it definitely.
Two source of information I found very useful to the understanding of Winform DataBinding:
Also, I have upload a demo application to GitHub:https://github.com/shawn11ZX/WinformDataBindingExample