public static bool ValidateUIElement(UIElement uie) { return uie != null && uie.IsValid && uie.IsVisible; }