Put busyindicator back to coinlist
MODIFY
WalletWasabi.Gui/App.xaml
WalletWasabi.Gui/App.xaml
<StyleInclude Source="avares://WalletWasabi.Gui/Controls/Shields.xaml" />
<StyleInclude Source="avares://WalletWasabi.Gui/Styles/Styles.xaml" />
<StyleInclude Source="avares://WalletWasabi.Gui/Icons/Icons.xaml" />
+ <StyleInclude Source="avares://WalletWasabi.Gui/Controls/BusyIndicator.xaml" />
</Application.Styles>
<Application.DataTemplates>
<DataTemplate DataType="Views:MainView">

ADD
WalletWasabi.Gui/Controls/BusyIndicator.cs
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Styling;
+using System;
+
+namespace WalletWasabi.Gui.Controls
+{
+ public class BusyIndicator : ContentControl, IStyleable
+ {
+ Type IStyleable.StyleKey => typeof(BusyIndicator);
+
+ public static readonly StyledProperty<string> TextProperty =
+ AvaloniaProperty.Register<BusyIndicator, string>(nameof(Text));
+
+ public static readonly StyledProperty<bool> IsBusyProperty =
+ AvaloniaProperty.Register<BusyIndicator, bool>(nameof(IsBusy));
+
+ public string Text
+ {
+ get => GetValue(TextProperty);
+ set => SetValue(TextProperty, value);
+ }
+
+ public bool IsBusy
+ {
+ get => GetValue(IsBusyProperty);
+ set => SetValue(IsBusyProperty, value);
+ }
+ }
+}

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinListView.xaml
WalletWasabi.Gui/Controls/WalletExplorer/CoinListView.xaml
<TextBlock Text="Merging unmixed coins with mixed ones undoes those mixes." Classes="warningMessage" IsVisible="{Binding LabelExposeCommonOwnershipWarning}" />
</StackPanel>
</StackPanel>
+ <controls:BusyIndicator IsBusy="{Binding IsCoinListLoading}" Text="Loading...">
<controls:ExtendedListBox Items="{Binding Coins}" VirtualizationMode="None" SelectedItem="{Binding Path=SelectedCoin, Mode=TwoWay}">
<controls:ExtendedListBox.ContextMenu>
<ContextMenu>
</DataTemplate>
</controls:ExtendedListBox.ItemTemplate>
</controls:ExtendedListBox>
+ </controls:BusyIndicator>
</DockPanel>
</Grid>
</UserControl>

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinListViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/CoinListViewModel.cs
@@ -46,6 +46,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
private bool _selectAllPrivateVisible;
private ShieldState _selectAllPrivateShieldState;
private ShieldState _selectAllNonPrivateShieldState;
+ private bool _isCoinListLoading;
public Global Global { get; }
public CoinListContainerType CoinListContainerType { get; }
@@ -200,6 +201,12 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
set => this.RaiseAndSetIfChanged(ref _selectAllNonPrivateShieldState, value);
}
+ public bool IsCoinListLoading
+ {
+ get => _isCoinListLoading;
+ set => this.RaiseAndSetIfChanged(ref _isCoinListLoading, value);
+ }
+
private bool? GetCheckBoxesSelectedState(Func<CoinViewModel, bool> coinFilterPredicate)
{
var coins = Coins.Where(coinFilterPredicate).ToArray();
@@ -238,6 +245,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
Global = global;
CoinListContainerType = coinListContainerType;
AmountSortDirection = SortOrder.Decreasing;
+ IsCoinListLoading = true;
RefreshOrdering();
// Otherwise they're all selected as null on load.
@@ -385,7 +393,20 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
}
});
- InitList = ReactiveCommand.Create(() => OnOpen(), outputScheduler: RxApp.MainThreadScheduler);
+ InitList = ReactiveCommand.CreateFromTask(async () =>
+ {
+ try
+ {
+ IsCoinListLoading = true;
+ // We have to wait for the UI to became visible to the user.
+ await Task.Delay(800); // Let other tasks run to display the gui.
+ OnOpen();
+ }
+ finally
+ {
+ IsCoinListLoading = false;
+ }
+ }, outputScheduler: RxApp.MainThreadScheduler);
InitList.ThrownExceptions.Subscribe(ex => Logger.LogError(ex));
}

Put busyindicator back to coinlist