小编use*_*500的帖子

使用IsLocked属性禁用在数据透视表控件上滑动隐藏了数据透视表标题

我试图禁用数据透视控件上的滑动.环顾这里和谷歌,似乎使用IsLocked属性是要走的路.我得到的问题是,如果我在xaml中将属性设置为True,那么所有其他PivotItem标头都会消失.

现在我想我仍然可以使用它但是如果我然后将IsLocked设置为false,则更改PivotControl.SelectedIndex说1,等待LoadedPivotItem事件触发,然后再将IsLocked设置为true,标题再次消失.

这是代码.

注意:PagePivot是一个PivotControl

private void appbarNext_Click(object sender, System.EventArgs e)
{
    // Unlock the PivotControl
    PagePivot.IsLocked = false;

    // If we are at the first item then move to the next - (just testing everything out)
    if(PagePivot.SelectedIndex == 0)
    {
       PagePivot.SelectedIndex = 1;
    }            
} 

private void PagePivot_LoadedPivotItem(object sender, PivotItemEventArgs e)
{
    // Relock the PivotControl - this causes the headers to disappear again    
    PagePivot.IsLocked = …
Run Code Online (Sandbox Code Playgroud)

c# wpf xaml windows-phone-8

0
推荐指数
1
解决办法
3435
查看次数

标签 统计

c# ×1

windows-phone-8 ×1

wpf ×1

xaml ×1