Scheduler supports contacts created at run time through the Contacts dialog box. Once added to the list, the contact can be assigned to an appointment.
To add a contact at run time:
To add contacts programmatically in the Appointment dialog, use the following code:
C# |
Copy Code
|
---|---|
ObservableCollection<string> contacts = new ObservableCollection<string>(); private void Add_Contacts(object sender, RoutedEventArgs e) { contacts.Add("Lionel Messi"); contacts.Add("Cristiano Ronaldo"); contacts.Add("Xavi"); contacts.Add("Andres Iniesta"); contacts.Add("Zlatan Ibrahimovic"); contacts.Add("Radamel Falcao"); contacts.Add("Robin van Persie"); contacts.Add("Andrea Pirlo"); contacts.Add("aya Toure"); contacts.Add("Edinson Cavani"); foreach (string contact in contacts) { Contact cnt = new Contact(); cnt.MenuCaption = contact; if (!sched1.DataStorage.ContactStorage.Contacts.Any(x => x.MenuCaption == contact)) sched1.DataStorage.ContactStorage.Contacts.Add(cnt); } } |