For my universal splash screen code I need to read out the apps manifest XML file during runtime and select the splash screen background color and image to compose an extended splash screen.
currently I am using:
Application.splashColor = xml.selectSingleNodeNS("//m2:VisualElements/@BackgroundColor", 'xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest"')?.value
splashImageValue = xml.selectSingleNodeNS("//m2:SplashScreen/@Image", 'xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest"')?.value.replace("\\", "/")
But I would like to be more specific in my XPath selectors and include the the apps ID in my XPath:
<Applications>
<Application Id="App" StartPage="default.html">
<m2:VisualElements DisplayName="Foo" Description="CheckByVoice" ForegroundText="light" BackgroundColor="#ffffff" Square150x150Logo="images\Logo.png" Square30x30Logo="images\SmallLogo.png">
<m2:SplashScreen Image="images\splashscreen.png" />
</m2:VisualElements>
</Application>
</Applications>
So my XPath would look like this: "/Applications/Application[@id='App']/@BackgroundColor"
I know multi-app packages are rare, but I would like my code not to fail in such scenarios.
I have found no WinRT API to get the current apps ID. Just in the launch args there is "tileId" which is "App" in case the app was launched with the default tile. But when it was launched via a secondary tile or another contract I am
out of luck.