private static Visual3D Duplicate(Visual3D child, Predicate <ModelVisual3D> selector) { var modelVisual3d = child as ModelVisual3D; if (modelVisual3d != null) { return(Duplicate(modelVisual3d, selector)); } else { throw new NotSupportedException("We do not support duplication of visuals of type " + child.GetType()); } }