Fix of CodePlex workitem 7935

This fixes the NullReferenceException seen when FrameworkElement.Name is
null when building the visual tree.