Adjust Flyout position when it has been automatically repositioned

Viewed 1206

See a demo here

See a demo here.

I have a UWP app that has a ListView with selectable list items as shown. Selecting the right side of the item opens a Flyout (not a MenuFlyout). I specify the Placement of the Flyout to be Bottom, and a Margin of 0, -4, 0, 0 in the FlyoutPresenter Style. This results in the desired appearance, with the Flyout directly below and adjacent to the item.

However, if there isn't enough room to display the Flyout, it will be automatically moved to a Placement of Top. Even if I define the margin of the FlyoutPresenter Style to have -4 bottom margin, it doesn't appear to be applied.

Is there a way to move the Flyout? I'd prefer not to use a MenuFlyout if possible, since nothing is meant to be selectable. Flyouts don't have a Canvas attached property, and updating the Canvas.Top position of the top-most child of the Flyout didn't work (and I didn't really expect it to).

Edit: The desired behavior is for the Flyout to appear in the Top Placement, as is happening, but without the space in between the Flyout and the Target.

1 Answers
Related