I assume that you would have a favorites list in this pivot element, so my approach would be to bind the visibility of the pivot table item to the isEmpty property of the list.
For example, the view will be
<PivotItem Visibility="{Binding IsNotEmpty, Converter={StaticResource VisibilityConverter}}"/>
and in viewmodel
ICollectionView ItemsSource; ... public bool IsNotEmpty(){ return !ItemsSource.IsEmpty; }
and finally the converter
public class BooleanToVisibilityConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if(value == null) return Visibility.Collapsed; var isVisible = (bool)value; return isVisible ? Visibility.Visible : Visibility.Collapsed; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { var visiblity = (Visibility)value; return visiblity == Visibility.Visible; }}
Converter derived from Useful Converters
Berni source share