switch theme when dialog is opened
MODIFY
WalletWasabi.Fluent/ViewModels/Settings/GeneralSettingsTabViewModel.cs
WalletWasabi.Fluent/ViewModels/Settings/GeneralSettingsTabViewModel.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Reactive.Linq;
using ReactiveUI;
+using WalletWasabi.Fluent.Helpers;
using WalletWasabi.Gui;
using WalletWasabi.Gui.Models;
@@ -43,7 +44,8 @@ namespace WalletWasabi.Fluent.ViewModels.Settings
x =>
{
uiConfig.DarkModeEnabled = x;
- IsRestartNeeded(x);
+ // IsRestartNeeded(x);
+ Navigate(NavigationTarget.CompactDialogScreen).To(new ThemeChangeViewModel(x ? Theme.Dark : Theme.Light));
});
this.WhenAnyValue(x => x.AutoCopy)

ADD
WalletWasabi.Fluent/ViewModels/Settings/ThemeChangeViewModel.cs
+using System.Reactive.Concurrency;
+using System.Reactive.Disposables;
+using System.Threading.Tasks;
+using ReactiveUI;
+using WalletWasabi.Fluent.Helpers;
+using WalletWasabi.Fluent.ViewModels.Navigation;
+
+namespace WalletWasabi.Fluent.ViewModels.Settings
+{
+ [NavigationMetaData(Title = "")]
+ public partial class ThemeChangeViewModel : RoutableViewModel
+ {
+ private readonly Theme _newTheme;
+
+ public ThemeChangeViewModel(Theme newTheme)
+ {
+ _newTheme = newTheme;
+ }
+
+ protected override void OnNavigatedTo(bool isInHistory, CompositeDisposable disposables)
+ {
+ base.OnNavigatedTo(isInHistory, disposables);
+
+ RxApp.MainThreadScheduler.Schedule(async () =>
+ {
+ await Task.Delay(500);
+ ThemeHelper.ApplyTheme(_newTheme);
+ Navigate().Clear();
+ });
+ }
+ }
+}

ADD
WalletWasabi.Fluent/Views/Settings/ThemeChangeView.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:settings="using:WalletWasabi.Fluent.ViewModels.Settings"
+ mc:Ignorable="d" d:DesignWidth="428" d:DesignHeight="371"
+ x:DataType="settings:ThemeChangeViewModel"
+ x:CompileBindings="True"
+ x:Class="WalletWasabi.Fluent.Views.Settings.ThemeChangeView">
+ <TextBlock Text="Wasabi changing theme"/>
+</UserControl>

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

switch theme when dialog is opened