public static DesignPropertyCollection GetProperties(DependencyObject obj) { if (obj == null) { throw new ArgumentNullException(nameof(obj)); } if (obj.GetValue(PropertiesProperty) is DesignPropertyCollection col) { return(col); } col = new DesignPropertyCollection(obj); SetProperties(obj, col); return(col); }
private static void SetProperties(DependencyObject obj, DesignPropertyCollection value) { obj.SetValue(PropertiesPropertyKey, value); }