C# 在Windows Phone 8中选择其他透视项目时隐藏其他透视项目标题
我的windows phone 8应用程序中有三个pivot项目。 我有选择应用程序栏按钮,当我选择它时,我正在为我当前的长列表控件启用LongListSelector.IsSelectionEnabled为true。但我想隐藏其他透视项,我尝试使用visiblity属性,但它不起作用,似乎我正在尝试自定义标题。 我的透视项目代码是`C# 在Windows Phone 8中选择其他透视项目时隐藏其他透视项目标题,c#,xaml,windows-phone-8,C#,Xaml,Windows Phone 8,我的windows phone 8应用程序中有三个pivot项目。 我有选择应用程序栏按钮,当我选择它时,我正在为我当前的长列表控件启用LongListSelector.IsSelectionEnabled为true。但我想隐藏其他透视项,我尝试使用visiblity属性,但它不起作用,似乎我正在尝试自定义标题。 我的透视项目代码是` <!--Pivot item one--> <phone:PivotItem x:Name="allPivotI
<!--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>`
请建议如何隐藏其他透视项目?也有同样的问题。。。“轴可见性”设置为“折叠”似乎不足以“隐藏”它们 我提出的唯一解决方案是循环遍历枢轴项目,并“删除”每个可见性设置为“折叠”的项目
您可以在我的代码中看到这一点:>方法
更改数据透视项在编辑模式下将数据透视控件.IsLocked
设置为true。用户将能够查看当前默认透视项目/与之交互,编辑完成后将其设置为false
void OnSelect_Click(object sender, EventArgs e)
{
allTaskLongList.IsSelectionEnabled = true;
assignedTaskLongList.Visibility = System.Windows.Visibility.Collapsed;
overdueTaskLongList.Visibility = System.Windows.Visibility.Collapsed;
}