Skip to content

Shift Handler?.UpdateValue to happen after all PropertyChanged events have fired #5587

Closed

Description

@PureWeen

Currently our Handler?.UpdateValue call fires during the top call here from BindableObject

image

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.

For example it leads to issues like this

#5586

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.

Activity

  1. added this to the 6.0.300-rc.2 milestone on Mar 25, 2022
  2. added
    s/verified
    on Mar 25, 2022
  3. self-assigned this
    on Mar 28, 2022
  4. antonfirsov commented on Mar 28, 2022

    @antonfirsov
    Contributor

    @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 ?

  5. added
    area-core-lifecycle
    on Mar 30, 2022
  6. modified the milestones: 6.0.300-rc.3, .NET 7 on Apr 25, 2022
  7. removed
    s/verified
    on Apr 5, 2023
  8. modified the milestones: Backlog, on Jul 26, 2023
  9. added
    t/bug
    on Jul 31, 2023
  10. modified the milestones: , .NET 9 Planning on May 15, 2024
  11. PureWeen commented on May 15, 2024

    @PureWeen
    MemberAuthor

    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

    The difficulty comes with maintaining behavior when users manually call OnPropertyChanged

  12. locked and limited conversation to collaborators on Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-core-lifecyclefixed-in-9.0.0-preview.7.24407.4t/bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions