Reputation: 3456
I have a button in my windows phone app. I setted its foreground color as "Red". I want to get this color to check if it is red I need to change it to blue.
How can I get the foreground color of a control (here it is button) ?
Thanks, Stallin
Upvotes: 0
Views: 155
Reputation: 3217
The foreground is basically a Brush
object. You can get the object by,
var colorbrush = mybutton.Foreground as Brush;
colorbrush
should contain the object. See documentation to extract or change the color of this object.
Upvotes: 3