7

As in the title, I was wondering what is the difference between IsMouseOver and IsHighlighted property triggers in WPF styles.

Does anyone know?

Anatoliy Nikolaev
  • 22,370
  • 15
  • 69
  • 68
Sergio
  • 2,078
  • 3
  • 24
  • 41

1 Answers1

6

IsHighlighted takes any input device (like keyboard) into consideration for showing logical focus. It is not a DependencyObject level dependency property, as far as I researched it is available only for following 3 controls in WPF:

System.Windows.Controls.ComboBoxItem.IsHighlighted
System.Windows.Controls.MenuItem.IsHighlighted
System.Windows.Controls.Primitives.CalendarDayButton.IsHighlighted
Anatoliy Nikolaev
  • 22,370
  • 15
  • 69
  • 68
Rajiv
  • 1,426
  • 14
  • 21
  • 1
    It should be noted that IsHighlighted does not target the root border of a MenuItem Style; attempting to achieve a mouse over highlight will only register if you're directly over the header component of the MenuItem. In order to achieve a mouse over highlight, IsMouseOver should be used instead. This is also a difference. – Krythic Jun 18 '21 at 01:04