Binding TabControl ItemsSource to an ObservableCollection of ViewModels causes content to refresh on focus

前端 未结 3 622
离开以前
离开以前 2020-12-15 02:27

I\'m creating an WPF application using the MVVM framework, and I\'ve adopted several features from Josh Smith\'s article on MVVM here...

Most importantly, I\'m bind

3条回答
  •  失恋的感觉
    2020-12-15 02:50

    It has nothing to do with the ObservableCollection. It’s because the View for the Customer is reused instead that WPF creates a new View for every Customer.

    You might have a look at the Writer sample application of the WPF Application Framework (WAF). It implements the TabControl for a tabbed MDI interface as well but doesn’t suffer from the issue you mentioned in your post. The issue is solved in Writer by creating an own UserControl for every document ‘tab’.

提交回复
热议问题