public bool WillDraw()
{
UIElement elem = this;
if (!elem.Visible) return false;
while (elem.Parent != null) {
elem = elem.Parent;
if (!elem.Visible) return false;
}
return true; //we've reached the top and nothing is invisible!
}