O'Reilly logo

Microsoft® Silverlight® Edition: Programming Windows® Phone 7 by Charles Petzold

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

Give and Take

The two binding services you’ve seen so far simply provide information. You can also create bindings in XAML that deliver data to the binding service and get back a result. As a very simple demonstration, let’s look at a binding service that performs the momentous feat of adding two numbers together. I call it Adder.

Example 12-17. Silverlight Project: Petzold.Phone.Silverlight File: Adder.cs

using System.ComponentModel; namespace Petzold.Phone.Silverlight { public class Adder : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; double augend = 0; double addend = 0; double sum = 0; public double Augend { set { if (augend != value) { augend = value; OnPropertyChanged(new PropertyChangedEventArgs("Augend")); ...

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