I am trying to make an appointment book in Silverlight with C#, so I will have a main AppointmentBook control, with follows to store each of the Appointment control:
List<kAppointment> appointments = null;
public IList<kAppointment> Appointments
{
get
{
if (appointments == null)
{
appointments = new List<kAppointment>();
}
// Can notify something change here,
return appointments;
}
}
I can notify the AppointmentBook control new list assigned with above code, so it will redraw each of the appointments control.
But how can I check it if the appointment list is changed by the follows?:
appointments.Add(NewAppointment);
Sounds like a job for ObservableCollection.
This lets us subscribe to events and tells us in what way the collection changed.