Wednesday, May 16, 2012
Windows Phone Tip: How to Access the App Manifest
There will be times where you want to access the Windows Phone Application Manifest in runtime and be able to get specific elements or attributes. This is quite straight forward to achieve and here's how it is done.
First, make sure to add a reference to System.Xml.Linq in your project.
Second, add the using statement in your code file
And finally, implement the method that loads and parses the WMAppManifest.xml file and gets the information you need. The following method will get the application title.
You can access anything you might need from the app manifest. Take a look at the file on your app (located under your project's properties folder) and see what fits your needs!