Add loading ring while waiting on suggestions
ADD
WalletWasabi.Fluent/ViewModels/Wallets/Send/LoadingSuggestionViewModel.cs
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WalletWasabi.Fluent.ViewModels.Wallets.Send;
+
+public class LoadingSuggestionViewModel : SuggestionViewModel
+{
+}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/PrivacySuggestionsFlyoutViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/PrivacySuggestionsFlyoutViewModel.cs
@@ -46,6 +46,9 @@ public partial class PrivacySuggestionsFlyoutViewModel : ViewModelBase
Suggestions.Add(new PocketSuggestionViewModel(SmartLabel.Merge(transaction.SpentCoins.Select(x => CoinHelpers.GetLabels(x)))));
}
+ var loadingRing = new LoadingSuggestionViewModel();
+ Suggestions.Add(loadingRing);
+
var hasChange = transaction.InnerWalletOutputs.Any(x => x.ScriptPubKey != destination.ScriptPubKey);
IsLoading = false;
@@ -57,8 +60,10 @@ public partial class PrivacySuggestionsFlyoutViewModel : ViewModelBase
await foreach (var suggestion in suggestions)
{
- Suggestions.Add(suggestion);
+ Suggestions.Insert(Suggestions.Count - 1, suggestion);
}
+
+ Suggestions.Remove(loadingRing);
}
}
}

ADD
WalletWasabi.Fluent/Views/Wallets/Send/LoadingSuggestionView.axaml
+<UserControl xmlns="https://github.com/avaloniaui"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:vm="using:WalletWasabi.Fluent.ViewModels.Wallets.Send"
+ xmlns:c="using:WalletWasabi.Fluent.Controls"
+ mc:Ignorable="d" d:DesignWidth="300" d:DesignHeight="450"
+ x:DataType="vm:LoadingSuggestionViewModel"
+ ClipToBounds="False"
+ x:CompileBindings="True"
+ x:Class="WalletWasabi.Fluent.Views.Wallets.Send.LoadingSuggestionView">
+ <Viewbox Height="50">
+ <c:ProgressRing Height="100" Width="100" IsIndeterminate="True" />
+ </Viewbox>
+</UserControl>

ADD
WalletWasabi.Fluent/Views/Wallets/Send/LoadingSuggestionView.axaml.cs
+using Avalonia.Controls;
+using Avalonia.Markup.Xaml;
+
+namespace WalletWasabi.Fluent.Views.Wallets.Send;
+
+public class LoadingSuggestionView : UserControl
+{
+ public LoadingSuggestionView()
+ {
+ InitializeComponent();
+ }
+
+ private void InitializeComponent()
+ {
+ AvaloniaXamlLoader.Load(this);
+ }
+}

Add loading ring while waiting on suggestions