private static void VerifyVisualTreeChangeCore(DependencyObject d) { if (s_IsVisualTreeChangedInProgress) { if (!EnableHelper.AllowChangesDuringVisualTreeChanged(d)) { throw new InvalidOperationException(SR.Get(SRID.ReentrantVisualTreeChangeError, nameof(VisualTreeChanged))); } } }
/// <summary> /// Disable the VisualTreeChanged event. /// </summary> public static void DisableVisualTreeChanged() { EnableHelper.DisableVisualTreeChanged(); }