ToolTip.CustomPopupPlacementCallback ToolTip.CustomPopupPlacementCallback ToolTip.CustomPopupPlacementCallback ToolTip.CustomPopupPlacementCallback Property

Definición

Obtiene o establece el método controlador delegado que se usará para colocar la ToolTip.Gets or sets the delegate handler method to use to position the ToolTip.

public:
 property System::Windows::Controls::Primitives::CustomPopupPlacementCallback ^ CustomPopupPlacementCallback { System::Windows::Controls::Primitives::CustomPopupPlacementCallback ^ get(); void set(System::Windows::Controls::Primitives::CustomPopupPlacementCallback ^ value); };
[System.ComponentModel.Bindable(false)]
public System.Windows.Controls.Primitives.CustomPopupPlacementCallback CustomPopupPlacementCallback { get; set; }
member this.CustomPopupPlacementCallback : System.Windows.Controls.Primitives.CustomPopupPlacementCallback with get, set
Public Property CustomPopupPlacementCallback As CustomPopupPlacementCallback

Valor de propiedad

Método delegado CustomPopupPlacementCallback que proporciona información de colocación para la ToolTip.The CustomPopupPlacementCallback delegate method that provides placement information for the ToolTip. De manera predeterminada, es null.The default is null.

Ejemplos

En el ejemplo siguiente se muestra cómo establecer CustomPopupPlacementCallback la propiedad y crear el delegado correspondiente.The following example shows how to set the CustomPopupPlacementCallback property and create the corresponding delegate. La misma técnica se usa en Popup, que se muestra en el ejemplo de colocación del elemento popup.The same technique is used to by the Popup, which is demonstrated in the Popup Placement Sample.

aToolTip.Placement = PlacementMode.Custom;
aToolTip.CustomPopupPlacementCallback =
    new CustomPopupPlacementCallback(placeToolTip);
aToolTip.Placement = PlacementMode.Custom
aToolTip.CustomPopupPlacementCallback = New CustomPopupPlacementCallback(AddressOf placeToolTip)
public CustomPopupPlacement[] placeToolTip(Size popupSize,
                                        Size targetSize,
                                        Point offset)
{
    CustomPopupPlacement placement1 =
       new CustomPopupPlacement(new Point(-50, 100), PopupPrimaryAxis.Vertical);

    CustomPopupPlacement placement2 =
        new CustomPopupPlacement(new Point(10, 20), PopupPrimaryAxis.Horizontal);

    CustomPopupPlacement[] ttplaces =
            new CustomPopupPlacement[] { placement1, placement2 };
    return ttplaces;
}
Public Function placeToolTip(ByVal popupSize As Size, ByVal targetSize As Size, ByVal offset As Point) As CustomPopupPlacement()
	Dim placement1 As New CustomPopupPlacement(New Point(-50, 100), PopupPrimaryAxis.Vertical)

	Dim placement2 As New CustomPopupPlacement(New Point(10, 20), PopupPrimaryAxis.Horizontal)

	Dim ttplaces() As CustomPopupPlacement = { placement1, placement2 }
	Return ttplaces
End Function

Comentarios

La Placement propiedad debe establecerse en Custom para que se utilice el delegado de devolución de llamada.The Placement property must be set to Custom for the callback delegate to be used.

El CustomPopupPlacementCallback delegado devuelve una matriz de posibles puntos que se definen con respecto PlacementTargeta.The CustomPopupPlacementCallback delegate returns an array of possible points that are defined with respect to the PlacementTarget. Cuando se muestra, se elige un punto que maximiza la cantidad de la ToolTip ventana que está visible. ToolTipWhen the ToolTip is displayed, a point is chosen that maximizes the amount of the ToolTip window that is visible.

Información sobre propiedades de dependenciaDependency Property Information

Campo de identificadorIdentifier field CustomPopupPlacementCallbackProperty
Propiedades de metadatos establecidas entrueMetadata properties set to true NingunaNone

Se aplica a

Consulte también: