J
John Dunn
Since currently we aren't allowed to have compiled XAML files embedded in C++
apps I'm using Markup::XamlReader::Load to dynamically load XAML files. This
works perfectly fine with external files but I'd like to be able to load a file
specified in a .resx resource.
I've added my .xaml file to the .resx and can load it in using
ResourceManager::GetObject(). The object returned is a System::Array^ which
contains System::Byte objects. The problem is that I can't figure out how to get
a stream from that which I can pass to XamlReader.
I've tried the following-
1. Use ResourceManager::GetStream(). This threw an InvalidOperationException
saying that the resource was not a stream, call GetObject instead.
2. Copy the Array to a IO::MemoryStream byte by byte. For some reason this
mangled the XML enough so that it couldn't be read. This also seems pretty
horribly inefficient.
Any help would be appreciated-
John
apps I'm using Markup::XamlReader::Load to dynamically load XAML files. This
works perfectly fine with external files but I'd like to be able to load a file
specified in a .resx resource.
I've added my .xaml file to the .resx and can load it in using
ResourceManager::GetObject(). The object returned is a System::Array^ which
contains System::Byte objects. The problem is that I can't figure out how to get
a stream from that which I can pass to XamlReader.
I've tried the following-
1. Use ResourceManager::GetStream(). This threw an InvalidOperationException
saying that the resource was not a stream, call GetObject instead.
2. Copy the Array to a IO::MemoryStream byte by byte. For some reason this
mangled the XML enough so that it couldn't be read. This also seems pretty
horribly inefficient.
Any help would be appreciated-
John