public CustomPopupPlacement[] PlacePopup(Size popupSize, Size targetSize, Point offset)
{
Point popupLocation = new Point(targetSize.Width - popupSize.Width, targetSize.Height);
CustomPopupPlacement placement1 =
new CustomPopupPlacement(popupLocation, PopupPrimaryAxis.Vertical);
CustomPopupPlacement placement2 =
new CustomPopupPlacement(popupLocation, PopupPrimaryAxis.Horizontal);
CustomPopupPlacement[] ttplaces =
new CustomPopupPlacement[] { placement1, placement2 };
return ttplaces;
}