private void ValidateElement(UIElement element) { if (element == null) throw new ArgumentNullException("UIElement cannot be null."); }