我的 windows phone 8 应用程序中有三个枢轴项目。我有选择应用程序栏按钮,当我选择它时,我正在为我当前的 LongList 控件启用 LongListSelector.IsSelectionEnabled 为 true。但我想隐藏其他枢轴项目,我尝试使用可见性属性但它不起作用,似乎我正在尝试自定义标题。我的枢轴项目代码是`
<!--Pivot item one-->
<phone:PivotItem x:Name="allPivotItem">
<phone:PivotItem.Header>
<TextBlock Text="{Binding Path=LocalizedResources.all, Source={StaticResource LocalizedStrings}}" Foreground="#FF81BD5E"></TextBlock>
</phone:PivotItem.Header>
<toolkit:LongListMultiSelector x:Name="allTaskLongList"
LayoutMode="List"
ItemTemplate="{StaticResource MyTaskItemTemplate}"
SelectionChanged="OnAllTaskSelectionChanged"
IsSelectionEnabledChanged="OnAllTaskIsSelectionEnabledChanged"
ItemInfoTemplate="{StaticResource MyTaskItemInfoTemplate}">
</toolkit:LongListMultiSelector>
</phone:PivotItem>
<phone:PivotItem>
<phone:PivotItem.Header>
<TextBlock Text="{Binding Path=LocalizedResources.assigned,Source={StaticResource LocalizedStrings}}" Foreground="#FF126EA2"></TextBlock>
</phone:PivotItem.Header>
<toolkit:LongListMultiSelector x:Name="assignedTaskLongList"
LayoutMode="List"
ItemTemplate="{StaticResource MyTaskItemTemplate}"
SelectionChanged="OnAllTaskSelectionChanged"
IsSelectionEnabledChanged="OnAllTaskIsSelectionEnabledChanged"
ItemInfoTemplate="{StaticResource MyTaskItemInfoTemplate}">
</toolkit:LongListMultiSelector>
</phone:PivotItem>
<phone:PivotItem>
<phone:PivotItem.Header>
<TextBlock Text="{Binding Path=LocalizedResources.overdue,Source={StaticResource LocalizedStrings}}"
Foreground="#FF825887"></TextBlock>
</phone:PivotItem.Header>
<toolkit:LongListMultiSelector x:Name="overdueTaskLongList"
LayoutMode="List"
ItemTemplate="{StaticResource MyTaskItemTemplate}"
SelectionChanged="OnAllTaskSelectionChanged"
IsSelectionEnabledChanged="OnAllTaskIsSelectionEnabledChanged"
ItemInfoTemplate="{StaticResource MyTaskItemInfoTemplate}">
</toolkit:LongListMultiSelector>
</phone:PivotItem>
</phone:Pivot>`
以及隐藏其他数据透视项目的代码
void OnSelect_Click(object sender, EventArgs e)
{
allTaskLongList.IsSelectionEnabled = true;
assignedTaskLongList.Visibility = System.Windows.Visibility.Collapsed;
overdueTaskLongList.Visibility = System.Windows.Visibility.Collapsed;
}
请建议我如何隐藏其他枢轴项目?