✅ Changing button on click
I am trying to change a button on click. So that once you click on it the icon changes to pause.png
Where should i start off?
5 Replies
I would probably add a data trigger to that image which is binded to the toggle buttons checked state, then swap out the source image depending on state
As always there are multiple ways to Rome.
The easiers (and worst) solution is to give the
Image
node a Name property and hardcode the MyImage.Source
to change in code behind
Let me repeat that the above is the worst but simplest option and serves as a starting point.
Depending on how knowledgable/comfortable you are with MVVM you can bind a property to the image source so you can change it from code behind but in a more decoupled way or even better change it in the viewmodel based on an event that gets bound to a viewmodel's methodI got it figured out 😃👍
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.