wpf - OnPropertyChanged with a List -


I have a data grid in a view that is bound to a list in a viewable model to recover in the list I have a lot of data, so I want to break it in a lot of small recovery instead of one big one.

I want to be on a background thread with this UI update, at the end of each batch the grid is bound.)

At the end of every recovery, A list. Adrenaline, I am increasing the onaprati-playful phenomenon, the name of the public property being bound for the grid.

In the beginning I tried to do it with 6 iterations which retrieve every 100 items. When running in the background, the UI will be updated after the first 100, but will not update the last 500 (even if the data view is successfully added to the built-in list in the model).

Was thinking that I have some issues with Marshalling on the UI thread, I run it codify, hopefully it works (though it blocks the UI during each recovery) or all the recoverys During blocking the UI - but in both cases, eventually updating to 600 items, however, it eliminates the same thing when I run it in the background - Cave Updates 100 first and not the rest.

The following method is being used with both efforts, the top half background version commented.

What am I doing?

  Public Zero StartDataStream () {// Tasks & lt; List & lt; Cars & gt; & Gt; Work = _taskFactory.StartNew (this._retrieveData); //task.continueWith(t = & gt; // {// if (this._cars == zero) this._cars = new list & lt; car & gt; (); // this._cars.AddRange (t .Result); // Base.OnPropertyChanged ("car"); // this.iterations + = 1; // if (iterative and lt; 6) StartDataStream ();}}; If (this._cars == faucet) this._cars = new list & lt; Cars & gt; (); This._cars.AddRange (this.GetCarList (eq, s, e)); Base.OnPropertyChanged ("car"); This.iterations + = 1; If (iterations; 6) StartDataStream (); }  

Did you have a ObservableCollection & lt; T & gt; list & lt; T & gt; Compared to

I think you have a public property that has been said similar to cars ...

  public list & lt; Cars & gt; Cars {come back} Set this._cars;} {this._cars = value; Base.OnPropertyChanged ("car"); }}  

If it will not really do anything ... base.OnPropertyChanged ("car") ;

Extension method Adrange Obscure Control for foreach (var) / P>

  items in items) obj.Add (item); }}  

Comments