Button hover effect
-
I changed the Background property of a Button.. But when I'm hovering the Button, the Button background turns normal again. I tried to add a trigger for hovering but it doesnt work..:
local:ButtonEx.Triggers
<Trigger Property="local:ButtonEx.IsMouseOver" Value="True">
<Setter Property="local:ButtonEx.Background" Value="Red" />
</Trigger>
</local:ButtonEx.Triggers>I get an XamlParseException telling me: Content of the type System.Windows.Trigger cannot be added to a System.Windows.TriggerCollection. (Translated from German) *confused* I just have no clue, where my mistake could be.. Maybe you could help?
-
I changed the Background property of a Button.. But when I'm hovering the Button, the Button background turns normal again. I tried to add a trigger for hovering but it doesnt work..:
local:ButtonEx.Triggers
<Trigger Property="local:ButtonEx.IsMouseOver" Value="True">
<Setter Property="local:ButtonEx.Background" Value="Red" />
</Trigger>
</local:ButtonEx.Triggers>I get an XamlParseException telling me: Content of the type System.Windows.Trigger cannot be added to a System.Windows.TriggerCollection. (Translated from German) *confused* I just have no clue, where my mistake could be.. Maybe you could help?
Do a search on Button Control Templates. The best and quickest way to accomplish this task, is to retemplate the button. Plenty of article on the web, especially in the Expression Blend spaces. In Blend, this takes seconds to accomplish.
Cheers, Karl
» CodeProject 2008 MVP My Blog | Mole's Home Page | XAML Power Toys Home PageJust a grain of sand on the worlds beaches.