Presentation is loading. Please wait.

Presentation is loading. Please wait.

Similar presentations


Presentation on theme: ""— Presentation transcript:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40 FROM public sealed class SampleBackgroundTask : IBackgroundTask { public async void Run(IBackgroundTaskInstance taskInstance) { try{ var deferral = taskInstance.GetDeferral(); await DoSomethingAsync(); deferral.Complete(); } catch(..){ } }

41 To public sealed class SampleBackgroundTask : IBackgroundTask{ public async void Run(IBackgroundTaskInstance taskInstance){ try{ taskInstance.Canceled += new BackgroundTaskCanceledEventHandler(OnCanceled); var deferral = taskInstance.GetDeferral(); await DoSomethingAsync(); } catch(..){…} finally{ deferral.Complete(); } } }

42

43

44 private void navigationHelper_SaveState( object sender, SaveStateEventArgs e) { if (this.itemsViewSource.View != null) { var selectedItem = (Data.SampleDataItem)this.itemsViewSource.View.CurrentItem; if (selectedItem != null) e.PageState["SelectedItem"] = selectedItem.UniqueId; int[] a5 = new int[5]; e.PageState["SomeData"] = a5; }

45

46

47

48

49


Download ppt ""

Similar presentations


Ads by Google