C# transition between GDI+ and WPF

后端 未结 3 2112
迷失自我
迷失自我 2020-12-12 21:47

I\'m considering migrating my c# application from using custom GDI+ drawn controls to a WPF application with custom controls etc. I would like to know what\'s invol

3条回答
  •  萌比男神i
    2020-12-12 22:08

    There is a paradigm shift in how you develop controls for WPF. Instead of defining all the behavior and look for a control, you only define the intended behavior.

    This is the hardest aspect of migrating to WPF. Your control class defines a contract of behavior, and exposes properties that will be used to render, and a ControlTemplate is used to define how the control looks.

    This is also one of the most powerful features of WPF; at any point in the future, a consumer of your control can change how it looks without changing how it behaves. This allows for much easier theming of your controls.

提交回复
热议问题