Will this fire
private List<TweetTileViewModel> _TweetTiles;
public List<TweetTileViewModel> TweetTiles
{
get { return _TweetTiles; }
set { this.RaiseAndSetIfChanged(ref _TweetTiles, value); }
}
When I do:
TweetTiles.Add(new TweetTileViewModel(...)); or
TweetTiles.Remove(new TweetTileViewModel(...));
etc.
I suspect not, but am not sure how I should get this behavior.
I have a function, running on a background Task, that is returning tweets. Each time I get a new tweet I convert it to a TweetTileViewModel and want it to show in my UI listbox.
Nope, this will only fire when you set the list:
ReactiveUI has built-in support for this, via the
ReactiveList
class. Here's how you want to set it up - first, declare some properties:Then, in the constructor:
Update: Fixed type error. To use a method that only sends a callback, use an AsyncSubject:
Now, you can change
RegisterAsyncTask
to justRegisterAsync
and you're good to go!