如何在WP7中隐藏/取消隐藏枢纽项目

编程入门 行业动态 更新时间:2024-10-23 20:29:44
本文介绍了如何在WP7中隐藏/取消隐藏枢纽项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个包含4个枢轴项目的应用程序.在枢轴项目2中进行特定选择时,我将不得不隐藏枢轴项目3.在枢纽项目4中做出另一个选择时,我将不得不取消隐藏枢纽项目3,但其位置应在item2与 仅限item4.

I have an application with 4 pivot items. On making a particular selection in pivot item2, i will have to hide the pivot item3. On making another selection in pivot item4, i will have to unhide the pivot item3, but its position should be between item2 and item4 only.

我尝试添加和删除,但我只能在末尾而不是在item2和item4之间添加数据透视项.

I tried adding and removing but i was only able to add the pivot item at the end and not in between item2 and item4.

我的问题有解决方案吗?

Is there any solution for my problem?

推荐答案

这两个按钮单击处理程序将在索引处插入/删除PivotItem. = 1;

These two button click handlers will do insert/remove PivotItem at index = 1;

但是我认为这不是最好的主意.

But I think this is not the best idea to do it.

private PivotItem savedPivotItem = null; private void RemoveSecondPivotItem_Click(object sender, RoutedEventArgs e) { savedPivotItem = MainPivot.Items[1] as PivotItem; MainPivot.Items.RemoveAt(1); } private void AddSecondPivotItem_Click(object sender, RoutedEventArgs e) { if (savedPivotItem != null) { MainPivot.Items.Insert(1, savedPivotItem); } }

此致.

更多推荐

如何在WP7中隐藏/取消隐藏枢纽项目

本文发布于:2023-11-02 08:15:11,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1551857.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:枢纽   项目   如何在

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!