![]() This column is about what you can do to combat those performance issues. If you need to display lots of data, you might discover that the ItemsControl and DataTemplate don't scale well. The disappointment might come a little later. If the items in the collection implement some kind of property-change notification (most often by implementing the INotifyPropert圜hanged interface), the Items-Control can dynamically respond to changes in the items. The DataTemplate consists mostly of a visual tree of one or more elements, with data bindings that link the items in the collection with properties of these elements. The DataTemplate defines how each item in the collection is displayed. This epiphany is usually accompanied by the realization, "Hey, I can use a DataTemplate to create a bar chart or a scatter plot with virtually no coding."Ī DataTemplate is most commonly created in conjunction with an ItemsControl or a class that derives from ItemsControl, which includes ListBox, ComboBox, Menu, TreeView, ToolBar, StatusBar-in short, all the controls that maintain a collection of items. There comes a time in the life of every Windows Presentation Foundation (WPF) programmer when the true power of the DataTemplate suddenly becomes evident. Volume 24 Number 03 Foundations - Writing More Efficient ItemsControls ![]()
0 Comments
Leave a Reply. |