Replies: 2 comments
-
Thanks for the feedback. WinUI does not support disposing instances originally, which makes iOS/Android prevent the use of |
Beta Was this translation helpful? Give feedback.
-
Thanks, @jeromelaban . I appreciate the time you took to shed some light on this for me. Very helpful explanation and confirmation of my suspicions. |
Beta Was this translation helpful? Give feedback.
-
Recently, I've noticed that (inconsistently) the implementation of IDisposable methods (ex
void Dispose(bool disposing)
) is sealed on some platform implementations of some Framework Elements (today, I ran across this for the iOS implementation ofBorder
).I've been using IDispose in ListView.ItemTemplate cell classes to terminate subscriptions that are used by the cell. Yes, I probably could/should, with a bit of effort, use a better approach:
new void Dispose(bool disposing)
) but I'm concerned that now (or in the future) this won't get called during view disposalvoid Dispose(bool disposing)
methodPage.OnNavigatedFrom()
to dispose the view model, and thus the cell view model's subscriptionsConverter
and thenBind
with that converterThe above are good solutions - but a lot more work than just being able to unsubscribe in the cell view's disposal.
Would it be possible to make the IDispose methods consistently
virtual
orprotected
?Thank you for considering this.
Beta Was this translation helpful? Give feedback.
All reactions