Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

MVVM bind listbox and link second listbox if the first listbox is changed

$
0
0

Hello,

I am encountering a problem when binding value to WPF ListBox control by using MVVM.

I have three ListBoxes, first ListBox should be filled when window initialized. 

second ListBox should be changed when the first ListBox value (selected items) is changed.

the behavior of third ListBox is the same like the second one.

So, my question is:

how to achieve the above requirement?

I researched many resources but it looks they need to implement ICommand, etc. But, in my case, it looks this part is sealed, so I don't care this implementation and just for setting in Model and ViewModel and then, bind the fields onto View.

My model is very simple, just three fields such as:

ID

Type

Location

So, first ListBox need to be bind with ID and second for Type and the last one for Location.

Thanks,


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>