private static object CoerceSelectedObject(DependencyObject d, object value) { PropertyGrid pg = d as PropertyGrid; object[] collection = pg.GetValue(SelectedObjectsProperty) as object[]; return(collection.Length == 0 ? null : value); }
private static object CoerceSelectedObjects(DependencyObject d, object value) { PropertyGrid pg = d as PropertyGrid; object single = pg.GetValue(SelectedObjectsProperty); return(single == null ? new object[0] : value); }