namespace EnhancedScrollerDemos.GridSelection { public delegate void SelectedChangedDelegate(bool val); /// /// Data class to store information /// public class Data { public string someText; public SelectedChangedDelegate selectedChanged; /// /// The selection state /// private bool _selected; public bool Selected { get { return _selected; } set { // if the value has changed if (_selected != value) { // update the state and call the selection handler if it exists _selected = value; if (selectedChanged != null) selectedChanged(_selected); } } } } }