Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to hide (not remove) a PivotItem?

I have a situation where I am showing a set of PivotItems and (depending on the situation) a favorites one.

I need to be able to hide this pivot when the List containing my favorites is empty - yet it needs to show up when there is something there.

Now, I could just remove it, but what about this scenario:

  1. Go to the pivot view (no favorite-pivot, since the list is empty)
  2. Go to one of the remaining PivotItems and select an item.
  3. Select that item as a favorite in its own view
  4. Tap the back-button, and return to the pivot-view.

Now there will be no favorites-pivot, and that just isn't good enough.

I have tried to remove it with Visibility="hidden", but VS is complaining about the data context not being specified properly (it is.)

Any ideas?

like image 711
Kris Selbekk Avatar asked Jul 24 '12 10:07

Kris Selbekk


1 Answers

Why don't add and remove the PivotItem dynamically in your code in response to user events? The user adds a favorite -> create and add the Pivot item. The user removes his last favorite item -> remove the Pivot item.

like image 169
Wolfgang Ziegler Avatar answered Nov 08 '22 16:11

Wolfgang Ziegler