Im moving WPF project to WinUi 3. I would like to convert Brushes.Red/Green to SolidColorBrush. It's used by xaml elements' properties like Background.
public SolidColorBrush PowerBrush
{
get
{
if (_powerMode == PowerMode.Off)
{
//return (SolidColorBrush)Application.Current.Resources["SystemFillColorCriticalBrush"];
return new SolidColorBrush(Brushes.Red);
}
else
{
//return (SolidColorBrush)Application.Current.Resources["SystemFillColorSuccessBrush"];
return Brushes.Green;
}
}
}
I got errors:
Cannot convert from 'System.Drawing.Brush' to 'Windows.UI.Color'
Cannot implicitly convert type 'System.Drawing.Brush' to 'Microsoft.UI.Xaml.Media.SolidColorBrush'
How to do it?