wpf停靠_WPF停靠Windows管理库

本文介绍了一个自定义的WPF停靠窗口管理库,旨在模仿Microsoft Visual Studio的外观并允许轻松自定义。该库支持文档和工具的停靠,允许布局序列化,且完全符合MVVM模式。文章详细讨论了库的设计目标、关键功能、可自定义内容以及示例应用程序的展示,旨在帮助开发者理解和使用这个库。
摘要由CSDN通过智能技术生成

wpf停靠

介绍 (Introduction)

Some years ago, I created a commercial application with a large number of documents windows and tool windows. I wanted the user to be able to arrange the windows in the most convenient manner for them as per Microsoft Visual Studio. I chose to build the application around the free version of AvalonDock. I chose AvalonDock because it was free and it had a good reputation. I learnt that it is indeed a very good control, with an extremely powerful and flexible UI. I also learnt that it can be very hard to customise as it is a complex piece of software. I had requests from users to add or change features, and quite often, I was unable to figure out a way to make these changes. The most common request was to improve the tab control when multiple tools were docked together in a group. We had so many tool panes that it could be very hard to figure out which tab was which. We also had requests to add a close button to each tabbed tool or document pane. I found some solutions online, but quite often I couldn't get them to work. It is possible that the solutions were for an earlier version of AvalonDock.

几年前,我创建了一个带有大量文档窗口和工具窗口的商业应用程序。 我希望用户能够按照Microsoft Visual Studio以最方便的方式为他们安排窗口。 我选择围绕免费版本的AvalonDock构建应用程序。 我选择AvalonDock是因为它是免费的,并且享有很高的声誉。 我了解到,它确实是一个非常好的控件,具有极其强大且灵活的UI。 我还了解到,由于它是一个复杂的软件,因此很难自定义。 我收到用户的添加或更改功能的请求,但很多时候,我无法找到进行这些更改的方法。 最常见的要求是在将多个工具组合在一起时改进标签的控制。 我们有太多的工具窗格,以至于很难确定哪个选项卡是哪个。 我们还要求向每个选项卡式工具或文档窗格添加一个关闭按钮。 我在网上找到了一些解决方案,但很多时候我无法使它们起作用。 解决方案可能是针对较早版本的AvalonDock的。

Recently, I have had some spare time available, and I decided to create my own docking window manager library with the following key design goals:

最近,我有一些空闲时间,我决定创建具有以下主要设计目标的自己的停靠窗口管理器库:

  1. It should allow the creation of applications with the look and feel of class leading applications such as Microsoft Visual Studio.

    它应允许创建具有类领先应用程序(如Microsoft Visual Studio)外观的应用程序。
  2. It should allow the developer to easily customise the appearance using themes.

    它应该允许开发人员使用主题轻松自定义外观。
  3. The code should be reasonably simple so that a developer can modify it to suit their own needs if the built in behaviour is inadequate.

    该代码应该相当简单,以便在内置行为不足的情况下,开发人员可以对其进行修改以满足自己的需求。
  4. It should be fully compliant with the MVVM pattern.

    它应该完全符合MVVM模式。
  5. It should allow the layout to be serialised to and from a file.

    它应该允许布局在文件之间进行序列化。

Key features of the docking window control are as follows:

停靠窗口控件的主要功能如下:

  1. Support for documents and tools.

    支持文档和工具。
  2. Documents represent editable content such as a text document, or the output from a calculation such as a 3D surface plot.

    文档代表可编辑的内容(例如文本文档),或来自计算的输出(例如3D表面图)。
  3. Tools represent a collection of controls that in some way influence the content of documents, e.g., settings for a 3D surface plot.

    工具代表控件的集合,这些控件以某种方式影响文档的内容,例如3D表面图的设置。
  4. Documents can be laid out in a tiled pattern. Two or more documents can be grouped together into a tabbed group. The documents occupy a rectangular region (the document area).

    可以以平铺模式布置文档。 可以将两个或更多文档分组为一个选项卡式组。 文件占据一个矩形区域(文件区域)。
  5. Tools can be laid out in a tiled pattern. Two or more tools can be grouped together into a tabbed group. The tools occupy the regions on either side of the document area.

    可以以平铺模式布置工具。 可以将两个或更多工具组合到一个选项卡式组中。 这些工具占据了文档区域两侧的区域。
  6. A tool can be unpinned, such that the pane is removed from the tiled area, and replaced with a title bar in the margin.

    可以取消固定工具,以便将窗格从平铺区域中删除,并在边距中替换为标题栏。
  7. Clicking on the title bar of an unpinned tool shows the previously hidden content. Clicking outside of the content hides it again.

    单击未固定工具的标题栏将显示以前隐藏的内容。 在内容之外单击将其再次隐藏。
  8. An unpinned tool can be re-pinned by clicking on the pin button in its header.

    可以通过单击标题中的固定按钮来重新固定未固定的工具。
  9. Both documents and tools can be floated. They can be floated individually or as a tabbed group.

    文档和工具都可以浮动。 它们可以单独浮动或作为选项卡组浮动。
  10. The tools or documents in a tabbed group can be reordered by dragging each tab header.

    可以通过拖动每个选项卡标题对选项卡式组中的工具或文档进行重新排序。
  11. A tabbed group has a drop down menu item with a list of all documents/tools, allowing the user to quickly select the desired content.

    一个选项卡式的组具有一个下拉菜单项,其中包含所有文档/工具的列表,从而使用户可以快速选择所需的内容。
  12. A tool and a document can be closed by clicking on a close button in the tab header. This will prompt the user to save unsaved data, discard unsaved data, or cancel the operation, assuming there is unsaved data.

    单击选项卡标题中的关闭按钮可以关闭工具和文档。 如果存在未保存的数据,这将提示用户保存未保存的数据,丢弃未保存的数据或取消操作。
  13. The control maintains a documents view model list and a tools vi
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值