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

El ejemplo siguiente muestra cómo establecer el CustomPopupPlacementCallback propiedad y crear el delegado correspondiente.The following example shows how to set the CustomPopupPlacementCallback property and create the corresponding delegate. Se usa la misma técnica para por la Popup, que se muestra en el Popup Placement Sample.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

El Placement propiedad debe establecerse en Custom para el delegado de devolución de llamada que se usará.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 a la PlacementTarget.The CustomPopupPlacementCallback delegate returns an array of possible points that are defined with respect to the PlacementTarget. Cuando el ToolTip es muestra, se elige un punto que maximiza la cantidad de la ToolTip ventana que está visible.When 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
Establecen las propiedades de metadatos en trueMetadata properties set to true NoneNone

Se aplica a

Consulte también: