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 |