ToolTip.CustomPopupPlacementCallback Egenskap
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Hämtar eller anger den ombudshanterarmetod som ska användas för att placera 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; }
[<System.ComponentModel.Bindable(false)>]
member this.CustomPopupPlacementCallback : System.Windows.Controls.Primitives.CustomPopupPlacementCallback with get, set
Public Property CustomPopupPlacementCallback As CustomPopupPlacementCallback
Egenskapsvärde
Den CustomPopupPlacementCallback ombudsmetod som tillhandahåller placeringsinformation för ToolTip. Standardvärdet är null.
- Attribut
Exempel
I följande exempel visas hur du anger CustomPopupPlacementCallback egenskapen och skapar motsvarande ombud. Samma teknik används för Popup, som visas i 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
Kommentarer
Egenskapen Placement måste anges till för att Custom återanropsdelegaten ska användas.
Ombudet CustomPopupPlacementCallback returnerar en matris med möjliga punkter som definieras med avseende på PlacementTarget. ToolTip När visas väljs en punkt som maximerar mängden av fönstret ToolTip som är synligt.
Information om beroendeegenskap
| Objekt | Value |
|---|---|
| Identifierarfält | CustomPopupPlacementCallbackProperty |
Metadataegenskaper inställda på true |
Ingen |