Open aldelaro5 opened 1 year ago
Ok so I investigated this thoroughly, but this one seems out of my league and I would recommend @grokys to check since they worked on value store 3 #8600 which may or may not be involved, let me explain.
This issue seems to have first been observed after value store 3, but not necessarily reproducible since. See, when I bisected this (I didn't used to see this message before), I came across this commit from value store 3: https://github.com/AvaloniaUI/Avalonia/pull/8600/commits/88d59a4ed5b6a8943f1fc06803850f287d64ff67
Which isn't very helpful: it just means we never COULD see the message before.
But in debugging this, what I found is that the reasoning behind isn't too illogical: the visual parent of the old view gets nulled from the tab switch which causes its binding to push null.
The issue is I am confused on 2 potential, different problems:
I can't figure out which one is wrong because I don't know enough about how bindings and value store v3 SHOULD work. I'm just presenting what I seen, but the point is this issue could have potentially been present way before preview 4 even and we might not have been able to observe it.
....or it just wasn't in general there because value store 3 wasn't a thing yet. It gets confusing so hopefully someone can clarify what's happening.
Describe the bug Say we have a MainWindow with a TabControl containing 2 TabItems. Each TabItem's content is a view where the DataContext is bound to a viewModel that the MainWindow's viewModel contain. Everytime the tab is changed, an error gets logged to trace like the following:
To Reproduce In the Sandbox project, prepare the following:
MainWindow.xaml:
MainWindowViewModel.cs:
namespace Sandbox;
public class MainWindowViewModel : INotifyPropertyChanged { private FirstViewModel _firstVm; private SecondViewModel _secondVm;
}