Best way to keep popup button open when it has a checkbox

Ribbon for WPF Forum

Posted 11 years ago by Brad Daszynski
Version: 3.5.0421
Avatar
I have a popup menu button and I am wanting some of its menu items to be check boxes. However, I can't seem to find a good way to keep the popup button's menu open when I click a check box. What is the best way to accomplish this? My code is something like this (btw, I'm not hard set on having a "checkbox menu item"... as long as there is a checkbox in my popup button's menu that, when checked/unchecked, doesn't cause the popup menu to close):

<ribbon:PopupButton Label="Search" StaysOpenOnClick="True">
<ribbon:Menu>
<ribbon:ComboBox MinWidth="100" Label="Search:" IsEditable="True">
<ComboBoxItem>Previous search item 1</ComboBoxItem>
<ComboBoxItem>Previous search item 2</ComboBoxItem>
<ComboBoxItem>Previous search item 3</ComboBoxItem>
</ribbon:ComboBox>
<ribbon:Separator Label="Search Options" />
<ribbon:CheckBox Label="Option 1" IsChecked="True" />
<ribbon:CheckBox Label="Option 2" IsChecked="False" />
</ribbon:Menu>
</ribbon:PopupButton>

Comments (1)

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
You almost have it, just set StaysOpenOnClick="True" on the checkboxes. You probably don't need it on the PopupButton.


Actipro Software Support

The latest build of this product (v2019.1 build 0681) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.