SchedulerViewBase.AppointmentToolTipContentTemplate Property
Gets or sets the template that defines the visual content of tooltips shown for appointments.
Namespace: DevExpress.Xpf.Scheduler
Assembly: DevExpress.Xpf.Scheduler.v14.2.dll
#Declaration
#Property Value
Type | Description |
---|---|
Data |
A Data |
#Remarks
The templates supplied by DXScheduler allow you to completely replace the look and feel of visual elements, while maintaining their existing behavior.
The binding source for the AppointmentToolTipContentTemplate template is represented by the VisualAppointmentViewInfo class.
To learn more, see Styles and Templates.
#Examples
TIP
A complete sample project is available in the DevExpress Code Examples database at http://www.
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];
}
}
}
}