我有一個Button
的MouseLeftButtonUp不火
<Button>
<Button.Template>
<ControlTemplate>
<StackPanel>
<Image Source="share.png"
MouseLeftButtonUp="Image_MouseLeftButtonUp"
MouseLeftButtonDown="Image_MouseLeftButtonDown" />
</StackPanel>
</ControlTemplate>
</Button.Template>
</Button>
但問題是,不像的MouseLeftButtonDown的事件MouseLeftButtonUp不火。爲什麼?我該如何解決它?謝謝。
我必須使用這些事件來更改圖像源。即使使用Button事件MouseLeftButtonUp也不起作用。 – Nick
謝謝,非常有用。 – Nick
我相信'MouseLeftButtonUp'事件只是在'MouseUp'之後調用的。由於'Button'可能爲'MouseUp'設置'IsHandled'屬性爲'true',所以'MouseLeftButtonUp'可能永遠不會被提升。嘗試處理'Button'上的'MouseUp'。 (您甚至可能需要處理'PreviewMouseUp' - 不確定事件處理的順序。) – JDB