Investigate: why ViewBuild.Equals returns false, but FuncUI doesn't
manio143 opened this issue · comments
Right now I'm only running updateRoot
if my Equals function returned false
, which means FuncUI has to see a change and update. But for some reason it doesn't.
See diffAttributes (L117-L122) for where the check occurs. The only implementation of IAttr
is Attr<'viewType>
which has structural equality. Then we also have default structural for ViewContent
, View<'viewType>
and others. Content equality works or sure as during debugging I was getting inside nested View<TreeViewItem>
. But somehow my change in bool IsSelected
isn't picked up.
The issue may very well be somewhere in my code, but I couldn't find it for now. Let's give it a day or two and I'll put some fresh eyes on it. I will create a smaller game test project to check these things.
Turns out the Dispatcher.UIThread.Post(...)
is fire and forget. So by the time it invoked the view.UpdateRoot(container, lastView)
we already have reassigned lastView = view
. I added a capture variable to alleviate this issue.