Skip to main content

AppointmentViewInfo Class

Provides information on the visual representation of the appointment.

Namespace: DevExpress.Xpf.Scheduler.Drawing

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

#Declaration

public class AppointmentViewInfo :
    IAppointmentViewInfo,
    IAppointmentView,
    ISelectableIntervalViewInfo,
    INotifyPropertyChanged

#Returned By

The AppointmentViewInfoCustomizingEventArgs.ViewInfo property returns an instance of AppointmentViewInfo.

#Remarks

The AppointmentViewInfo object can be accessed via the AppointmentViewInfoCustomizingEventArgs.ViewInfo property, when handling the SchedulerControl.AppointmentViewInfoCustomizing event. This object contains information used to render an appointment or part of an appointment, and provides properties that can be used to customize the appointment appearance (for example, AppointmentViewInfo.Subject, AppointmentViewInfo.LabelColor, AppointmentViewInfo.Interval, AppointmentViewInfo.Options, AppointmentViewInfo.CustomViewInfo, etc.).

#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
AppointmentViewInfo
See Also