Wpf designer parser fixes

Some fixes to the xaml parser. See commit comments for details.