Removing FlipView items with Visibility: Collapsed RRS feed

  • Question

  • Hello,

    Not sure if this is the right forum for this question. I am facing the following problem:

    In my page I have a flipview with three items. The items are not added programmatically. I have already designed them in the UI so when the user flips through the items I am filling them with data from my ViewModel. The problem is that that the third item may be or may not be visible based on some business logic so I have a binding on its Visibility.

    But the flipview seems not to care if an item is visible or not, so the user can still navigate to that item thought the flipview's controls. I went in the code behind and on the loaded event of the flipview I iterate through the items and check their visibility. If it is collapsed I remove the item from the collection.

    While this works I wanted to know if there is another more "elegant" (xaml in preference) way for the flipview to skip collapsed items.

    Thank you

    Saturday, May 4, 2013 12:54 PM


  • What's interesting about this is that a flipview item is going to occupy a place in the visual tree regardless of it's visibility.  I don't think that there's going to be a better way to make the flipview not display the item.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    • Marked as answer by Aaron Xue Thursday, May 9, 2013 8:05 AM
    Monday, May 6, 2013 1:54 PM