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

Listbox SelectedItem in MVVM

$
0
0

I'm trying to get my head wrapped around MVVM and have just run into a wall.  I have a ListBox with ItemsSource bound to a property on my viewmodel.  I need to have my viewmodel notified when the user selects an item in that listbox.  I've seen people posting SelectedItem="{Binding PropertyName, Mode=TwoWay}". 

Not sure what I'm doing wrong, but can anyone point me to an example of how something like this is accomplished within MVVM?

Thanks,
David


Viewing all articles
Browse latest Browse all 18858

Trending Articles



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