Search code examples
windows-phone-7listboxpivotswipepopulate

How to swipe pivot when Listbox is empty


I have a pivot page which have 3 pivot items. In the default pivot item is a ListBox.

I use ObservableCollection to populate this ListBox. When ListBox is populated, I can swipe the pivot.

However, when ObservableCollection has no item, which means ListBox is not populated, I cannot swipe pivot anymore

Someone asked exactly the same on msdn forum

How to fix this ?


Solution

  • Looking at the code from msdn question it looks like the Pivot is resized due to the VerticalAlignment value:

     <controls:Pivot Title="UTORRENT REMOTE" 
                     SelectionChanged="Pivot_SelectionChanged" 
                     Height="696" 
                     VerticalAlignment="Top"> 
    

    To get the behavior that you want remove the VerticalAlignment from the pivot:

     <controls:Pivot Title="UTORRENT REMOTE" 
                     SelectionChanged="Pivot_SelectionChanged" 
                     Height="696">