Quantcast
Channel: Visual Studio General Questions forum
Viewing all articles
Browse latest Browse all 21115

ObservationCollection databinding question

$
0
0

Hi,

I have a listbox which shows list of customers. Say it has 1000 entries..

 My window has datacontext set to a view model which has observableCollection<Customer>  and my listbox is bound to it. Lets call that property customerlist. And customer has various property which all get displayed nicely in my listbox. Custoemr also implements Inotifypropertychanged so anything changing in customer is showing nicely in my listbox and editing in listbox is nicely changing in underlying customerlist object.

now I want to have a separate box which shows number of customers which satisfy certain conditions.Say customer who are active (some flag)

User can go and edit the active flag in listbox. I want the number in the box change automatically. My box is bound to a field which has a getter which just says customerlist.where(a=>a.flag == true).count() . it shows perfect numbers when the window opens first. but when you change the flag in listbox, number does not get updated. Basically window is not getting notified of the property change..not sure how I can accomplish it.

any pointers..


Manish


Viewing all articles
Browse latest Browse all 21115

Trending Articles



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