public async Task SaveStateAsync() { var suspensionState = new SuspensionState() { SuspensionDate = DateTime.Now }; var target = OnBackgroundEntering?.Target.GetType(); var onBackgroundEnteringArgs = new OnBackgroundEnteringEventArgs(suspensionState, target); OnBackgroundEntering?.Invoke(this, onBackgroundEnteringArgs); await ApplicationData.Current.LocalFolder.SaveAsync(StateFilename, onBackgroundEnteringArgs); }
public OnBackgroundEnteringEventArgs(SuspensionState suspensionState, Type target) { SuspensionState = suspensionState; Target = target; }