Git Product home page Git Product logo

Comments (2)

lbdalmendrayMyradar avatar lbdalmendrayMyradar commented on July 28, 2024

Good afternoon. I would like to know if there is any feedback that can be shared. I would also like to know if there is any estimated time to have a solution. Thanks.

from microsoft-ui-xaml.

JJBrychell avatar JJBrychell commented on July 28, 2024

This is a known issue that results from the somewhat complicated (and possibly misnamed) loading/loaded/unloaded sequence that occurs. We are actively looking at how we can resolve this and make things clearer, but we have not yet settled on an approach that actually would achieve that goal while still providing the functionality that needs to be relied on.

Although these three events are part of the element load process, the triggers for them are not quite as straight forward.

  • Loading occurs when an element is first measured. This is the first opportunity an application has to start the download of external resources that might be needed.
  • Loaded occurs late in layout cycle after all templates have been applied. This is the first opportunity an application has to access the full tree that is generated from any templated controls beneath it.
  • Unloaded occurs when the element is removed from the active Xaml tree. This is when the application knows that it can release any resources that it may have allocated.

The other important aspect is that Loading and Loaded are synchronous events and Unloaded is asynchronous (since there generally is no urgency in releasing resources no longer used).

Based on these triggering events, you can see why you get the behavior that you do. Adding a collapsed control to the tree will not get a loading event because we don't measure collapsed elements. But once the next layout pass occurs, the loaded event will fire because the element is now in a stable state (e.g. all templates that are going to be expanded already are).

If you make the element visible, you will then get the loading event because it will be measured for the first time.

We agree that this is not optimal and certainly not intuitive, but we are currently hampered in fixing this by two things. The first is, it just isn't clear (or nobody has had a good enough idea) how to implement these (or other) events to clear things up and still get the right functionality. The second is that anything that we come up with is most likely to be a significant breaking change which we cannot do in a dot release. Since WinAppSdk 2.0 is not currently on the calendar, we have no current timeline for a solution.

So technically, this is by design, but I am going to resolve it as a dup of #8342 as that is the issue that we are tracking while trying to come up with a better solution.

from microsoft-ui-xaml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.