您将如何为WPF设计停靠库?

时间:2021-05-04 12:56:23

I want to implement a docking library in wpf with behavior similar to Adobe Photoshops CS3.

我想在wpf中实现一个与Adobe Photoshops CS3类似的行为的停靠库。

You can attach floating Panels to other Panels or Docks by mouse dragging. Docks have a fixed location.

您可以通过鼠标拖动将浮动面板附加到其他面板或码头。码头有固定的位置。

Would you use a central Docking Manager class? How would the message flow look like? I was thinking of using 2 interfaces, called IDock and IDockable, with the panel implementing both, and a dock implementing only IDock.

你会使用*Docking Manager课程吗?消息流如何?我正在考虑使用2个接口,称为IDock和IDockable,实现两者的面板,以及仅实现IDock的dock。

I'm looking for some specific design patterns or OO principles that could help me here, so that the overall design is sound. I know that I'm not really specific here, but that's because I don't know where to start.

我正在寻找一些可以帮助我的特定设计模式或OO原则,以便整体设计合理。我知道我在这里并不是特别的,但那是因为我不知道从哪里开始。

Example of a Panel to Panel movement:

面板到面板移动的示例:

alt text http://dl.getdropbox.com/u/133877/Misc/*/wpf_dock_01.png

alt text http://dl.getdropbox.com/u/133877/Misc/*/wpf_dock_01.png

alt text http://dl.getdropbox.com/u/133877/Misc/*/wpf_dock_02.png

alt text http://dl.getdropbox.com/u/133877/Misc/*/wpf_dock_02.png

1 个解决方案

#1


1  

Maybe you could start studying http://www.codeplex.com/AvalonDock which is a wpf docking library. There is probably something to learn from it.

也许你可以开始学习http://www.codeplex.com/AvalonDock这是一个wpf对接库。可能有一些东西需要学习。

#1


1  

Maybe you could start studying http://www.codeplex.com/AvalonDock which is a wpf docking library. There is probably something to learn from it.

也许你可以开始学习http://www.codeplex.com/AvalonDock这是一个wpf对接库。可能有一些东西需要学习。