I trying to write simple code that contain button that will change the background color on mouse over.
I want to do it using Triggers – so i write this code – but i dont know how to continue
<Button Background="#fafafa" >
<Button.Triggers>
<EventTrigger RoutedEvent="Button.MouseEnter"/>
// What to do here to having thi background color change ?
</Button.Triggers>
</Button>
The best way is to change Buttons template. This post describes how to do that. In buttons template under VisualStateManager you will find
vsm:VisualState x:Name="MouseOver". Change its content as you need.Or if you want do that with triggers, than take a loot to Behaviors and Triggers in Silverlight post on silverlightshow.net.