Keep popup within window bounds

前端 未结 2 1283
粉色の甜心
粉色の甜心 2021-01-14 23:06

I\'m trying to display a popup under a button.

This is what it looks like now :

\"enter

2条回答
  •  深忆病人
    2021-01-14 23:42

    I fixed it by setting the placement the custom:

     
    

    And in the constructor of my usercontrol in code behind I added

    OptionsMenuPopup.CustomPopupPlacementCallback += (Size popupSize, Size targetSize, Point offset) =>
                new[] { new CustomPopupPlacement() { Point = new Point(targetSize.Width - popupSize.Width, targetSize.Height) } }; 
    

提交回复
热议问题