You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Shift Handler?.UpdateValue to happen after all PropertyChanged events have fired #5587
Currently our Handler?.UpdateValue call fires during the top call here from BindableObject
This means that sometimes the Handler will have a premature vision of the world. The Handler update should fire after as many of the PropertyChanged events have settled as possible.
The Parent on the FormattedText is set inside the BP.OnPropertyChanged which fires after the Handler?.UpdateValue fires. So anything the BP.OnPropertyChanged changes will now have to re-propagate.
@PureWeen should we consider bringing other events which fire in OnPropertyChanged after property.PropertyChanged or are we fine with a minimal solution that pushes Handler?.UpdateValue after all the other events?
Is this issue mostly about validation whether such a minimal change breaks something?
PS: Actually, firing Handler?.UpdateValue outside of OnPropertyChanged may lead to side-effects, since derived custom properties are also calling into OnPropertyChanged and may expect Handler?.UpdateValue to execute as an effect. Should we just exchange the order of property.PropertyChanged and OnPropertyChanged ?
Activity
antonfirsov commentedon Mar 28, 2022
@PureWeen should we consider bringing other events which fire in
OnPropertyChangedafterproperty.PropertyChangedor are we fine with a minimal solution that pushesHandler?.UpdateValueafter all the other events?Is this issue mostly about validation whether such a minimal change breaks something?
PS: Actually, firing
Handler?.UpdateValueoutside ofOnPropertyChangedmay lead to side-effects, since derived custom properties are also calling intoOnPropertyChangedand may expectHandler?.UpdateValueto execute as an effect. Should we just exchange the order ofproperty.PropertyChangedandOnPropertyChanged?PureWeen commentedon May 15, 2024
Related
#22347
I think we could clean up 22347 once we conceive of how we want this to work.
We should probably move the handler update code to fire about here
maui/src/Controls/src/Core/BindableObject.cs
Line 645 in 28e9cbb
The difficulty comes with maintaining behavior when users manually call OnPropertyChanged