Move delay to the viewmodel.
MODIFY
WalletWasabi.Gui/Behaviors/CommandOnFirstVisible.cs
WalletWasabi.Gui/Behaviors/CommandOnFirstVisible.cs
@@ -23,10 +23,8 @@ namespace WalletWasabi.Gui.Behaviors
Observable.FromEventPattern(AssociatedObject, nameof(AssociatedObject.AttachedToVisualTree))
.Take(1) // Only on first appearance.
- .Subscribe(async args =>
+ .Subscribe(_ =>
{
- // We have to wait for the UI to became visible to the user.
- await Task.Delay(1000);
ExecuteCommand();
}).DisposeWith(Disposables);
}

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinListViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/CoinListViewModel.cs
@@ -11,6 +11,7 @@ using System.Linq;
using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
+using System.Threading.Tasks;
using WalletWasabi.Gui.Models;
using WalletWasabi.Gui.ViewModels;
using WalletWasabi.Models;
@@ -355,8 +356,10 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
}
});
- InitList = ReactiveCommand.Create(() =>
+ InitList = ReactiveCommand.CreateFromTask(async () =>
{
+ // We have to wait for the UI to became visible to the user.
+ await Task.Delay(1000);
OnOpen();
});

Move delay to the viewmodel.