You need to wrap it into a class in order to use DataBinding. That class should implement INotifyPropertyChanged interface. Here is the example. public class MyInteger : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; private int intValue; public int IntValue { get { return intValue; } set { intValue = value; PropertyChanged(this, new PropertyChangedEventArgs("IntValue")); } }
public MyInteger() { PropertyChanged = new PropertyChangedEventHandler(OnPropertyChanged); intValue = 0; }