Back to Devexpress

OptionsContextMenu.TimeRulerContextMenuActions Property

wpf-devexpress-dot-xpf-dot-scheduling-dot-optionscontextmenu-03958700.md

latest4.7 KB
Original Source

OptionsContextMenu.TimeRulerContextMenuActions Property

Provides access to the collection of actions used to customize the time ruler’s context menu.

Namespace : DevExpress.Xpf.Scheduling

Assembly : DevExpress.Xpf.Scheduling.v25.2.dll

NuGet Package : DevExpress.Wpf.Scheduling

Declaration

csharp
public ObservableCollection<IControllerAction> TimeRulerContextMenuActions { get; }
vb
Public ReadOnly Property TimeRulerContextMenuActions As ObservableCollection(Of IControllerAction)

Property Value

TypeDescription
ObservableCollection<IControllerAction>

A collection of context menu customization actions.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to TimeRulerContextMenuActions
SchedulerControl

.OptionsContextMenu .TimeRulerContextMenuActions

|

Remarks

Add InsertAction, UpdateAction or RemoveAction to the TimeRulerContextMenuActions collection to modify the integrated time ruler’s context menu:

Use the OptionsContextMenu.TimeRulerContextMenu property to create a custom context menu for a time ruler.

Example

View Example

xaml
<dxsch:OptionsContextMenu.TimeRulerContextMenuActions>
        <!--Hide the "New All Day Event" and "New Recurring Event" items-->
        <dxb:UpdateAction ElementName="{x:Static Member=dxsch:DefaultBarItemNames.ContextMenu_Items_TimeRuler_Actions_NewAllDayEvent}" 
                          PropertyName="IsVisible" 
                          Value="False"/>
        <dxb:UpdateAction ElementName="{x:Static Member=dxsch:DefaultBarItemNames.ContextMenu_Items_TimeRuler_Actions_NewRecurringEvent}" 
                          PropertyName="IsVisible" 
                          Value="False"/>
    <!--Disable the "New Appointment" and "New Recurring Appointment" item-->
        <dxb:UpdateAction ElementName="{x:Static Member=dxsch:DefaultBarItemNames.ContextMenu_Items_TimeRuler_Actions_NewAppointment}" 
                          PropertyName="IsEnabled" 
                          Value="False"/>
        <dxb:UpdateAction ElementName="{x:Static Member=dxsch:DefaultBarItemNames.ContextMenu_Items_TimeRuler_Actions_NewRecurringAppointment}" 
                          PropertyName="IsEnabled" 
                          Value="False"/>
</dxsch:OptionsContextMenu.TimeRulerContextMenuActions>

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the TimeRulerContextMenuActions property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-scheduler-customize-context-menus/CS/DXScheduler_PopUpMenuCustomization/MainWindow.xaml#L66

xml
<!--region #TimeRulerContextMenu-->
<dxsch:OptionsContextMenu.TimeRulerContextMenuActions>
    <!--Hide the "New All Day Event" and "New Recurring Event" items-->

See Also

Pop-Up Menus

OptionsContextMenu Class

OptionsContextMenu Members

DevExpress.Xpf.Scheduling Namespace