Presentation is loading. Please wait.

Presentation is loading. Please wait.

Apps are notified when they have been resumed.

Similar presentations


Presentation on theme: "Apps are notified when they have been resumed."— Presentation transcript:

1

2

3

4

5

6 Apps are notified when they have been resumed

7

8 Windows.Storage.AccessCache (modified by WinRT API) Windows.Storage.PasswordVault (modified by WinRT API), sync’d to cloud

9 using Windows.Storage; // Create a simple setting ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings; localSettings.Values["message"] = "Hello World"; Object value = localSettings.Values["message"]; // Create a setting in a container ApplicationDataContainer container = localSettings.CreateContainer( "exampleContainer", ApplicationDataCreateDisposition.Always); localSettings.Containers["exampleContainer"].Values["message"] = "Hello World"; Object value = localSettings.Containers["exampleContainer"].Values["message"];

10

11 using Windows.Storage; ApplicationDataContainer roamingSettings = ApplicationData.Current.RoamingSettings; ApplicationDataCompositeValue composite = new ApplicationDataCompositeValue(); composite["readerSet"] = "Liam's Books"; composite["page"] = 524; roamingSettings.Values["HighPriority"] = composite;

12 using Windows.Storage; // DataChanged is fired when new data has been roamed to this device applicationData.DataChanged += new TypedEventHandler (DataChangedHandler); async void DataChangedHandler(Windows.Storage.ApplicationData appData, object o) { // DataChangeHandler may be invoked on a background thread, so use the // Dispatcher to invoke the UI-related code on the UI thread. Not needed // in JavaScript. await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { // Handle new data }); }

13 using Windows.Storage; using Windows.Storage.AccessCache; // First permission granted by folder picker StorageFolder folder = await folderPicker.PickSingleFolderAsync(); if (folder != null) { // Remember permission for future access to the folder // (including other sub-folder contents) StorageApplicationPermissions.FutureAccessList.AddOrReplace( "PickedFolderToken", folder); } // Retrieve cached permission (in a later session) StorageFolder folder2 = await StorageApplicationPermissions.FutureAccessList.getFolderAsync("PickedFolderToken");

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28


Download ppt "Apps are notified when they have been resumed."

Similar presentations


Ads by Google