I want to add hover effect to a control (changing border or background color will do). I have found many answers about it such as this one: WPF: On Mouse hover on a particular control, increase its size and overlap on the other controls
The problem is I am using custom control (I am using materialdesign
for wpf specifically). I don't even know what to put on the TargetType
.
UPDATE: Here is what I have done so far. I have removed irrelevant code.
As I have said, I don't know what to put on the TargetType
, so I tried to put Control
but it is not working.
<md:Card
Margin="4 4 4 4"
Width="100"
Height="220"
>
<md:Card.Style>
<Style TargetType="{x:Type Control}">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</md:Card.Style>
<Grid>
</Grid>
</md:Card>