First of all, I'm new to XAML / C# (am iOS/Android programmer) so please bear with me instead of immediately voting down. My app has some GridViews that contain buttons. A lot of these buttons are similar and I would like to refactor this. For simplicity let's say my buttons are just Rectangles with a given color. This color might come from the Item class that defines the particular item in the GridView, or it might be hardcoded. I want the rectangle to change color on hover and pressed states. I want these colors to be parameters as well.
What is the best way to achieve this?
- I tried to make a Button subclass but somehow I couldn't access the dependency properties in the VisualStateManager
- I tried to write stuff in the code-behind but then I wasn't sure how to delegate the click command to the ViewModel class.
Could someone give me a small working example?
Thanks

