Posts

Showing posts from October, 2022

UWP/WinUI 2 - How to increase the maximum size of a Flyout

The Flyout is a useful class in UWP/WinUI 2 that allows you to display content in a popup. The Flyout class contains various useful built in behaviour such as showing and hiding animations and functionality to for dismissing the popup when it looses focus. One of the built in behaviours of the Flyout, is that it contains a ScrollViewer and a maximum size. This means that, if the content inside the Flyout becomes too large for the Flyout, the content will become scrollable. In some situations, this behaviour can be helpful, however, in other situations, you may want the flyout to simply size itself to fit its content rather than cutting content off and forcing the user to scroll to see the cut off content. Luckily, there's an easy way to do this by modifying a Flyout's FlyoutPresenterStyle. How to change the maximum size of a Flyout To change the maximum size of a Flyout, simply modify its FlyoutPresenterStyle like so (You can of course replace MaxHeight and/or MaxWidth with a d