WPF and Silverlight Edition Basic Library / Menu and ContextMenu / Menu and ContextMenu Features / Automatic Closing
Automatic Closing

By default, the C1ContextMenu control, its submenus, and the submenus of a C1Menu control will remain open even when a user clicks outside of the menu. The only way users can close the menu is if they click the C1Menu control or the C1ContextMenu control. However, you can change this behavior by enabling the automatic closing feature, which will allow users to close menus by clicking outside of the menu control's boundaries. To turn on automatic closing, set the AutoClose property to True.

To enable automatic closing, use one of the following methods:

Complete the following steps:

  1. Add AutoClose="True" to the <c1:C1Menu> or the <c1:C1ContextMenu> tag.
  2. Run the program.