References:
https://www.tutorialspoint.com/wpf/wpf_dependency_properties.htm
define a new mouse event: mouseover.
<Window x:Class="DependencyProperties.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local = "clr-namespace:DependencyProperties"
Title="MainWindow" Height="350" Width="525">
<Grid>
<Button Height="40" Width="175" Margin="10" Content="Dependency Properties">
<Button.Style>
<Style TargetType="{x:Type Button }">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
</Grid>
</Window>
Output:
Related github link is below:
https://github.com/LeoMingGit/WPF_UI_Design/tree/master/DependencyProperties