Aiax

I've spent a really really long time trying to create a statefull button and cant seem to do it.

I don't know why this is so difficult. Essentually clicking the button toggles it's state. When the state changes i need to do an animation.

I've tried just about every combination of tutorials and every one of them is somehow too generic, like toggling a color, which is a color animation and is based off a property... which is not close to what i need.

Why is it not possable to just inherit from button, add a dependancy property, then create a Style Why is this so hard I cant imagine it is supposed to take days to create one button...



Re: Windows Presentation Foundation (WPF) Statefull button

Josh Smith

I think you're looking for the ToggleButton.






Re: Windows Presentation Foundation (WPF) Statefull button

Drew Marsh

Yep, like Josh said, just use ToggleButton with a property trigger on the IsChecked property.