using System.Windows; namespace ScreenGrab.Extensions; public static class DependencyExtensions { #region Public Methods /// /// Sets the value of the only if it hasn't been explicitly set. /// public static bool SetIfDefault(this DependencyObject o, DependencyProperty property, T value) { if (DependencyPropertyHelper.GetValueSource(o, property).BaseValueSource == BaseValueSource.Default) { o.SetValue(property, value); return true; } return false; } #endregion Public Methods }