locked
Popup in XAML

    Question

  • Hello

    I need help with position popup control in Windows Store app. I want use popup like flyout so I want set position of popup up to appbar.


    sample
    Wednesday, March 20, 2013 6:29 PM

Answers

  • I find solution.

    Flyout.VerticalOffset =

    Window.Current.Bounds.Height - 220; //220 is size of popup window + space between popup Windows and app bar

    • Marked as answer by Matěj Hireš Thursday, March 21, 2013 2:52 PM
    Thursday, March 21, 2013 2:52 PM

All replies

  • Hi,

    Which language do you use, XAML+C#/VB or HTML+Javascript?

    Best regards,


    Min Zhu
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, March 21, 2013 4:48 AM
    Moderator
  • Try something like this:

       GeneralTransform t = MyButton.TransformToVisual(null);
       Point p = t.TransformPoint(new Point());

    That will give you the top-left corner of your AppBar button, and then you can use the size of the PopUp to calculate the HorizontalOffset and VerticalOffset properties.


    Rebecca M. Riordan

    • Proposed as answer by maeneak Thursday, May 30, 2013 11:52 AM
    Thursday, March 21, 2013 2:22 PM
  • I find solution.

    Flyout.VerticalOffset =

    Window.Current.Bounds.Height - 220; //220 is size of popup window + space between popup Windows and app bar

    • Marked as answer by Matěj Hireš Thursday, March 21, 2013 2:52 PM
    Thursday, March 21, 2013 2:52 PM