Put lockscreencommand into exitcommands
MODIFY
WalletWasabi.Gui/Shell/Commands/ExitCommands.cs
WalletWasabi.Gui/Shell/Commands/ExitCommands.cs
@@ -3,27 +3,47 @@ using AvalonStudio.Commands;
using ReactiveUI;
using System;
using System.Composition;
+using WalletWasabi.Helpers;
namespace WalletWasabi.Gui.Shell.Commands
{
internal class ExitCommands
{
+ public Global Global { get; }
+
+ [ExportCommandDefinition("File.LockScreen")]
+ public CommandDefinition LockScreenCommand { get; }
+
[ExportCommandDefinition("File.Exit")]
public CommandDefinition ExitCommand { get; }
[ImportingConstructor]
- public ExitCommands(CommandIconService commandIconService)
+ public ExitCommands(CommandIconService commandIconService, AvaloniaGlobalComponent global)
{
+ Global = Guard.NotNull(nameof(Global), global.Global);
+
+ var lockScreen = ReactiveCommand.Create(OnLockScreen);
var exit = ReactiveCommand.Create(OnExit);
+ lockScreen.ThrownExceptions.Subscribe(ex => Logging.Logger.LogWarning<ExitCommands>(ex));
exit.ThrownExceptions.Subscribe(Logging.Logger.LogWarning<ExitCommands>);
+ LockScreenCommand = new CommandDefinition(
+ "Lock Screen",
+ commandIconService.GetCompletionKindImage("Lock"),
+ lockScreen);
+
ExitCommand = new CommandDefinition(
"Exit",
commandIconService.GetCompletionKindImage("Exit"),
exit);
}
+ private void OnLockScreen()
+ {
+ Global.UiConfig.LockScreenActive = true;
+ }
+
private void OnExit()
{
Application.Current.MainWindow.Close();

DELETE
WalletWasabi.Gui/Shell/Commands/LockScreenCommands.cs
-using Avalonia;
-using AvalonStudio.Commands;
-using ReactiveUI;
-using System;
-using System.Composition;
-using WalletWasabi.Helpers;
-
-namespace WalletWasabi.Gui.Shell.Commands
-{
- internal class LockScreenCommands
- {
- public Global Global { get; }
-
- [ExportCommandDefinition("File.LockScreen")]
- public CommandDefinition LockScreenCommand { get; }
-
- [ImportingConstructor]
- public LockScreenCommands(CommandIconService commandIconService, AvaloniaGlobalComponent global)
- {
- Global = Guard.NotNull(nameof(Global), global.Global);
-
- var lockScreen = ReactiveCommand.Create(OnLockScreen);
-
- lockScreen.ThrownExceptions.Subscribe(ex => Logging.Logger.LogWarning<LockScreenCommands>(ex));
-
- LockScreenCommand = new CommandDefinition(
- "Lock Screen",
- commandIconService.GetCompletionKindImage("Lock"),
- lockScreen);
- }
-
- private void OnLockScreen()
- {
- Global.UiConfig.LockScreenActive = true;
- }
- }
-}

MODIFY
WalletWasabi.Gui/Shell/MainMenu/FileMainMenuItems.cs
WalletWasabi.Gui/Shell/MainMenu/FileMainMenuItems.cs
@@ -68,7 +68,7 @@ namespace WalletWasabi.Gui.Shell.MainMenu
public IMenuItem LockScreen => MenuItemFactory.CreateCommandMenuItem("File.LockScreen");
[ExportMainMenuItem("File", "Exit")]
- [DefaultOrder(4)]
+ [DefaultOrder(5)]
[DefaultGroup("Exit")]
public IMenuItem Exit => MenuItemFactory.CreateCommandMenuItem("File.Exit");

Put lockscreencommand into exitcommands