WPF 弹出式替代方案 [英] WPF Popup Alternative

查看:33
本文介绍了WPF 弹出式替代方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有弹出窗口的窗口,当双击列表视图中的项目时会弹出该窗口.
它以主窗口为中心,漂浮在那里看起来非常漂亮.
问题是当用户移动主窗口或选择另一个程序时,弹出窗口浮动在其他内容之上.

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(包括窗口).

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 弹出式替代方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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