locked
Placement target needs to be in the visual tree RRS feed

  • Question

  • I'm trying to add a Flyout that's attached, via a style, to my screen's back button.  Seems like it should be simple and straightforward.  But so long the button's Flyout property is non-null and I click the Back button to return to the previous page, a "Placement target needs to be in the visual tree" exception is thrown.

    Is this a known bug?  Any workarounds?

    Friday, April 3, 2015 1:06 AM

Answers

  • No sooner did I ask for a workaround then did I find out one myself.  I am so happy that I'm doing a celebratory dance right now.

    What's the workaround, you ask?  It's simple.  Rather than using the Button.Flyout property in the setter, use FlyoutBase.AttachedFlyout.

    That's awesome that I found a workaround so quickly.  High five everyone!

    • Proposed as answer by dns jinung Thursday, April 9, 2015 8:18 AM
    • Marked as answer by Happy Nomad Thursday, April 9, 2015 1:47 PM
    Friday, April 3, 2015 1:14 AM

All replies

  • No sooner did I ask for a workaround then did I find out one myself.  I am so happy that I'm doing a celebratory dance right now.

    What's the workaround, you ask?  It's simple.  Rather than using the Button.Flyout property in the setter, use FlyoutBase.AttachedFlyout.

    That's awesome that I found a workaround so quickly.  High five everyone!

    • Proposed as answer by dns jinung Thursday, April 9, 2015 8:18 AM
    • Marked as answer by Happy Nomad Thursday, April 9, 2015 1:47 PM
    Friday, April 3, 2015 1:14 AM
  • Glad to know.
    Thursday, April 9, 2015 8:19 AM
  • Moving this to "Off Topic" is rather weird since it's about a framework bug in Windows Store apps, and it was in the corresponding forum.  Seems like moving it is a disservice to the next person who encounters the same framework bug.  If you just kept it where it was, then they could realize the fix quicker than I did.
    Saturday, April 11, 2015 2:48 AM