How to: Add an Item to the Context Menu (legacy)

NOTE

You are viewing documentation for the legacy WPF Scheduler control. If you're starting a new project, we strongly recommend that you use a new control declared in the DevExpress.Xpf.Scheduling namespace. If you decide to upgrade an existing project in order to switch to the updated scheduler control, see the Migration Guidelines document.

This example demonstrates how to add custom menu items to the Appointment Popup Menu of the SchedulerControl using the SchedulerControl.AppointmentMenuCustomizations property in XAML. Add a bar item (BarCheckItem, BarButtonItem or BarItemSeparator class instance) to the collection and specify item properties. To insert an item into a specific position, attach the BarItemLinkActionBase.ItemLinkIndex property.

<!--Add items to the Appointment popup menu-->
<dxsch:SchedulerControl.AppointmentMenuCustomizations>
    <dxb:BarItemSeparator dxb:BarItemLinkActionBase.ItemLinkIndex="1" />
    <dxb:BarCheckItem Name="customCheckItem" 
                      Content="BarCheckItem Added in XAML" 
                      dxb:BarItemLinkActionBase.ItemLinkIndex="2" 
                      CheckedChanged="customCheckItem_CheckedChanged" />
    <dxb:BarButtonItem Name="customButtonItem" 
                       Content="BarButtonItem Added in XAML" 
                       dxb:BarItemLinkActionBase.ItemLinkIndex="3"
                       ItemClick="customButtonItem_ItemClick"/>
    <dxb:BarItemSeparator dxb:BarItemLinkActionBase.ItemLinkIndex="4" />
</dxsch:SchedulerControl.AppointmentMenuCustomizations>
See Also