make sure clicking systray icon only shows window, and doesnt toggle between shown and hidden.
MODIFY
WalletWasabi.Fluent/App.axaml
WalletWasabi.Fluent/App.axaml
<TrayIcon Icon="{Binding TrayIcon}" Command="{Binding ShowCommand}" ToolTipText="Wasabi Wallet">
<NativeMenu.Menu>
<NativeMenu>
- <NativeMenuItem Header="{Binding IsMainWindowShown, Converter={StaticResource ShowHideBoolConverter}}" Command="{Binding ShowCommand} " />
+ <NativeMenuItem Header="{Binding IsMainWindowShown, Converter={StaticResource ShowHideBoolConverter}}" Command="{Binding ShowHideCommand} " />
<NativeMenuItemSeparator />
<NativeMenuItem Header="Quit" Command="{Binding QuitCommand}" />
</NativeMenu>

MODIFY
WalletWasabi.Fluent/ViewModels/ApplicationViewModel.cs
WalletWasabi.Fluent/ViewModels/ApplicationViewModel.cs
@@ -27,7 +27,7 @@ public partial class ApplicationViewModel : ViewModelBase, ICanShutdownProvider
QuitCommand = ReactiveCommand.Create(_mainWindowService.Shutdown);
- ShowCommand = ReactiveCommand.Create(() =>
+ ShowHideCommand = ReactiveCommand.Create(() =>
{
if (IsMainWindowShown)
{
@@ -39,6 +39,11 @@ public partial class ApplicationViewModel : ViewModelBase, ICanShutdownProvider
}
});
+ ShowCommand = ReactiveCommand.Create(() =>
+ {
+ _mainWindowService.Show();
+ });
+
AboutCommand = ReactiveCommand.Create(
() => MainViewModel.Instance.DialogScreen.To(new AboutViewModel(navigateBack: MainViewModel.Instance.DialogScreen.CurrentPage is not null)),
canExecute: MainViewModel.Instance.DialogScreen.WhenAnyValue(x => x.CurrentPage)
@@ -69,6 +74,9 @@ public partial class ApplicationViewModel : ViewModelBase, ICanShutdownProvider
public WindowIcon TrayIcon { get; }
public ICommand AboutCommand { get; }
public ICommand ShowCommand { get; }
+
+ public ICommand ShowHideCommand { get; }
+
public ICommand QuitCommand { get; }
public void OnShutdownPrevented()

make sure clicking systray icon only shows window, and doesnt toggle between shown and hidden.