Brad
Brad

Reputation: 1207

WPF: PopUp on MouseOver of a ComboBoxItem

Does anyone know of an example of how to display a PopUp on MouseOver of a ComboBoxItem? TIA

EDIT: I know how to create, style and position the PopUp but not how to display it! I may be retired.

Upvotes: 0

Views: 7466

Answers (1)

Aran Mulholland
Aran Mulholland

Reputation: 23935

Before we start, could you just use a tooltip?

otherwise, style the ComboBoxItem's control telmplate, include your popup in the style positioned where you want but set the Isopen property to false.

Use a trigger on mouse over to set your popup's IsOpen property to true.

here is an example of using a trigger OnMouseOver

you will end up with a trigger in your style like this :-

  <Style.Triggers>
    <Trigger Property="IsMouseOver" Value="True">
      <Setter TargetName="thePopupsName"
              Property="IsOpen"
              Value="True" />
    </Trigger>
  </Style.Triggers>

when the mouseOver occurs the popup will popup, when its gone the popup will return to its default value.

Upvotes: 3

Related Questions