Cannot implicitly convert type 'System.Drawing.Color' to 'System.Windows.Media.Color'
The problem is that you're using the Windows Forms
ColorDialog
, which returns a
System.Drawing.Color
, whereas WPF tends to use
System.Windows.Media.Color
.
You could switch to using a WPF colour picker - for example,
this one[
^].
Alternatively, you'll need to convert the returned colour:
var cd = new System.Windows.Forms.ColorDialog();
...
var winFormsColor = cd.Color;
var wpfColor = System.Windows.Media.Color.FromArgb(winFormsColor.A, winFormsColor.R, winFormsColor.G, winFormsColor.B);