Skip to main content
Home Forums Silverlight Programming Programming with .NET - General Test the .Background color in controls
3 replies. Latest Post by Tim Dawson on July 4, 2009.
(0)
Agnushal...
Member
54 points
140 Posts
07-04-2009 12:08 AM |
How I test the Background color in every control in Usercontrol
Something like this
SharpGIS
Contributor
3387 points
611 Posts
07-04-2009 12:15 AM |
The background is not a color but a brush.Maybe something like if(item.Background is SolidColorBrush && ((SolidColorBrush)item.Background).Color == Colors.Red) ...
07-04-2009 12:20 AM |
But How I test every control??
I try for each item as control in layoutroot and doesn´t work
error: 'System.Windows.Controls.Grid', which is not a collection type.
Tim Dawson
Participant
1130 points
218 Posts
07-04-2009 4:55 AM |
Use the methods in the VisualTreeHelper class to traverse the tree.