I am working on WPF application and have a progress bar for each item inside a ListBox, but when I am binding it to some value its not updating the UI. If I set a specific int value like 45, UI gets updated. Why it is not binding to the value?
Asked
Active
Viewed 247 times
0
-
@ManDani thank u so much . Its working i was getting mad over it . Thank u so much. – user6850427 Nov 18 '16 at 16:23
-
for more detail check this very well explained http://stackoverflow.com/questions/84278/how-do-i-use-wpf-bindings-with-relativesource – user6850427 Nov 18 '16 at 18:04
1 Answers
0
Every ListBoxItem has his own DataContext (not the same as the view). If SawStatus is a property of your viewmodel, you have to change your binding to something like
Value ="{Binding DataContext.SawStatus, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox }"
Otherwise you have to give more details about the ItmesSource of your ListBox.

ManDani
- 182
- 4
- 16
-
thank u so much . Its working i was getting mad over it . Thank u so much. – user6850427 Nov 18 '16 at 18:02