Skip to main content

AppointmentViewInfoCustomizingEventArgs Class

Namespace: DevExpress.Xpf.Scheduler

Assembly: DevExpress.Xpf.Scheduler.v14.2.dll

#Declaration

public class AppointmentViewInfoCustomizingEventArgs :
    EventArgs

#Remarks

Note that AppointmentViewInfoCustomizingEventArgs objects are automatically created, initialized and passed to the SchedulerControl.AppointmentViewInfoCustomizing event handlers.

#Examples

TIP

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=E3885.

This example demonstrates how to use the AppointmentViewInfo.Subject, AppointmentViewInfo.Location, AppointmentViewInfo.Description, AppointmentViewInfo.CustomViewInfo, SchedulerViewBase.AppointmentToolTipContentTemplate properties and SchedulerControl.AppointmentViewInfoCustomizing event to define and apply a custom template for showing an appointment subject, location, description and resource images within appointment tooltips.

using System;
using System.Windows;
using System.Windows.Controls;
using System.Collections.Generic;
using System.Windows.Media.Imaging;
using DevExpress.XtraScheduler;
using DevExpress.Xpf.Scheduler;
using DevExpress.Xpf.Scheduler.Drawing;

namespace SilverlightApplication1 {
    public partial class MainPage : UserControl {
        Dictionary<Resource, BitmapImage> resourceImages = new Dictionary<Resource, BitmapImage>();

        public MainPage() {
            InitializeComponent();

            // ...

            DataTemplate template = (DataTemplate)this.Resources["AppointmentTooltipContentTemplate"];
            schedulerControl1.WeekView.AppointmentToolTipContentTemplate = template;
        }

        private void schedulerControl1_AppointmentViewInfoCustomizing(object sender, 
                                                        AppointmentViewInfoCustomizingEventArgs e) {
            AppointmentViewInfo viewInfo = e.ViewInfo;
            Resource resource = schedulerControl1.Storage.ResourceStorage.
                                GetResourceById(viewInfo.Appointment.ResourceId);
            if (resource == Resource.Empty || resource.Image == null)
                viewInfo.CustomViewInfo = null;
            else {
                if (!this.resourceImages.ContainsKey(resource))
                    this.resourceImages[resource] = resource.Image.Source as BitmapImage;
                viewInfo.CustomViewInfo = this.resourceImages[resource];
            }
        }
    }
}

#Inheritance

Object
EventArgs
AppointmentViewInfoCustomizingEventArgs
See Also