开发者

How to realise detachable control in XAML & WPF

I want to have detachable controls in my software where a user can drag out a view (control) into a seperate window. Like the TabItems in Visual Studio 2010.

At this time the specific views are created whenever a menu point is clicked and a new DataType is requested. The views get displayed in a HeaderedContenControl which has a ContentPresenter as child element. My goal is to make it possible to click on the header of this control an drag it out to become a seper开发者_如何学运维ate window. In addition the seperate window should not be changed by clicking a new menu point, instead the new view should be generated in the mainwindow again. The TabControl with its TabItems seems to be a better control to realise this behavoir but the standard TabItem is a pretty basic thing without such abilities.

I searched the net for a solution but didn't find anything yet. I hope I can find help on this site.


This feature is usually part of various docking solutions. I personally recommend AvalonDock - it can do exactly what are you describing and is free (and open source).

If you want to write such feature yourself, you better get ready to write significant amount of code ;)


Another option would be the Infragistics Controls.

We have used it in a rather large project and were satisfied.

They are not free though.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜