Make WpfXamlLoader public or add "RootObjectInstance" to ParserContext or XamlReader.Load method
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
Description
Hi,
while loading a XAML with a x:Class attribute given, I receive an exception that the class specified in the attribute does not match the "UserControl" class name. Well, sure thing. The exception is thrown from WpfXamlLoader:
`System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)`
That's a sad thing, because I cannot change that property via the XamlReader.Load method. It would be nice to have more developer friendly possibilities to use this API. The logic seems to be all there somewhere, but it's internal and hidden for us developers.
So I suggest either:
- Make the WpfXamlLoader public (this would include to make a lot of other stuff public too?)
- Add a RootObjectInstance property to the ParserContext definition
- or overload the XamlReader.Load method which would be easiest.
Contributor guide
Assessment
This issue has not been assessed yet.