I have a list of objects which among other properties contain a Brush (property name "Color").
In a Backgroundworker I want to write the contents of these objects to a file. Everything works fine until I try to read the color of the brush property.
//this works fine
var brush = myObject.Color;
//this fails with InvalidOperationException
var c= ((SolidColorBrush)myObject.Color).Color;
It seems as if my code is somehow modifying the color but I don't see where/how. Is there a way to read-only access the color of the brush?
Regards,
tabina