Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make P2P and Tor configurations oneliners (#1945)
Make P2P and Tor configurations oneliners
- Loading branch information
Showing
35 changed files
with
1,021 additions
and
474 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using Avalonia.Controls; | ||
using Avalonia.Input; | ||
using Avalonia.Interactivity; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Reactive.Disposables; | ||
using System.Text; | ||
|
||
namespace WalletWasabi.Gui.Behaviors | ||
{ | ||
internal class CommandOnLostFocusBehavior : CommandBasedBehavior<Control> | ||
{ | ||
private CompositeDisposable Disposables { get; set; } | ||
|
||
protected override void OnAttached() | ||
{ | ||
Disposables = new CompositeDisposable(); | ||
|
||
base.OnAttached(); | ||
|
||
Disposables.Add(AssociatedObject.AddHandler(InputElement.LostFocusEvent, (sender, e) => | ||
{ | ||
e.Handled = ExecuteCommand(); | ||
})); | ||
} | ||
|
||
protected override void OnDetaching() | ||
{ | ||
base.OnDetaching(); | ||
|
||
Disposables?.Dispose(); | ||
} | ||
} | ||
} |
Oops, something went wrong.