List & lt; T & gt; and ObservableCollection & lt; T & gt;, observablecollection in WPF

Source: Internet
Author: User

List <T> and ObservableCollection <T> and observablecollection in WPF
When you bind a data source to a control in WPF, we recommend that you use the ObservableCollection <T> set for the data source.
ObservableCollection <T> class: indicates a dynamic data set. When an item is added, removed, or the entire list is refreshed, a notification is provided dynamically.
When the data source changes, the control content is also automatically modified. No need to rebind. List <T> is only the forced conversion result of an ObservableCollection <T>, and cannot dynamically provide notification of attribute change. The advantage of using ObservableCollection <T> as a data source is that the front-end code can be completely separated from the back-end code without having to know the control data source from the back-end. You can bind the front-end data source with your own bading. Use ObservableCollection <T> to import the namespace using System. Collections. ObjectModel;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.