Professional Documents
Culture Documents
01 | Introduction to the Windows Store Platform and the tools 02 | C# for Objective-C developers 03 | Async programming & Networking intro Meal Break, around noon PST 45 to 60 mins 04 | Introduction to XAML & UI Patterns for XAML apps 05 | App Model & Storage 06 | Contracts 07 | Notifications 08 | Windows Store APIs
demo
State
Visible
Inactive Background
Suspended
Mostly No
No
No No
No
Yes Yes
No
Splash screen
MyGame.Common.SuspensionManager.SessionState["gameStatus"] = GameViewModel.CurrentGameStatus;
public App() { this.InitializeComponent(); this.Suspending += OnSuspending; } private async void OnSuspending(object sender, SuspendingEventArgs e) { var deferral = e.SuspendingOperation.GetDeferral(); //serializes Page States and SessionState to local StorageFile await SuspensionManager.SaveAsync(); deferral.Complete(); }
protected override void LoadState(Object navigationParameter, Dictionary<String, Object> pageState) { if (pageState == null) //Do Page State initialization else greetingOutput.Text = pageState["greetingOutputText"].ToString(); }
demo
private void RegisterBackgroundTask() { BackgroundTaskBuilder builder = new BackgroundTaskBuilder(); builder.Name = "FlickrBackgroundSearchTask"; builder.TaskEntryPoint = "FlickrBackgroundTasks.FlickrSearchTask"; IBackgroundTrigger trigger = new TimeTrigger(15, true); builder.SetTrigger(trigger); IBackgroundCondition condition = new SystemCondition(SystemConditionType.InternetAvailable);
namespace BackgroundTasks { public sealed class FlickrSearchTask : IBackgroundTask { async void Run(IBackgroundTaskInstance taskInstance) { var _deferral = taskInstance.GetDeferral(); HttpResponseMessage response = await client.GetAsync(queryUrl); String jsonString = await response.Content.ReadAsStringAsync(); await FileIO.WriteTextAsync(currentSearchResultsFile, jsonString); updateLiveTile(); _deferral.Complete();
Trigger name
Description
TimeTrigger
PushNotificationTrigger ControlChannelTrigger
Trigger name
Description
InternetAvailable
NetworkStateChange OnlineIdConnectedStateChange SmsReceived TimeZoneChange