remove observables
MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/RecoverWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/RecoverWalletViewModel.cs
@@ -58,7 +58,8 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
AdvancedOptionsInteraction.RegisterHandler(
async interaction =>
interaction.SetOutput(
- await new AdvancedRecoveryOptionsViewModel(navigationState, NavigationTarget.DialogHost, interaction.Input).ShowDialogAsync()));
+ await new AdvancedRecoveryOptionsViewModel(navigationState, NavigationTarget.DialogHost,
+ interaction.Input).ShowDialogAsync()));
AdvancedRecoveryOptionsDialogCommand = ReactiveCommand.CreateFromTask(
async () =>
@@ -73,29 +74,29 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
}
});
- IsBusyObservable = this
- .WhenAnyValue(x => x.IsBusy)
- .Select(x=>x)
- .ObserveOn(RxApp.MainThreadScheduler);
}
- private async Task OnNext(NavigationStateViewModel navigationState, WalletManager walletManager, Network network, string? walletName)
+ private async Task OnNext(NavigationStateViewModel navigationState, WalletManager walletManager,
+ Network network, string? walletName)
{
+ IsBusy = true;
+
try
{
- IsBusy = true;
var enterPassword = new EnterPasswordViewModel(
navigationState,
NavigationTarget.DialogScreen,
"Type the password of the wallet to be able to recover and click Continue.");
- await Task.Delay(15_000);
- IsBusy = false;
NavigateTo(enterPassword, NavigationTarget.DialogScreen);
var result = await enterPassword.GetDialogResultAsync();
+ NavigateToSelf();
+
if (result is { } password)
+ {
+ await Task.Run(() =>
{
var walletFilePath = walletManager.WalletDirectories.GetWalletFilePaths(walletName!)
.walletFilePath;
@@ -111,6 +112,8 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
walletManager.AddWallet(keyManager);
+ });
+
ClearNavigation(NavigationTarget.DialogScreen);
}
}
@@ -118,12 +121,14 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
{
Logger.LogError(ex);
}
+ finally
+ {
+ IsBusy = false;
+ }
}
public IObservable<bool> FinishCommandCanExecute { get; }
- public IObservable<bool> IsBusyObservable { get; }
-
public ICommand AdvancedRecoveryOptionsDialogCommand { get; }
private KeyPath AccountKeyPath { get; set; } = KeyPath.Parse("m/84'/0'/0'");

MODIFY
WalletWasabi.Fluent/ViewModels/Settings/SettingsPageViewModel.cs
WalletWasabi.Fluent/ViewModels/Settings/SettingsPageViewModel.cs
@@ -4,7 +4,6 @@ using System.Linq;
using System.Net;
using System.Reactive;
using System.Reactive.Linq;
-using System.Reactive.Subjects;
using System.Threading.Tasks;
using Avalonia;
using Avalonia.Markup.Xaml.Styling;
@@ -107,7 +106,7 @@ namespace WalletWasabi.Fluent.ViewModels.Settings
OpenConfigFileCommand = ReactiveCommand.CreateFromTask(OpenConfigFileAsync);
TextBoxLostFocusCommand = ReactiveCommand.Create(Save);
- LoadingTestCommand = ReactiveCommand.CreateFromTask(LoadingTest);
+
Observable
.Merge(OpenConfigFileCommand.ThrownExceptions)
.Merge(TextBoxLostFocusCommand.ThrownExceptions)
@@ -181,22 +180,8 @@ namespace WalletWasabi.Fluent.ViewModels.Settings
MediumPrivacyLevel = x - 1;
}
});
- isbusy = new Subject<bool>();
- IsBusyObservable = isbusy.ObserveOn(RxApp.MainThreadScheduler).Select(x => x);
-
- }
-
- public IObservable<bool> IsBusyObservable { get; }
- private Subject<bool> isbusy;
- private async Task LoadingTest()
- {
- isbusy.OnNext(true);
- await Task.Delay(5_000);
- isbusy.OnNext(false);
}
- public ReactiveCommand<Unit, Unit> LoadingTestCommand { get; set; }
-
private object ConfigLock { get; } = new object();
public ReactiveCommand<Unit, Unit> OpenConfigFileCommand { get; }

MODIFY
WalletWasabi.Fluent/Views/AddWallet/RecoverWalletView.axaml
WalletWasabi.Fluent/Views/AddWallet/RecoverWalletView.axaml
EnableBack="True"
EnableCancel="True" CancelContent="Cancel"
EnableNext="True" NextContent="Finish"
- IsBusy="{Binding IsBusyObservable^}">
+ IsBusy="{Binding IsBusy}">
<StackPanel>
<DockPanel>
<PathIcon Name="IconCheckmark" Classes="checkMark" Margin="15 42 0 0" VerticalAlignment="Top"

MODIFY
WalletWasabi.Fluent/Views/Settings/SettingsPageView.xaml
WalletWasabi.Fluent/Views/Settings/SettingsPageView.xaml
xmlns:settings="clr-namespace:WalletWasabi.Fluent.ViewModels.Settings"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:DataType="settings:SettingsPageViewModel"
- x:CompileBindings="True"
x:Class="WalletWasabi.Fluent.Views.Settings.SettingsPageView">
<UserControl.Styles>
<Style Selector="TabItem">
<Setter Property="Padding" Value="0" />
</Style>
</UserControl.Styles>
- <c:ContentArea Title="Settings" Caption="Manage appearance, privacy and other settings" IsBusy="{Binding IsBusyObservable^}">
- <StackPanel>
+ <c:ContentArea Title="Settings" Caption="Manage appearance, privacy and other settings">
<TabControl>
<TabItem Header="General">
<v:GeneralSettingsView />
<v:BitCoinSettingsView />
</TabItem>
</TabControl>
- <Button Command="{Binding LoadingTestCommand}">Activate Loading Animation</Button>
- </StackPanel>
</c:ContentArea>
</UserControl>
\ No newline at end of file

remove observables