I need to make a ControlsCollection in WPF. In Wondow Forms we have 'this.ControlsCollection' and I want the same thing in WPF application. I have a window with grids,stack pane开发者_如何转开发ls,buttons,........ And I want to make a collection of all these controls, can anyone tell me how can i do it please...?
WPF controls usually use UIElementCollection
, but for your own controls you can use any collection that implements IList
. If you want a generic collection, ObservableCollection<T>
works just fine.
精彩评论