change theme button
MODIFY
WalletWasabi.Fluent/ViewModels/SettingsPageViewModel.cs
WalletWasabi.Fluent/ViewModels/SettingsPageViewModel.cs
+using System;
using ReactiveUI;
using System.Windows.Input;
+using Avalonia;
+using Avalonia.Markup.Xaml.Styling;
namespace WalletWasabi.Fluent.ViewModels
{
@@ -10,9 +13,24 @@ namespace WalletWasabi.Fluent.ViewModels
Title = "Settings";
NextCommand = ReactiveCommand.Create(() => screen.Router.Navigate.Execute(new HomePageViewModel(screen)));
+ ChangeThemeCommand = ReactiveCommand.Create(() =>
+ {
+ var light = new StyleInclude(new Uri("avares://WalletWasabi.Fluent/App.xaml"))
+ {
+ Source = new Uri("avares://WalletWasabi.Fluent/Styles/Themes/BaseLight.xaml")
+ };
+ var dark = new StyleInclude(new Uri("avares://WalletWasabi.Fluent/App.xaml"))
+ {
+ Source = new Uri("avares://WalletWasabi.Fluent/Styles/Themes/BaseDark.xaml")
+ };
+
+ Application.Current.Styles[0] = ((StyleInclude)Application.Current.Styles[0]).Source.AbsolutePath == light.Source.AbsolutePath ? dark : light;
+ });
+
}
public ICommand NextCommand { get; }
+ public ICommand ChangeThemeCommand { get; }
public override string IconName => "settings_regular";
}

MODIFY
WalletWasabi.Fluent/Views/SettingsPageView.axaml
WalletWasabi.Fluent/Views/SettingsPageView.axaml
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="WalletWasabi.Fluent.Views.SettingsPageView">
- <Panel>
+ <StackPanel>
<TextBlock Text="Settings" FontSize="22" VerticalAlignment="Center" HorizontalAlignment="Center" />
<Button Command="{Binding NextCommand}" Content="Next" />
- </Panel>
+ <Button Command="{Binding ChangeThemeCommand}" Content="Change theme" />
+ </StackPanel>
</UserControl>

change theme button