void OnInfoPageInformationReady(object sender, Information info) { // If the object has already been added, replace it. int index = list.IndexOf(info); if (index != -1) { list[index] = info; } // Otherwise, add it. else { list.Add(info); } }
public void InitializeInfo(Information info) { // Replace the instance. this.info = info; // Initialize the views. nameEntry.Text = info.Name ?? ""; emailEntry.Text = info.Email ?? ""; if (!String.IsNullOrWhiteSpace(info.Language)) { languagePicker.SelectedIndex = languagePicker.Items.IndexOf(info.Language); } datePicker.Date = info.Date; }