Back to Browse

Disposing View Models - WPF MVVM NAVIGATION TUTORIAL #6

12.3K views
Jun 5, 2021
12:04

Learn how and why to dispose view models in a WPF application. This is crucial for preventing memory leaks from view models never getting garbage collected. I also explain why it is preferable to make view model lifetimes transient rather than singleton. Navigation is an essential piece of an application. In this series, I demonstrate how to implement various navigation scenarios in a WPF MVVM application. TIMESTAMPS: 0:00 - Introduction 0:22 - Setting Up Disposal Scenario 3:25 - Memory Leak Investigation 4:17 - Implementing Dispose 5:40 - Propagating Disposals 6:37 - Disposing the NavigationBarViewModel 8:18 - Making View Models Transient 11:04 - Conclusion SOURCE CODE: https://github.com/SingletonSean/wpf-tutorials/tree/master/NavigationMVVM OTHER LINKS: Become a Member: https://www.youtube.com/channel/UC7X9mQ_XtTYWzr9Tf_NYcIg/join Donations: https://www.paypal.com/biz/fund?id=UBZCZWX2UVWJE

Download

0 formats

No download links available.

Disposing View Models - WPF MVVM NAVIGATION TUTORIAL #6 | NatokHD