带有图像的按钮:单击时抑制轻弹效果
我已经定义了一个带有图像的按钮(在 wp7 应用程序中)。我希望能够单击它,但我不希望它在单击时闪烁。是否可以?
<Button Name="imageButton" BorderThickness="0" Height="80" Width="80" Margin="0,-10,0,0" Clip="">
<Image Source="{Binding favoriteIcon}" Width="35" Height="35" Stretch="Uniform"/>
</Button>
I have defined a button with a image in it (in a wp7 app). I want to be able to click it, but I don't want it to flicker when it's clicked. Is it possible?
<Button Name="imageButton" BorderThickness="0" Height="80" Width="80" Margin="0,-10,0,0" Clip="">
<Image Source="{Binding favoriteIcon}" Width="35" Height="35" Stretch="Uniform"/>
</Button>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为“闪烁”效果是指单击时按钮颜色反转的方式?
此行为是在“按钮”模板中定义的,抱歉有大量代码,但这里突出显示了导致此效果的部分:
您可以创建此模板的副本并删除“按下”状态效果以将其删除。
By the 'flicker' effect I presume you mean the way that the colour of the button becomes inverted when clicked?
This behaviour is defined in the Button template, sorry for the huge block of code, but here it is with the part that causes this effect highlighted:
You can create a copy of this template and removed the 'Pressed' state effects to remove it.