What is WPF for the WinForms programmer?

后端 未结 8 651
余生分开走
余生分开走 2021-02-04 11:42

What is WPF to the WinForms programmer?

WinForms distilled is adding controls to forms, and adding event handlers. This is simple and easy and allows you to make functio

8条回答
  •  耶瑟儿~
    2021-02-04 11:58

    I've been working almost exclusively in WinForms for the past 4 years and have begun using WPF for a couple of small projects at work. The learning curve is steep. But once you get used to it, it's well worth it.

    WPF is much more than just visual eye candy like skinning or animation. Even for basic applications to track shipping orders, you can leverage WPF. WinForms only takes you so far with its controls. If you wanted to display slightly customized UI, you often needed to do custom draw in your controls using GDI, which can quickly become a nightmare. In WPF, customizing anything is trivial through data templates. You can easily customize list box elements, add controls to list view columns, or headers, etc. WPF allows you to take control of complex UI layouts with its powerful layout system. I'm also amazed at how little code is needed in WPF to accomplish the same things I used to do in WinForms, so this means less bugs and easier to maintain applications.

提交回复
热议问题