My question is similar to How to get programatically all capablities that enable in manifest for UWP app (sic), but I wish to do this at runtime instead of reading directly from the Package.appmanifest or AppManifest.xml file.
I am writing an SDK for UWP, and want to be able to figure out which capabilities have been enabled for the parent app.
Currently, I am using code like the following to try to get the manifest, but I can't figure out how to get the AppManifest xml or query for values from the manifest:
// Need this for extension method GetTypeInfo()
using System.Reflection;
// Am I getting correct manifest here?
var manifest = typeof(classInMySdk).GetTypeInfo().Assembly.ManifestModule;
// Now how do I query for "Capabilities" in the manifest?
Alternatively, if there is some other API that let's you query for "Capabilities", I'd like to know about that.