开发者

Button with Image, Why does button command not fire when image is clicked?

开发者 https://www.devze.com 2023-02-06 02:34 出处:网络
The button command only fires if the mouse is not over the image when it is clicked. What am I missing?

The button command only fires if the mouse is not over the image when it is clicked. What am I missing?

<Button Cursor="Hand" Command="{Binding Path=SomeC开发者_运维技巧ommand}">
    <Image Source="image.png" />                         
</Button>


I think your image is swallowing your mouse clicks.

Try adding IsHitTestVisible="False" to your image.

0

精彩评论

暂无评论...
验证码 换一张
取 消