locked
How to make a Flyout box using C++?

    General discussion

  • Hi guys. I am having trouble in discovering how to make a flyout using C++. I found one WinRT object for flyout, but did just buttons if I pass UICommand objects.

    I need a flyout in my application with two textblock controls. How can I do this?

     

    Thank you.

    Wednesday, October 26, 2011 1:47 PM

All replies

  • The developer preview does not include a canned flyout control for Xaml, so you will need to implement your own.  A flyout is essentially just a UI element which shows up on demand and then goes away as soon as the user interacts with anything else ("light dismiss").

    To create such a thing, create a panel/user control/etc and animate it into visibility.  For the light dismiss effect you can listen to the PointerPressed event on your root visual and dismiss the "flyout".

    See Tim Heuer's Tips and tricks for developing Metro style apps using XAML session for more hints on light dismiss: http://channel9.msdn.com/Events/BUILD/BUILD2011/TOOL-515T

    --Rob

    Wednesday, October 26, 2011 4:51 PM
    Owner
  • Thank you. I will take a look on that session.

     

    What happens if the instead of clicking in the root grid, user clicks in other control. Will that work out the same way with the PointerPressed of the root grid? I mean, I have a GridView on my page. If the user opens my so-called flyout and it clicks on the GridView with it opened, will PointerPressed on the root grid be processed?

     

    Thank you.

     

    Wednesday, October 26, 2011 5:25 PM
  • Sorry.  I should have been more clear that handling PointerPressed is only a first approximation.  You'll need more complexity to make the dismissal bulletproof.

    It depends on the control.  If the control (a Button, for example) handles the PointerPressed event then the root won't receive it.  What else specifically you need to do will depend on the specific app.  Likely possibilities include (but aren't limited to) handling PointerPressed on the other controls as well (the FlyOut can enumerate and add the handler when it opens and remove it when it closes), watching for LostFocus on the FlyOut, etc.  Again, the best way will depend on the specific application layout.

    --Rob

    Thursday, October 27, 2011 4:00 PM
    Owner
  • Thank you for answering and I appreciate it very much, however the problem remains the same. The layout of my application requires a flyout exactly as any standart flyout.

    Does Micrososft has anything to say on this? Why does only JavaScript have a functional flyout?

    Is there a standart way of doing a standart flyout?

     

    Friday, October 28, 2011 5:58 PM
  • Hi Claudio,

    The developer preview does not contain a Xaml flyout control.  If you need flyout behavior in the developer preview you will need to implement it yourself.

    See http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/6793c93c-072d-4567-b490-812bc5e75c89 for more background.

    --Rob

    Friday, October 28, 2011 9:14 PM
    Owner