WinRT GetXmlDocument Utility


inline concurrency::task<Windows::Data::Xml::Dom::XmlDocument^> GetXmlDocument(Platform::String^ filename)
{
  using namespace Windows::Storage;

  auto folder = Windows::ApplicationModel::Package::Current->InstalledLocation;

  return create_task(folder->GetFileAsync(filename)).then([](StorageFile^ file)
  {
    auto doc = ref new Windows::Data::Xml::Dom::XmlDocument();
    return doc->LoadFromFileAsync(file);
  });
}

Advertisements

About kooksta

Professional .NET Developer interested in Games, Automotive, Music.
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s