WPF ContextMenu complex item stays open on click? -


So I have a complex context menu. There is no menu item in it, it also has radio buttons, and there is a stackpanel below which has an integer box.

context menu

  & lt; button. Contemporary menu & gt; & Lt; ContextMenu & gt; & Lt; RadioButton tag = "30" content = "30 seconds" group name = "ad lang" checked "adLength_Checked" IsChecked = "True" /> & lt; radio button tag = "60" content = "1 minute" groupname = " Ad Lang "checked" "adLength_Checked" /> & Lt; Radio button tag = "90" content = "1 minute 30 seconds" group name = "ad length" checked "" ad length_hecked "/> & gt; radio button tag =" 120 "content =" 2 minutes "groupname =" Advertising Lang "checked" "ad length_hecked" /> & Lt; Radio button tag = "150" content = "2 minutes 30 seconds" group name = "ad length" checked "" ad length_heckcade "/> gt; radio button tag =" 180 "content =" 3 minutes "groupname =" Ad Lang "checked" = adLength_Checked "/>>   
StackPanel Orientation =" Horizontal "> TextBlock> Every Minutes & LT ; /Button.ContextMenu>

is the option for staysopenonclick in the Object ; when someone is on that item When the context is clicked, the context menu is open. & lt; RadioButton & gt; objects do not have that option, but they remain open anyway.

The problem I have is with the previous item, & lt; StackPanel & gt; . When a user clicks on the text field of IntegerUpDown , the context menu stops. Is it impossible to use such items as what I am trying to do in a context menu? Is there a way to open context menu until the user clicks out of the menu?

Just in the content StackPanel in a MenuItem Set the StaysOpenOnClick property as true as its header.

  & lt; Open the menu item staunch = "True" & gt; & Lt; MenuItem.Header & gt; & Lt; StackPanel Orientation = "Horizontal" & gt; & Lt; TextBlock & gt; Every & lt; / TextBlock & gt; & Lt; Text box text = "30" width = "50" margin = "5,0" /> & Lt; TextBlock & gt; Minute & lt; / TextBlock & gt; & Lt; / StackPanel & gt; & Lt; /MenuItem.Header> & Lt; / MenuItem & gt;  

Comments