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.

129 questions
0
votes
1 answer

Custom ObservableCollection

I have a question about a class I created that is similar to the ObserverableCollection. My class basically has the same same functionality as it, but I add some automatic sorting features to it when items are added to the List. My question is my…
Josh
  • 81
  • 1
  • 5
0
votes
2 answers

Which NotifyCollectionChangedAction is used to indicate that an item changed?

When implementing INotifyCollectionChanged and raising the CollectionChanged event, you must provide a NotifyCollectionChangedAction argument. Which NotifyCollectionChangedAction is used to indicate that an item in the collection has changed, such…
sourcenouveau
  • 29,356
  • 35
  • 146
  • 243
0
votes
1 answer

c# mvvm nested ObservableCollection CollectionChanged NewStartingIndex >0

I'm new to stackoverflow. I've been looking for a solution all day long so I decided to ask here. I'm working on an application which uses WPF and databinding/MVVM. I have a nested ObservableCollection which is part of a Class Program. Both…
0
votes
2 answers

ObservableQueue?

Has anyone written a version of .Net's generic Queue that implements INotifyCollectionChanged, or is there one hidden deep in the .Net framework somewhere already?
Chris Wenham
  • 23,679
  • 13
  • 59
  • 69
0
votes
0 answers

Implement OnCollectionChanged so that ListBox updates automatically WPF

I have this object wrapper, whose instances I populate the collection with: public class Multimedia : INotifyPropertyChanged { //... constructor //... getters and setters for the properties public void OnCollectionChanged(object sender,…
Milkncookiez
  • 6,817
  • 10
  • 57
  • 96
0
votes
1 answer

Problems with OnCollectionChanged and background thread

In my program I use a background worker thread to open files. The main structure of my program is a data bound TreeView. During the file read in process, dynamic TreeView nodes are added to the TreeView as they are read in from the file. These…
0
votes
2 answers

WPF DataGrid update on CollectionChanged fails

I have bound a DataGrid to an ObservableCollection of type TEntity. The collection holds Entity Framework entities. When such an entity changes in the DB the app gets notified. In case it is a simple replace change I simply overwrite the entity in…
Harald
  • 1,007
  • 1
  • 14
  • 27
0
votes
0 answers

C# Dictionary change notification (INotifyCollectionChanged)

I have a loop running retrieving live share prices. What I want to do is check if any of the prices retrieved are different to the price I already have stored in a dictionary and notify me with details of all those that have changed. Was looking…
user1156000
  • 96
  • 1
  • 14
0
votes
2 answers

Custom IEnumerable as ItemsSource for ListBox

I have a class that defines a custom GetEnumerator() function(by implementing IEnumerable<>). I use it to iterate in a contiguous manner over several ObservableCollection that are in every TestStep. I have a private…
Michael
  • 1,557
  • 2
  • 18
  • 38
0
votes
1 answer

Delete items from LongListMultiSelector

I'm new to Windows Phone 8 development. I've been working with it for about a month now and have written my own news app consuming data from an API. I save article content offline into the app's local storage as .json files. Since I have already…
0
votes
1 answer

VB.NET Index '0' is out of range?

I made a ListBox in WPF with an ItemSource and with all those classes and events that make the UI refresh it. But there's a problem in my Remove method: Public Sub Remove(ItemIndex As Integer) MyList.RemoveAt(ItemIndex) RaiseEvent…
Jan Böhm
  • 89
  • 1
  • 11
0
votes
1 answer

wpf dataGrid sum cell with entities

I display dataGrid in WPF and entity framework, column 2 has a price per unit column 3 has the quantity (column 4 has the discount), I want column 5 will be the summary. My question is how I can capture the third column and calculate the change to…
0
votes
1 answer

WPF Create user control dynamically on change of observablecollection OR Visualize nested ObservableCollections by using nested User controls

I am new to WPF, and I can't find a solution to my problem. I've got an Observable Collection in my ViewModel: ObservableCollection Within the Process class is another ObervableCollection: ObservableCollection I want to add a…
0
votes
1 answer

Why doesn't assignment to ObservableCollection destroy CollectionChanged subscribers list?

I have an ObservableCollection which I need to replace via a reload button. During trying this out I found out that the CollectionChanged event fires even though the variable "myCollection" was nullified in "ReLoadData" (see code example below) and…
0
votes
1 answer

UI not binding to INotifyCollectionChanged

I have some collection that implements INotifyCollectionChanged. public sealed class GroupCollection : INotifyCollectionChanged, IList { //... public event NotifyCollectionChangedEventHandler CollectionChanged; private void…
b1n0m
  • 283
  • 3
  • 10
1 2 3
8
9