MvvmStack for WinJS: Application Resuming support

Corrado Cavalli
Corrado Cavalli
Published in
1 min readApr 5, 2013

I’ve checked in a new version of MvvmStack that has a small tweak and a “new” feature, let’s start with the latter:

Resuming support

Sometimes you need to be informed when app resumes, an example is because you want to download some fresh data if app has been suspended longer than a certain amount of time.

With MvvmStack all you need to do to is to add a onAppResuming method to your services and/or ViewModels, something like: (see sectionViewModel.js on sample code)

onAppResuming: function () {
console.log("SectionViewModel notified that app has been resumed.")
}

And it will be invoked each time app resumes.

The ‘tweak’ regards the way you add new ViewModels, in this post, on Closing section i mention:

“3- Add a new property “pagenameViewModel” to ViewModelLocator’s viewModels object“

starting from this version the step is no longer required

Smile

--

--

Corrado Cavalli
Corrado Cavalli

Senior Sofware Engineer at Microsoft, former Xamarin/Microsoft MVP mad about technology. MTB & Ski mountaineering addicted.