How to properly cancel a Task on ViewModel-deactivation with ReactiveUI?
问题 In my MVVM application, when a ViewModel gets activated, a Task gets started that establishes a network connection and could take some time to complete. This Task is cancalable: private async Task ConnectAsync(CancellationToken cancellationToken = default) { ... } I'm using IActivatableViewModel to start it on ViewModel-activation like that: // Constructor: public SomeViewModel(...) { this.WhenActivated(disposable => { Observable.StartAsync(ConnectAsync); }); } Now what is the recommended