Developing Mobile Apps — Question 5
You are developing a Universal Windows Platform (UWP) app.
The app must be available on Windows Phone, Windows tablet devices, and Xbox.
When the app is running on a device, you need to determine which members of a specific class you can use.
Which of the following methods should you use?
Answer options
- A. ApiInformation.IsPropertyPresent
- B. UserInformation.NameAccessAllowed
- C. Selector.GetIsSelectionActive
- D. AppExtensionCatalog.FindAllAsync
Correct answer:
Explanation
The correct answer is A. ApiInformation.IsPropertyPresent is specifically designed to check if a property exists on a class, which is essential for determining available members across different devices. The other options do not serve this purpose; for instance, UserInformation.NameAccessAllowed is related to user permissions, Selector.GetIsSelectionActive pertains to UI element states, and AppExtensionCatalog.FindAllAsync is used for finding app extensions.