O'Reilly logo

Mastering Windows 8 C++ App Development by Pavel Yosifovich

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Change notifications

Data binding supports three modes for binding: one way, two way, and one time. Up until now the binding occurred when the page first loads and remains unchanged after that. What happens if we change a property value on a Person object after the bindings are in place?

After adding a simple button, the Click event handler does the following:

auto person = (Person^)this->Resources->Lookup("p1");
person->BirthYear++;

Since the Person instance was defined as a resource (uncommon, but possible), it's extracted from the Resources property of the page by using the specified key (p1). Then the BirthYear property is incremented.

Running the application shows no visual change. Setting a breakpoint in the Click handler confirms it's actually ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required