This seems like a really, really simple problem, but I can't figure it out. The culprit appears to be WP7's default style. It changes the background color to white when a button is clicked, then back to the button's default background.
The problem I have is I want to change the button's background when the button is clicked. I can't find any possible way to do this.
I've tried setting the background in code, but that does nothing. I think it's being overwritten by the default style.
I've tried using a Property Change behavior in Blend, but that has the exact same result.
I've tried creating a new visual state for the button and setting that on click, but that's a little buggy and has a large overhead for the number of buttons I'm dealing with. Also, it didn't work.
I can set other buttons' background on a click event, just not the button being clicked.
This is such an annoying roadblock! I'm sure this is a one line of code kind of answer. :)
question from:
https://stackoverflow.com/questions/3476963/windows-phone-7-wp7-change-a-buttons-background-color-on-click 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…