In WPF, The listview control is bound to the union of multiple data sources.

Source: Internet
Author: User

The data binding function in WPF is very powerful, allowing you to display and edit data in a very intuitive way, but there are still some places that are easy to confuse, for example, bind the listview control to the union of multiple data sources.

 

For example, in your window, three listview controls A, B, C, A, and B are respectively bound to the Integer Set collectiona and the collection collectionb, then you want to bind C to the Union set of collectiona and collectionb. At this time, you obviously do not want to create a new collection collectionc to save the Union set of A and B, this is because if you write code like this, the changes made by the user on collectiona on the control cannot be reflected in C in real time.

 

The WPF team has come up with this situation. Therefore, they provide collectioniner iner to bind controls to the union of multiple data sources. For example, the following code

 

XAMLCode:

<ListBox X: Name = "listbox1"/>

<ListBox x

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.