private static bool CheckItemVisibility(ShellHeaderItemsVisibility visibility, ShellHeaderItemsVisibility itemToCheck)
 {
     return (itemToCheck & visibility) == itemToCheck;
 }
 void ApplyShellHeaderItemsVisibility(ShellHeaderItemsVisibility visibility)
 {
     // If all the items on shell header are invisible, the shell header
     // will be hiden automatically. 
     // 
     // Expand All/ Collapse All / Breadcrumb
     this.breadCrumbListBox.Visibility = CheckItemVisibility(visibility, ShellHeaderItemsVisibility.Breadcrumb) ? Visibility.Visible : Visibility.Collapsed;
     this.expandAllButton.Visibility = CheckItemVisibility(visibility, ShellHeaderItemsVisibility.ExpandAll) ? Visibility.Visible : Visibility.Collapsed;
     this.collapseAllButton.Visibility = CheckItemVisibility(visibility, ShellHeaderItemsVisibility.CollapseAll) ? Visibility.Visible : Visibility.Collapsed;
 }