What is the difference between System.Drawing.Color and System.Windows.Media.Color?

前端 未结 2 1972
误落风尘
误落风尘 2021-02-02 07:51

Basically, why the need for two abstractions of a pretty simple concept?

2条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-02 08:16

    I don't think there was a "need" as such, just that they made an early (probably wrong) decision to put the Color class into the the WinForms-specific System.Drawing - because at the time, Win32 and Winforms was all there was.

    Later when they wanted to enhance the concepts in "Color", they didn't want WPF to depend on WinForms. So rather than fix the situation by moving a more abstract Color class to a generic assembly, they just copy-pasted a new Color class in WPF.

提交回复
热议问题