Update 26/09/2011 – There’s an updated version available in the archive ‘Zuker.WpfSamples.zip‘ with minor bug fixes.
Finally, the last post of the series 🙂
Initial posts –
Attached is my final solution with a working example.
<TextBlock Text=”This will be displayed in the popup” />
Dependency Properties: (Popup Placement Related)
- EnableAnimation – Applies cool opening effect. (defaults to true)
- RelatedObject – the object the popup content was assigned to. Handy in some cases. (Check the example project)
- CloseCommand – Closes the opened tooltip. (You can place buttons in the RichToolTip content / contenttemplate which will invoke it in order to close it)
- PopupContent – The main entry point for using the RichToolTip (See usage section). you can provide any object which will be made the the tooltip content. (For being able to set placement or other properties you should insert the RichToolTip itself – see attached code)
- HideOnClick – A helper property for allowing a button which triggers some command to close the opened tooltip as well. I needed it – seemed useful 🙂
- The popup hides itself when repositioning is needed (window is moved, resize, etc..). This is the common popup behavior (Tooltip and ContextMenu themselves) so I consider this as an overall logical behavior.
- In XBAP mode –
- Transparency is set through a hack and is only supported in Full Trust mode.
- Moving the mouse real slowly towards the popup will cause it to hide (If it bothers you, you could modify the code and use a timer)
- Hovering the mouse over the associated element shows the RichToolTip even though the browser window isn’t the active window.