ToWpfColor

  <System.Runtime.CompilerServices.Extension()>
  Public Function ToWpfColor(color As System.Drawing.Color) As Windows.Media.Color
    Return Windows.Media.Color.FromArgb(color.A, color.R, color.G, color.B)
  End Function
Example:
If ColorDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
  MyWpfBrushProperty = New Windows.Media.SolidColorBrush(ColorDialog.Color.ToWpfColor)
End If

Description

Converts a System.Drawing.Color (e.g. from a ColorDialog) into a System.Windows.Media.Color for WPF

Details

Double click on the code to select all.

 

;