Winrt-根据弹出位置调整弹出 [英] Winrt - Adjusting flyout according to where it appears

查看:100
本文介绍了Winrt-根据弹出位置调整弹出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows Store项目中有一个GridView,其中包含一些大方块,并且在其中有一个用户图像列表,当我点击这些图像时,在右侧显示一个弹出按钮,显示一些类似这样的信息

I have a GridView in a windows store project, that contains some big squares, and inside those i have a list of user images, when i tap on of those images a flyout appears on the right showing some information like this.

问题是我的gridview扩展到了屏幕的边缘并超出了屏幕边缘,当我遇到这种情况时,我以红色边框靠近屏幕边缘的方式按下用户,弹出按钮出现在左侧.

the problem is that my gridview extends to the edges of the screen and beyond, and when that does i get this situation, i press the user with the red border near the edge of the screen and flyout appears on left.

我的弹出菜单设置为右",我猜测是因为我按下的元素在边缘附近,所以根据左">上">下".

My flyout placement is set to Right, and im guessing since the element i press is near the edge it follows the Fall back order with according to this is Right > Left > Top > Bottom.

我想知道如何检测到这种情况,因此我可以调整弹出位置,或其他可行的选择:)

What i would like to know is how to detect this happens, so i can adjust my flyout position, or another viable alternative :)

推荐答案

在Flyout和FlyoutBase上搜索属性和Dependency属性后,我还没有找到一种简单的方法来获取Flyout的实际位置(这很不幸,因为我认为这很重要,正如我们在您的案例中看到的那样.也许您可以通过实现一种比较所需内容的方法,尝试此处提出的建议弹出广告的大小以及可用空间.

After searching through properties and Dependency properties on Flyout and FlyoutBase, I haven't found a way to simply get the actual placement of the Flyout (which is unfortunate because I think that can be important, as we see in your case). Perhaps you can try what was proposed here by implementing a method that compares the desired size of the Flyout with the available space.

这篇关于Winrt-根据弹出位置调整弹出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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