Skip to content

[.NET9] Look at fixing the order that we process OnChildAdded as it relates to the handlers #23409

@PureWeen

Description

@PureWeen

Description

Currently with layouts the flow of operations will go (Similar steps for OnApp)

  • Remove view
  • Removed from logical view
  • OnChildRemoved is called
    public void RemoveAt(int index)
    {
    if (index >= Count)
    {
    return;
    }
    var child = _children[index];
    _children.RemoveAt(index);
    if (child is Element element)
    {
    RemoveLogicalChild(element);
    }
    OnRemove(index, child);
    }
  • xplat events fire
  • handler processes remove

I think those last two steps should be flipped.
Once our code has finished processing the remove then we should fire all the eventing paths that are going on inside of OnChildRemoved

Related work here
#23408

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-controls-generalGeneral issues that span multiple controls, or common base classes such as View or Elementproposal/underconsiderations/triagedIssue has been reviewedt/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions