protected override void OnBackgroundActivated(BackgroundActivatedEventArgs args) { base.OnBackgroundActivated(args); if (args.TaskInstance.TriggerDetails is AppServiceTriggerDetails) { appServiceDeferral = args.TaskInstance.GetDeferral(); args.TaskInstance.Canceled += OnTaskCanceled; // Associate a cancellation handler with the background task. AppServiceTriggerDetails details = args.TaskInstance.TriggerDetails as AppServiceTriggerDetails; var connection = details.AppServiceConnection; ServiceConnectionProvider.InitializeTrackingProvider(connection); } }
protected async override void Initialize() { this.BusyCount++; var response = await ServiceConnectionProvider.GetDescription(); if (!string.IsNullOrEmpty(response.Result)) { this.Description = response.Result; this.RaisePropertyChanged(() => this.Description); } this.BusyCount--; }
private async void InitializeExecute() { this.BusyCount++; var parameter = NavigationProvider.NavigationParameter as MediaToolItem; if (parameter != null) { var response = await ServiceConnectionProvider.GetFileInfo(parameter.FilePath); this.Info = response.Result; this.CurrentItem = parameter; } await this.IsFavoriteFile(); this.RaisePropertyChanged(() => this.Info); this.BusyCount--; }