HTML and CSS Reference
because all you do is manage your variegated data as an object, add an attribute to markup, and
adjust a few lines of code to trigger binding.
Important Windows 8 data binding is just one of the services you get out of the box with
the WinJS library. You are not forced to use the Windows 8 framework for data binding.
It is probably easiest if you have no knowledge of web development. However, if you are
already familiar with web development and libraries, such as Knockout (or some jQuery
plugins), then you can just import these libraries and do data binding through their
infrastructure. In summary, any approach you may know for data binding works in WinJS.
If not, you can always use the excellent WinJS native data binding infrastructure.
Note In this chapter, you only scratched the surface of data binding and barely explored a
very basic scenario. In the upcoming chapters, you'll learn how to bind complex objects and
a list of items to the user interface through the WinJS rich infrastructure.
Understanding the application's lifecycle
Any application in Windows 8 is characterized by a sequence of events that signal start, load and
finish of the application. Knowing more about these events that collectively form the application's
lifecycle is key, since it may lead to introducing optimizations in the code and producing a better
behavior, especially when your Windows 8 application runs on devices. A device, in fact, is hardly as
powerful as a laptop in terms of processing power, battery, and memory.
States of a Windows Store application
As Windows 8 is an operating system also devised to run on mobile devices, it can't just ignore a
basic rule of mobile operating systems. On mobile devices, the user launches an application but
never terminates it. Once launched, the application is kind of owned by the operating system and its
lifetime is managed by the operating system.
All Windows Store applications can be in one of the following four states: running, suspended,
terminated, or just not running. Transitions between these states are determined by the user and
system activity, as illustrated in Figure 5-8.