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

What is the best way of refreshing dependency tree of calculated properties?

I've got some classes here that all more or less rely on each other. The relationships form kinda like a dependency tree: class A { List _bs = new List(); public int ValueOfA { get { return _bs.Sum(p => p.ValueOfB); …
0
votes
1 answer

How can I map two observable collections together?

I have an interesting problem. I have an existing module that exposes and maintains an observable collection of entities. I want to have an observable collection or some implementation of INotifyCollectionChanged that keeps in step with the adds and…
Jordan
  • 9,642
  • 10
  • 71
  • 141
0
votes
1 answer

Silverlight Data Binding to Collection within Collection

Hopefully someone can help me out with this. I am creating a Silverlight app which is used for editing images. A user has a project which contain layers which contain elements. (Elements are text and image elements). I have a class which represents…
0
votes
1 answer

Can't get change notification from Collection to UI control bound to a LINQ query

I'm trying to solve a simple problem using LINQ, which I'm just learning. I have a collection of strings, in this case representing serial ports, that will be displayed in a control, but must be ordered. The original collection is unsorted, and I…
Steve
  • 6,334
  • 4
  • 39
  • 67
-1
votes
1 answer

Can I change the order of OnCollectionChanged events firing after changes to ObservableCollections from another thread?

I have a MVVM application. I have ObservableCollections that hold my models. If OnCollectionChanged is fired and we have "Add" event then I insert the item into my data base. I have a function that reads data from a file, creates models and adds…
-1
votes
1 answer

ObervableCollection, CollectionChanged and PropertyChanged

I've been trying to figure out how to solve my problem for days. I have a data structure similar to this (I use PropertyChanged.Fody library): public class Item1 : INotifyPropertyChanged { public event PropertyChangedEventHandler…
-1
votes
2 answers

Why there is list of changes in observable collection event args?

I'm trying to understand why there are two list properties NewItems and OldItems while you can only add or remove single item at a time? private void InternalCollectionChanged(object sender, NotifyCollectionChangedEventArgs args) { var changes =…
-1
votes
1 answer

INotifycollectionchanged on ICollection object

I want to observe changes in Icollection object given that I can't changed type of the object to observablecollection.How can it be achieved? mycollectionobserver = Observable.FromEventPattern
vkg
  • 685
  • 1
  • 8
  • 21
-2
votes
1 answer

Edit DataGridViewCell without having an ObservableCollection as ItemsSource

it took me quite some time to figure out that a DataGridView wont allow editing Cells if the ItemsSource is not an ObservableCollection. Am I right in that assumption? I have a DataGridView having a Property of another DataGridView's SelectedItem…
1 2 3
8
9