-api-id | -api-type |
---|---|
P:Microsoft.UI.Xaml.Controls.ToolTip.PlacementTarget |
winrt property |
Gets or sets the visual element or control that the tool tip should be positioned in relation to when opened by the ToolTipService.
<ToolTip PlacementTarget="{Binding ElementName=placementTargetName}"/>
- placementTargetName
- placementTargetNameThe Name or x:Name attribute of the element that serves as the placement target. This syntax assumes that the working data context contains the named element. For more information, see ElementName.
If there is no explicit PlacementTarget, the placement target for a ToolTip is the element that specifies the ToolTip as the value for its ToolTipService.Tooltip attached property value, and any Placement value applies to that target. The placement target determination is based on visual tree composition, and whether to display a tooltip at all is parallel to the target's hit test characteristics. A Control instance where IsEnabled is false will not display a ToolTip.
Placement and PlacementTarget are usually left as the defaults. The scenario for specifying either or both of these properties is if you are trying to avoid a case where the tooltip obscures the content it is referring to while the tooltip is displayed.