简体   繁体   English

WPF中的控件是否与Visual Studio工具箱类似?

[英]Is there a control in WPF similar to the Visual Studio toolbox?

I'm writing an application using WPF, and I need to make something that looks like the Visual Studio toolbox (please see pic). 我正在使用WPF编写应用程序,我需要制作一些看起来像Visual Studio工具箱的东西(请参见图片)。 What control should I use for this? 我应该使用什么控制?

Visual Studio工具箱

I think you are looking for something like AvalonDock . 我想你正在寻找像AvalonDock这样的AvalonDock

替代文字

Use an expander control for the expandable headers. 对可扩展标头使用扩展器控件

The content of every expander can be a ListBox with a special ItemTemplate (with image an text). 每一个扩展的内容可以是一个特殊的ItemTemplate(带图像的文本)的列表框

http://wpf.codeplex.com/ has additional controls to help you. http://wpf.codeplex.com/有其他控件可以帮助您。

greetz, knom. greetz,knom。

You would use either a ListView or a TreeView. 您可以使用ListView或TreeView。 Both controls allow you to write templates for your items, the difference is that the TreeView is hierarchical. 这两个控件都允许您为项目编写模板,区别在于TreeView是分层的。 Which control you use depends on the structure of your data, but you will proabably use the TreeView. 您使用哪种控件取决于数据的结构,但您可以使用TreeView。

For your TreeView you will have to define two item templates, one for the root items and one for the child items. 对于TreeView,您必须定义两个项目模板,一个用于根项目,另一个用于子项目。 It should be quite easy, but it depends on your data of course. 它应该很简单,但它当然取决于您的数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM