MVVM: Binding to ListBox.SelectedItem?

前端 未结 1 1616
既然无缘
既然无缘 2020-12-14 00:36

How do I bind a view model property to the ListBox.SelectedItem property?

I have created a simple MVVM demo to try to figure this one out. My view model has these pr

相关标签:
1条回答
  • 2020-12-14 00:56

    Well, there it is, big as life. In the XAML. I am binding to a view model property "Selectedtem". Unfortunately, the actual name is "SelectedItem". So this code actually works--I solved the problem early this afternoon and then spent the rest of the afternoon and all evening scouring the web, before I noticed the spelling error.

    My wife told me at 3:00 this afternoon, "You know, it's going to turn out to be something small." And so it did--a missing letter "I". Well, at least I can go to bed now.

    0 讨论(0)
提交回复
热议问题