関連する質問(詳細)
ContextMenuを関連付けたWPFキャンバスがあります。
これはカッコいい。次に、RightDoubleClickでアクションを実装する必要があります...
実際、右マウスのClickCount ==2..で受信することはありません。
何をすべきか?
単純な(右)クリックでContextMenuを表示し、Action2OnRightDoubleClickを実行する必要があります。
protected override void OnPreviewMouseRightButtonUp(MouseButtonEventArgs e)
{
if (e.ClickCount == 1)
{
#region SINGLE CLICK
stillSingleClick = true;
Thread thread = new Thread(
new System.Threading.ThreadStart(
delegate()
{
Thread.Sleep(System.Windows.Forms.SystemInformation.DoubleClickTime);
this.Dispatcher.Invoke(
System.Windows.Threading.DispatcherPriority.Background,
new Action(
delegate()
{
if (stillSingleClick)
{
base.OnPreviewMouseRightButtonUp(e);
}
stillSingleClick = false;
}
));
}
));
thread.Start();
#endregion SINGLE CLICK
}
else if (e.ClickCount == 2)
{
stillSingleClick = false;
base.OnPreviewMouseRightButtonUp(e);
}
}