Questions tagged [inotifycollectionchanged]

is a .NET interface for providing collection subscribers notification on changes, mostly used in WPF UI binding.

From MSDN: You can enumerate over any collection that implements the IEnumerable interface. However, to set up dynamic bindings so that insertions or deletions in the collection update the UI automatically, the collection must implement the INotifyCollectionChanged interface. This interface exposes the CollectionChanged event that must be raised whenever the underlying collection changes.

WPF provides the ObservableCollection class, which is a built-in implementation of a data collection that exposes the INotifyCollectionChanged interface. For an example, see How to: Create and Bind to an ObservableCollection.

The individual data objects within the collection must satisfy the requirements described in the Binding Sources Overview.

120 questions
2
votes
2 answers

Can't bind a MvxBindableListView in TwoWay Mode

I'm trying to bind a MvxBindableListView in TwoWay mode, for it to update in the View when I Set it's value in the ViewModel (through a Buttons's Click command). Currently it only updates when the layout is fully loaded at start/tabchange... The…
2
votes
1 answer

Adding a lot of items to WPF Datagrid consumes lots of CPU time

I am creating application that has some simple sniffer functionality and which shows the user dumped packets. Packets are read from dump file, which is updated in real time with current traffic and then captured packets are added to Datagrid (each…
2
votes
1 answer

ObservableCollection's CollectionChanged event not firing

I have a XamDataGrid which is bound to an observable collection. As the XamDataGrid is editable, records can be added/edited/deleted. I have implemented CollectionChanged & PropertyChanged events. The CollectionChanged event contains the following…
Vikram
  • 39
  • 5
1
vote
0 answers

Why isn't my CollectionChanged event handler getting called?

I have done some research and other answers on stackoverflow indicate that I need to extend the ObservableCollection class to add PropertyChanged event handlers to each item when an item is added or removed in order to get events when the contents…
1
vote
1 answer

Observable collection - CollectionChanged Binding

During programming, I ran into the following questions: Does a observable collection implement a CollectionChanged event by itself? (Because of differentbooks refering to the fact that it does, but google shows otherwise) I have the following code,…
Bart Teunissen
  • 1,350
  • 5
  • 19
  • 43
1
vote
1 answer

What triggers UI to update when ItemsControl.ItemsSource changed?

I was just looking into the difference between BindingList and ObservableCollection following this question: Why NOT BindingList in WPF As part of this, I tested binding the ItemsSource of an ItemsControl to various types, including List,…
1
vote
1 answer

Any use in hacking Silverlight NotifyCollectionChangedEventArgs to support multiple items?

The Silverlight version of NotifyCollectionChangedEventArgs differs from the full framework version, in that it does not accept multiple (added, changed, removed) items. The constructors that take lists are in fact missing, so it appears Microsoft…
CÅdahl
  • 452
  • 3
  • 13
1
vote
2 answers

Un-subscribing from CollectionChanged event of a collection stored in an attached property

Ok, so I have an attached property (declared in a static class) which attaches an INotifyCollectionChanged property to an object. When the property is set, I want to start monitoring the collection for changes, and then perform some action on the…
Mark
  • 1,644
  • 15
  • 25
1
vote
0 answers

Added item does not appear at given index '2'

I am getting this exception when I am trying to Delete the item from Dictionary which I am inheriting from INotifyCollectionChanged. When I am deleting for first time I am able to delete the item, just after that if i am trying to delete this…
Vikram
  • 1,559
  • 4
  • 17
  • 33
1
vote
2 answers

ObservableCollections and changes to properties in C#

I'm working with an observable collection of a Job class I have defined. I have binded a method to handle the INotifyCollectionChanged event. MSDN tells me that INotifyCollectionChanged is a "listener of dynamic changes, such as when items get added…
1
vote
0 answers

How can a custom iterator notify subscribers of changes to its iterated items (think 'INotifyCollectionChanged')?

We're trying to expose the contents of two child collections as an additional, all-inclusive IEnumerable property. People have suggested using CompositeCollection for this case, but there are two issues: There doesn't appear to be a read-only…
1
vote
0 answers

INotifyPropertyChanged and InotfyCollectionChanged implementation

I am building a Windows desktop application using WPF and C#. I am trying to use the MVVM model but am not able to get my head around with the model and the INotifyPropertyChanged and INotifyCollectionChanged interfaces. I am detailing below…
1
vote
1 answer

WPF Notify MultiConverter that the bound collection has changed

I am new in wpf and I am having quite a hard time trying to figure out how to notify a multiconverter that its binded collections have changed. I have tried several solutions but nothing works. I have a calendar with a multiconverter allowing me to…
1
vote
2 answers

Examples of collection changed events on Observable Collection

I have listbox in a WPF application that displays an observable collection of photo objects. When a photo is added to the collection the UI needs show the new image right away. I understand this can be handled using the CollectionChanged event. I…
MBU
  • 4,748
  • 12
  • 55
  • 96
1
vote
1 answer

Custom Observable not updating UWP ListView

I've implemented my own ObservableDictionary since A) I wasn't happy with the code I saw other people posting and B) wanted the practice. As far as I can tell, everything works correctly including notifying the listeners, but for some reason, the…