Is there some way to get color names such as Red, Black etc. from System.Windows.SystemColors.WindowTextBrushKey in WPF code behind?
string color = "Black";
if (System.Windows.SystemParameters.HighContrast)
{
color = System.Windows.SystemColors.WindowTextBrushKey; // I want to get color from this value
}
It depends.
SystemColors.WindowTextBrushwill give you theBrush. You could then check wheter its string representation matches any of theBrushesreturned from the static properties theBrushesclass: