Transitioning from Windows Forms to WPF

后端 未结 5 2056
时光取名叫无心
时光取名叫无心 2020-11-22 00:27

For a long time now, I have been stuck with Windows Forms development (started with VB6, and has continued through to C# .NET 4.5), and I have pretty much hit the limit of w

5条回答
  •  不知归路
    2020-11-22 00:49

    I've been through this process as you did. Afterwards I was teaching everyone in my company WPF. There are a couple of important lessons I have learned and everybody I know who works with WPF.

    1. If you are working with UI controls in the code behind, .... Then you are doing it wrong. There is absolutely no need for you to deal with UI controls in the code behind.
    2. You do not need the visual developer for clicking on it. You are much more productive by only dealing with XAML. Use Copy/Paste. Do not trust in your typing capabilities. It will save a lot of headaches.
    3. Think of the XAML just as a window that loks over the data. In the code behind you are changing the data. In XAML you are defining how the UI will interpret the data.
    4. Converters are amazing. As soon as you get a key amount of Converters, your productivity will rocket Sky high. They will take over the role of the crazy amount of control eventhandlers that hide or resize, or what ever about UI,

    It makes UI development fun. Especially once you find out how it likes to play along with Asyc processes. It really takes away a lot of the headaches that were caused by Winforms.

提交回复
热议问题