Scheduler supports categories created at run time through the Categories dialog box. Once added to the list, the category can be assigned to an appointment.
The new categories appears in the Categories dialog box when the Categories button is clicked in the Appointment dialog box:
To add a category at run time:
To add a categories programmatically, use the following code:
C# |
Copy Code
|
---|---|
ObservableCollection<string> categories = new ObservableCollection<string>(); // Add categories to the category list private void Add_Categories(object sender, RoutedEventArgs e) { // add new categories to the existing list categories.Add("Conference"); categories.Add("Video Call"); categories.Add("Interview"); categories.Add("Games"); foreach (string category in categories) { Category ct = new Category(); ct.MenuCaption = category; if (!sched1.DataStorage.CategoryStorage.Categories.Any(x => x.MenuCaption == category)) sched1.DataStorage.CategoryStorage.Categories.Add(ct); } } |