How do can I read through a baml stream that contains a ResourceDictionaory
using the Baml2006Reader
and without acually instantiating the the ResourceDictionary
?
I can ready through regular baml that just contains a UserControl just fine and I can examine the XAML tree using Baml2006Reader.NodeType
etc.
But once the reader hits a ResourceDictionary
, Baml2006Reader.Member.Name
is "DeferrableContent"
and Baml2006Reader.Value
contains a MemoryStream
that can not be parsed by another instance of Baml2006Reader
. I can't event instantiate the reader:
System.IO.EndOfStreamException occurred HResult=-2147024858
Message=Unable to read beyond the end of the stream. Source=mscorlib StackTrace: at System.IO.MemoryStream.InternalReadInt32() at System.Windows.Baml2006.Baml2006Reader.Process_Header() at WpfApplication10.AssemblyExtensions.Read(Stream stream, List`1 result) in d:\Documents\Visual Studio 2012\Projects\WpfApplication10\WpfApplication10\AssemblyExtensions.cs:line 84 InnerException: