Fixes CodePlex Workitem 7935

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