Add BusyIndicator to CoinList.
MODIFY
WalletWasabi.Gui/Behaviors/CommandOnFirstVisible.cs
WalletWasabi.Gui/Behaviors/CommandOnFirstVisible.cs
@@ -22,9 +22,10 @@ namespace WalletWasabi.Gui.Behaviors
base.OnAttached();
Observable.FromEventPattern(AssociatedObject, nameof(AssociatedObject.AttachedToVisualTree))
- .Take(1)
+ .Take(1) // Only on first appearance.
.Subscribe(async args =>
{
+ // 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/CoinListView.xaml
WalletWasabi.Gui/Controls/WalletExplorer/CoinListView.xaml
<CheckBox Content = "Select All Private" IsThreeState="True" IsChecked = "{Binding SelectPrivateCheckBoxState}" Command="{Binding SelectPrivateCheckBoxCommand}" ToolTip.Tip="Coins those acquired the strongest privacy shield." />
<CheckBox Content = "Select All Non-Private" IsThreeState="True" IsChecked = "{Binding SelectNonPrivateCheckBoxState}" Command="{Binding SelectNonPrivateCheckBoxCommand}" ToolTip.Tip="Coins those do not have the strongest privacy shield." />
</StackPanel>
+ <controls:BusyIndicator IsBusy ="{Binding IsCoinListLoading}" Text="Loading...">
<ListBox Items="{Binding Coins}" VirtualizationMode="None" SelectedItem="{Binding Path=SelectedCoin, Mode=TwoWay}">
<ListBox.ContextMenu>
<ContextMenu>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
+ </controls:BusyIndicator>
</DockPanel>
</Grid>
</UserControl>

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinListViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/CoinListViewModel.cs
@@ -35,6 +35,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
private bool? _selectNonPrivateCheckBoxState;
private GridLength _coinJoinStatusWidth;
private SortOrder _clustersSortDirection;
+ private bool _isCoinListLoading;
public ReactiveCommand<Unit, Unit> EnqueueCoin { get; }
public ReactiveCommand<Unit, Unit> DequeueCoin { get; }
@@ -106,6 +107,12 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
set => this.RaiseAndSetIfChanged(ref _clustersSortDirection, value);
}
+ public bool IsCoinListLoading
+ {
+ get => _isCoinListLoading;
+ set => this.RaiseAndSetIfChanged(ref _isCoinListLoading, value);
+ }
+
private void RefreshOrdering()
{
if (AmountSortDirection != SortOrder.None)
@@ -216,6 +223,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
RemovedCoinViewModels = new List<CoinViewModel>();
AmountSortDirection = SortOrder.Decreasing;
+ IsCoinListLoading = true;
RefreshOrdering();
var sortChanged = this.WhenValueChanged(@this => MyComparer).Select(_ => MyComparer);
@@ -351,15 +359,21 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
{
OnOpen();
});
+
+ InitList.ThrownExceptions.Subscribe(ex => Logging.Logger.LogError<CoinListViewModel>(ex));
}
private void OnOpen()
+ {
+ try
{
if (Disposables != null)
{
throw new Exception("CoinList opened before previous closed.");
}
+ IsCoinListLoading = true;
+
Disposables = new CompositeDisposable();
foreach (var sc in Global.WalletService.Coins.Where(sc => sc.Unspent))
@@ -412,6 +426,11 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
SetSelections();
SetCoinJoinStatusWidth();
}
+ finally
+ {
+ IsCoinListLoading = false;
+ }
+ }
private void ClearRootList() => RootList.Clear();

Add BusyIndicator to CoinList.