0

Rather new to WPF and XAML. There is a grid item in the XAML which has dynamic binding to properties on the VM:

(.xaml file)
\\...
ItemsSource="{Binding DetailsGridItems}"
SelectedIndex="{Binding DetailsGridSelectedIndex}"
\\...

Is it possible to temporarily suspend (or "unbind") updates to the grid item which is bound to my ObservableCollection<T> member (DetailsGridItems)? Then, when ready manually update (or "rebind") the grid item?

Basically, I'd like to make a number of changes to "DetailsGridItems" and be able to control when GUI updates occur, in a similar manner to System.Windows.Forms.ListView.BeginUpdate and ListView.EndUpdate.

Update

The answer in the linked question, specifically the subclass approach using ObservableCollectionEx given by @XiaoguoGe, works nicely.

AlainD
  • 5,413
  • 6
  • 45
  • 99
  • Seems to me if you want to do this, you're using the wrong collection type. Just use a `List`, and replace the entire collection reference when you want the UI updated. But if you really want to use `ObservableCollection` see duplicate. – Peter Duniho Jul 21 '21 at 18:54
  • @PeterDuniho: I used the `ObservableCollectionEx` subclass approach given in that other question, which gives me exactly what I need. Thanks for pointing out the duplicate. – AlainD Jul 22 '21 at 11:34

0 Answers0