❔ Do static two way bindings leak XAML?
To summarize, does the following leak the
ContentPage
here:
If so, would this be an appropriate replacement, or the same issue?
Replacement paradigms would be useful.10 Replies
what do you mean by "leak the ContentPage"?
it seems a LITTLE strange to me to have a static linkage between the View and VM layers like that
For example, something like a background thread that polls an API for information, and wanting to continuously consume this API from various parts of the application.
uhm
okay
something like a background thread that polls an API for informationwhat about that? how does that answer the question?
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.Not stale, totally forgot to update this.
Basically if you have a singleton with an init function, that spawns a thread and updates information contained in itself. The singleton is accessed statically throughout the application. Does this leak pages if the binding is two way?
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.Not stale
okay, so you mean
a memory leak
do pages that bind to this guy get preserved by the binding, even after they've gone out of scope
all bindings and subscriptions and such in the View layer are run through WeakReferences, so it should be fine
reasonably easy to test for, though
Yep!
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.