Popup.CustomPopupPlacementCallback Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets or sets a delegate handler method that positions the Popup control.

Namespace:   System.Windows.Controls.Primitives
Assembly:  PresentationFramework (in PresentationFramework.dll)

[BindableAttribute(false)]
public CustomPopupPlacementCallback CustomPopupPlacementCallback { get; set; }

Property Value

Type: System.Windows.Controls.Primitives.CustomPopupPlacementCallback

The CustomPopupPlacementCallback delegate method that provides placement information for the Popup control. The default is null.

Identifier field

CustomPopupPlacementCallbackProperty

Metadata properties set to true

None

The following example shows how to set a CustomPopupPlacementCallback delegate.

popup1.CustomPopupPlacementCallback =
    new CustomPopupPlacementCallback(placePopup);
public CustomPopupPlacement[] placePopup(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;
}

.NET Framework
Available since 3.0
Return to top
Show: