locked
Make flyout for button conditional? RRS feed

  • Question

  • I have a button on my WinRT form that shows a flyout.  However, when the button is pressed I don't want to show the flyout if the data source that is data bound to the ListView on the flyout is empty.  How can I completely suppress the flyout if that data source is empty?  

    -- roschler

    Friday, February 7, 2014 11:18 AM

Answers

  • Hi,

    You can judge the data source whether empty in Flyout.Opened event. And if the data source is empty, you can use Flyout.Hide method to make the flyout do not open:

      private void Flyout_Opened(object sender, object e)
            {
                if ("juge the data source whether empty")
                {
                    flyout.Hide();
    
                }
            }
    Best Wishes!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to &quot;Mark as Answer&quot; the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Proposed as answer by Anne Jing Thursday, February 27, 2014 9:06 AM
    • Marked as answer by Anne Jing Thursday, February 27, 2014 9:06 AM
    Monday, February 10, 2014 2:11 AM