问题描述
我有一个带有弹出窗口的窗口,当双击列表视图中的项目时会弹出该窗口.
它居中于主窗口,并且漂浮在其中看起来非常好.
问题是当用户移动主窗口或选择另一个程序,并且弹出窗口浮在其他内容之上时.
I have a window with a popup that pops when an item in a listview is double clicked.
It centers to the main window and looks really nice floating there.
The problem is when the user moves the main window or selects another program, and the popup floats on top of other stuff.
我希望有一个类似弹出窗口的东西,这意味着它会漂浮在窗口中其他元素的顶部,但是当它移动(停留居中)时会紧贴主窗口,而不会漂浮在其他程序的顶部.
我可以像这样弹出窗口吗,还是有更好的方法呢?
I would like to have something like a popup, meaning that it floats on top of other elements in the window, but sticks with the main window when it moves (stays centered), and doesn't float on top of other programs.
Can I make a popup act like this, or is there a better way to do it?
推荐答案
代理在这种情况下比弹出窗口更适合您的需求.装饰品也可以漂浮在您的窗户上方.有一些区别,主要是装饰器绑定到UIElement(包括Windows).
It's possible that an Adorner will fit your needs in this case better than a popup. Adorners can float above your window, too. There are a few differences, mainly that an adorner is bound to a UIElement (which include windows).
这篇关于WPF弹出式替代的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!