예제 #1
0
 private void SubscribeToViewModel()
 {
     ShouldDispose(ViewModel.ChatList.Changed
                   .Where(list => list != null && list.NewItems.Count > 0)
                   .Subscribe(chatList => {
         NSIndexPath[] indexes = new NSIndexPath[chatList.NewItems.Count];
         for (int i = chatList.NewStartingIndex; i < chatList.NewItems.Count; i++)
         {
             indexes[i] = NSIndexPath.FromRowSection(i, 0);
         }
         ListView.BeginUpdates();
         ListView.InsertRows(indexes, UITableViewRowAnimation.Fade);
         ListView.EndUpdates();
     }));
 }