数据透视中的弹出窗口 [英] Popups in Pivot

查看:81
本文介绍了数据透视中的弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含三个项目的数据透视"布局.一个保存今天的新闻,第二个保存一周的新闻,第三个可以按日期搜索.如果今天没有新闻,我会通过弹出窗口显示一条消息.我使用一个弹出窗口,因为我可以将其放在datatemplate列表上. 问题是,如果我在今天新闻的枢纽项目中显示弹出窗口,则该弹出窗口会显示在所有其他枢纽项目中,但是代码仅在第一个枢轴项目中!

I have a Pivot layout with three items. One holds news for today, the second shows news for the week and in the third one you can search by date. If there aren't news for today yet, I show a message through a popup. I use a popup because I can put it over the datatemplate list. The problem is that if I show the popup in the pivotitem for today news, it is shown in all other pivot items, but in code is inside the first pivot item only!

我该如何解决?您会建议我使用不同于弹出窗口的内容吗?更改枢轴项时,我可以隐藏弹出窗口,但我希望消息在没有新闻的项中保持可见.

How can I solve this? Would you recommend me to use something different than a popup? I could hide the popup when pivot item is changed, but I want the message to remain visible in the item that has no news.

谢谢!

推荐答案

Popup控件在性能和旋转方面存在一些已知问题.我的建议是使用Grid元素,并在需要时切换其可见性.为了使此覆盖图显示在整个透视图的顶部(而不仅仅是当前项目的内容),您需要将其放置在与透视图相同的可视树中,然后在XAML中声明以确保它出现在上面.除此之外,这只是根据您的逻辑和所选的枢纽项目显示/隐藏它的情况.

There are known issues with regards to performance and rotation with the Popup control. My suggestion would be to use a Grid element and toggle it's visibility as and when required. For this overlay to be shown on top of the whole pivot (and not just the current item contents) you will need to put it at the same level in the visual tree as the pivot, and declared afterwards in the XAML to ensure that it appears on top. Other than that, it's just a case of showing/hiding it based on your logic and the selected pivot item.

这篇关于数据透视中的弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆