Guest User

Untitled

a guest
Jan 19th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. // responses is an ObservableCollection where I add the content from http responses
  2. responses.Add(content);
  3. // dataGrid.ItemsSource is binded to responses
  4. dataGrid.ScrollIntoView(content);
  5.  
  6. ((INotifyCollectionChanged)DataGrid.Items).CollectionChang‌​ed += CollectionChangedEventHandler;
  7.  
  8. private void CollectionChangedEventHandler(object sender, NotifyCollectionChangedEventArgs e)
  9. {
  10. var itemCollection = sender as ItemCollection;
  11.  
  12. // How to access ModelParent here?
  13. }
  14.  
  15. var dataGrid = itemCollection.GetType().GetProperty("ModelParent").GetValue(itemCollection);
Add Comment
Please, Sign In to add comment