Windows Phone 8 アプリに 3 つのピボット アイテムがあります。アプリケーション バー ボタンを選択しました。それを選択すると、現在の LongList コントロールに対して LongListSelector.IsSelectionEnabled を true に設定できます。しかし、他のピボット項目を非表示にしたいので、visiblity プロパティを使用しようとしましたが、機能しませんでした。カスタマイズされたヘッダーを試しているようです。私のピボット項目のコードは `
<!--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;
}
他のピボット項目を非表示にする方法を教えてください。