Creating custom tooltips in WPF

I needed to display a tooltip and wanted it to look a little fancier than the standard one.

First off, here’s how we might create a standard tooltip

<StackPanel Orientation="Horizontal" ToolTip="{Binding ItemName}">
</StackPanel>

Ofcourse we can also expand a ToolTip to allow us to define more interesting content than just the string, like this

<StackPanel Orientation="Horizontal">
   <StackPanel.ToolTip>
      <ToolTip>
         <!-- UI Elements and Bindings -->
      </ToolTip>
   </StackPanel.ToolTip>
</StackPanel>

That’s all there is to it.