Class ToolTipHost<TView>
A generic tooltip view that hosts a view and can be shown by a ToolTipManager.
public class ToolTipHost<TView> : PopoverImpl, IDisposable, ISupportInitializeNotification, ISupportInitialize, IPopoverView, IPopover, IDesignable where TView : View, new()
Type Parameters
TViewThe type of view being hosted. Must derive from View and have a parameterless constructor.
- Inheritance
-
ToolTipHost<TView>
- Implements
- Inherited Members
- Extension Methods
Remarks
This class is inspired by Popover<TView, TResult> but simplified for tooltip scenarios where no result extraction is needed.
This class is responsible only for hosting, positioning and displaying tooltip content. Hover handling and target registration should be managed externally by a tooltip manager.
Constructors
- ToolTipHost()
Initializes a new instance of the ToolTipHost<TView> class.
- ToolTipHost(TView?)
Initializes a new instance of the ToolTipHost<TView> class with the specified content view.
Properties
- ContentView
Gets or sets the content view hosted by this tooltip.
Methods
- Dispose(bool)
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
- EnableForDesign<TContext>(ref TContext)
Enables the tooltip for use in design-time scenarios.
- GetAdjustedPosition(View, Point)
Calculates an adjusted screen-relative position for the content view to ensure full visibility.
- MakeVisible(Point?, Rectangle?)
Makes the tooltip visible and positions it based on Anchor or
idealScreenPosition.
- OnVisibleChanged()
Called when the Visible property has changed. Hides the popover via ApplicationPopover when becoming invisible.
- SetContent(Func<TView>)
Replaces the current content with a newly created view.
- SetPosition(Point?, Rectangle?)
Sets the position of the tooltip based on
idealScreenPositionoranchor.