At first I am not angry because I use MVVM in WinForms.) I know about the MVP (Model View Presenter) template and its variants. But when I started this project, I was going to learn WPF and use it, but I have to rush to develop the program and I do not have time to learn WPF, so I have to write it in WinForms, which I know well.
So, I have a big data-oriented application for intelligent clients, which is close to the end, I have all the models and ViewModels made (infrastructure, domain, presentation). The user interface is also done, now I only need to connect the interface to ViewModels. At first I started connecting to it using the standard winforms method (BindingSources and simple data binding), but when I did 30-50% of the binding, I found out that my program is very slow, I now have 100-150 related properties, 30 of they represent the root entity of the domain (aggregate root) of the EditForm binding to it. Thus, data binding does not work very well in this situation, a lot of unnecessary updates, cascading updates of the whole view, when some small changes, fuzzy behavior and other ugly things happen. It smells like very unreliable code, on which I have little control. So I began to rewrite transactions as pure, clean WinForms code (by subscribing to the PropertyChange and ListChanged events, and setting the ViewModels property from the user interface myself). A lot of code to write, but it works much faster, I have full control over this, and it feels much more reliable. So what do you think of these guys? Has anyone had such an experience? What is your verdict "In DataBind or not"?
c # data-binding winforms mvvm
Alex burtsev
source share