简体   繁体   中英

Dynamic control creation in WPF

I'm working on a project where I have some hierarchical data that I want to be able edit through a fancy WPF control.

The data structure is essentially an expression tree. Each node can be a different Expression type but inheriting from the same base class. These different types need to have their own way of editing them.

My thoughts are that I would use the WPF TreeView control and then dynamically add editor controls for each type of Expression. I have only a basic understanding of WPF's data binding and the MVVM pattern so I'm not sure if this is possible to do or even where to begin. Any pointers or guidance would be greatly appreciated.

听起来您正在寻找的是HierarchicalDataTemplate类

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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