Read original post at Loek van den Ouweland's Blog
Have you ever had to create a popup that positions itself near a clicked button? Yes? Then you know how easy it is to create that popup. And how hard it is to get it right! You probably created a transparent background layer that covered your UI and responds to clicks “outside” your popup. And just when you thought you were finished, the popup was cut-off at the left of your screen because the initiating button was too close to the edge…
In short…it takes some time to get it right. In Windows 8.1 there is a new Flyout control that will take care of the hard work for you. And while the documentation is great, Microsoft forgot to show how cool it works if you position Flyouts close to the edge of the screen.