Remove spinner while generatin address QR
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabView.xaml
WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabView.xaml
<Panel Width="240" Background="#FFFEFEFE">
<controls:QrCode Matrix="{Binding QrCode}" HorizontalAlignment="Center" Margin="20" />
</Panel>
- <controls:Spinner Height="100" Width="100" IsVisible="{Binding IsBusy}" />
</Panel>
</Expander>
<Grid ColumnDefinitions="400, *, 100" Margin="30 0 0 0">

MODIFY
WalletWasabi.Gui/ViewModels/AddressViewModel.cs
WalletWasabi.Gui/ViewModels/AddressViewModel.cs
@@ -10,8 +10,6 @@ namespace WalletWasabi.Gui.ViewModels
public class AddressViewModel : ViewModelBase
{
private bool _isExpanded;
- private bool _generating;
- private bool _isBusy;
private bool[,] _qrCode;
public HdPubKey Model { get; }
@@ -20,31 +18,15 @@ namespace WalletWasabi.Gui.ViewModels
{
Model = model;
- this.WhenAnyValue(x => x.IsExpanded).Subscribe(async expanded =>
- {
- if (expanded && !_generating && QrCode is null)
- {
- IsBusy = true;
-
- _generating = true;
-
- QrCode = await Task.Run(() =>
+ Task.Run(() =>
{
var encoder = new QrEncoder(ErrorCorrectionLevel.M);
encoder.TryEncode(Address, out var qrCode);
return qrCode.Matrix.InternalArray;
+ }).ContinueWith(x=> {
+ QrCode = x.Result;
});
-
- IsBusy = false;
- }
- });
- }
-
- public bool IsBusy
- {
- get { return _isBusy; }
- set { this.RaiseAndSetIfChanged(ref _isBusy, value); }
}
public bool IsExpanded

Remove spinner while generatin address QR