我想创建一个ListBox并用匿名填充它UIElement。换句话说,DataTemplate的ItemTemplate将只包含一个元素,并且在运行时后记,之后我将在不同UIElement的 s ( TextBlocks, Grids ...) 后面的代码中创建并用它填充列表。
那么我要怎么写DataTemplate呢ListBox?我打算如何ObservableCollection使用ItemSource?那么应该使用ObsevableCollectionofUIElement吗?