Which code segments should you use?

DRAG DROP
You are developing a Windows Store weather app.
You need to restore the state of the app while the app is being reactivated.
Which code segments should you use? (To answer, drag the appropriate code segments to
the correct locations in the answer area. Each code segment may be used once, more than once, or not at all. You may need to
drag the split bar between panes or scroll to view content.)

DRAG DROP
You are developing a Windows Store weather app.
You need to restore the state of the app while the app is being reactivated.
Which code segments should you use? (To answer, drag the appropriate code segments to
the correct locations in the answer area. Each code segment may be used once, more than once, or not at all. You may need to
drag the split bar between panes or scroll to view content.)

Answer: See the explanation.

Explanation:
Box 1:

Box 2:

Box 3:

Note:
* When a user selects your app to share content, Windows activates your app. Because
there are many ways that Windows could activate your app, you need to add code to your
activated event handler that detects why the activation occurred. You do this by checking the
value of the kind property.
JavaScript

app.onactivated = function (args) {
if (args.detail.kind === activation.ActivationKind.launch) {
// The application has been launched. Initialize as appropriate.
if (app.sessionState) {
// restore previous state from sessionState
}

Reference:



Leave a Reply 0

Your email address will not be published. Required fields are marked *