Use property instead of field for CompositeDisposable
MODIFY
WalletWasabi.Gui/Behaviors/CommandOnDoubleClickBehavior.cs
WalletWasabi.Gui/Behaviors/CommandOnDoubleClickBehavior.cs
@@ -5,15 +5,15 @@ namespace WalletWasabi.Gui.Behaviors
{
public class CommandOnDoubleClickBehavior : CommandBasedBehavior<Control>
{
- private CompositeDisposable _disposables;
+ private CompositeDisposable Disposables { get; set; }
protected override void OnAttached()
{
- _disposables = new CompositeDisposable();
+ Disposables = new CompositeDisposable();
base.OnAttached();
- _disposables.Add(AssociatedObject.AddHandler(Control.PointerPressedEvent, (sender, e) =>
+ Disposables.Add(AssociatedObject.AddHandler(Control.PointerPressedEvent, (sender, e) =>
{
if (e.ClickCount == 2)
{
@@ -26,7 +26,7 @@ namespace WalletWasabi.Gui.Behaviors
{
base.OnDetaching();
- _disposables.Dispose();
+ Disposables?.Dispose();
}
}
}

Use property instead of field for CompositeDisposable