1

ここでの簡単な質問: (または同等StaysOpenの) コントロールのプロパティは実際に何をしますか? 動作の違いを観察しようとしましたが、まったく気づきませんでした。ContextMenuPopup

MSDN は次のように述べています。

IsOpen プロパティが false に変わるまでメニューを開いたままにする場合は true 。それ以外の場合は false。デフォルトは false です。

However, this is really quite vague, and is of no help to me. I was previously guessing that the popup would only be closed when IsOpen is set to false from code - and not when it loses focus/mouse capture (my desired behaviour), but this seems to not be the case.

Could someone please explain what exactly this property is meant to do? Ideally, an exampe identify that difference in behaviour would be most helpful. Finally, if you have any suggestions how I might get my desired behaviour, that would be great.

4

1 に答える 1

1

Seems like the answer is that because ContextMenu captures the mouse, the popup inevitably closes because the control is automatically wired to close the popup when the mouse loses capture. A design flaw, perhaps? It seems that it can however be overcome by using a primitive Popup control, or a ToolTip when appropiate.

于 2009-08-23T14:06:41.357 に答える