具有 Windows 功能的画布
我正在开发的应用程序有一个主要的自定义 WPF 窗口。
在画布中绘制的主窗口(绘图)内有一个控件。现在的问题是,我想对此画布实现类似窗口的方法(标题栏+关闭按钮+在主窗口内移动+调整其大小)。我应该如何处理这个问题?
问题是,如果我将控件设计为单独的窗口,它将不会与我的应用程序关联(在 UI 意义上)。
我的想法是在画布中绘制标题栏并使用 Windows 标题栏功能来模仿它。但不知道有没有更好的办法。
The application that I'm working on, has a main customized WPF window.
There is a control that lies inside this main window (a plotting graph) that is drawn in a canvas. Now the problem is, I want to implement a window like approach to this canvas ( a titlebar + Close button + moving inside the main window + resizing it). How should I approach this?
Problem is, if I design the control as a separate window, it won't be associated with my application (in a UI sense).
What i think is drawing a titlebar in the canvas and mimicing it with the windows titlebar functionality. But i don't know whether there is any better approach.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来您想做的是编写一个传统的 MDI 应用程序(“多文档接口") 使用 WPF:
这种应用程序设计风格如今并不像以前那样常见在 Windows 窗体时代。支持和反对的论点都有很多,但如果您确定这就是您想要的,那么 codeplex 上有一个 WPF 库可以处理此问题:
在 UX stackexchange 上也有关于 MDI 布局的替代方案,您可能会感兴趣。
What it sounds like you want to do is to write a traditional MDI application ("Multiple Document Interface") using WPF:
This style of application design is not that common today as it used to be back in the Windows Forms days. There are many arguments both for and against it but if you are certain this is what you want, then there is a WPF library on codeplex that handles this:
There is also a discussion over at the UX stackexchange about alternatives to MDI layout which you may find interesting.