自定义WPF窗口|码头功能 [英] Customized WPF-Window | Dock Function
问题描述
您好,
$ b $我的自定义WPF窗口存在一些问题。
我想要一个没有任何边框的窗口,所以我设置ResizeMode =NoResize和WindowStyle =None。这对我来说很好,但现在我缺少一些功能。特别是,如果我将它放在屏幕的左侧或右侧,重要的是取回窗口的Dock功能。如果我将窗口放在屏幕的上边缘,我也错过了最大化功能。
我知道,我可以重新编程这种行为(我已经这样做了),但我希望原始过程带有动画(透明矩形):)
有什么建议吗?
编辑1:
http:// www .youtube.com / watch?v = hLJThaqoTFg
嗯,我希望我的窗口完全如小视频中所见(带有小透明动画),如果你把它放在左边,右边或者屏幕上方。目前没有任何反应:(
谢谢和来自德国的Greetz
Hello,
i´ve some problems with my customized WPF-Window.
I want a window without any border, so i set the ResizeMode="NoResize" and WindowStyle="None". This works fine for me, but now i´m missing some features. Especially, its very important to get back the "Dock"-Function of the window, if I drop it on the left or right side of the screen. Also i missing the "Maximize"-function if I drop the window on the top edge of screen.
I know, that i could reprogram that behaviour (i´ve already done this), but i want the original process with its animation (the transparency rectangle) :)
Are there any suggestions?
EDIT 1 :
http://www.youtube.com/watch?v=hLJThaqoTFg
Well, I want that my window behaves exactly as seen in the little video (with the little, transparency animation), if you put it on the left, right or top of the screen. Currently nothing happens :(
Thanks and Greetz from Germany
推荐答案
当您通过设置自定义窗口样式(混合或手动)删除默认的chrome时,默认行为(如拖动,aero peek和其他内容)将丢失(标题,标题按钮等)。
在这种情况下,您应该自定义chrome,而不是创建自定义窗口样式。有一篇很好的CP文章,关于如何做到这一点
WPF自定义Chrome库
问候,
Amitosh
When you remove the default "chrome" by setting a custom window style (in blend or manually), the default behaviour such as dragging ,aero peek,and other stuff is lost (title, caption buttons etc..)
In this case, rather than creating a custom window style you should customize the "chrome". There''s a nice CP article on how to do that
WPF Custom Chrome Library
Regards,
Amitosh
这篇关于自定义WPF窗口|码头功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!