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