Created
April 28, 2021 15:52
-
-
Save rdelrosario/ba6765db51becb119b409a8863698702 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Reactive.Disposables; | |
using ReactiveUI; | |
namespace DynamicDataGroupingSample | |
{ | |
public abstract class ReactiveObjectEx : ReactiveObject, IDisposable | |
{ | |
/// <summary> | |
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. | |
/// </summary> | |
public void Dispose() | |
{ | |
Dispose(true); | |
GC.SuppressFinalize(this); | |
} | |
/// <summary> | |
/// Dispose all of your Rx subscriptions with this property. | |
/// </summary> | |
protected readonly CompositeDisposable Subscriptions = new CompositeDisposable(); | |
protected virtual void Dispose(bool disposing) | |
{ | |
if (disposing) | |
{ | |
Subscriptions?.Dispose(); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment