protected override void OnStartup(StartupEventArgs e) { if (e.Args.Length == 2) { if (e.Args[0] == "command") { InterProcessCommunication.SendCommand(e.Args[1]); Shutdown(0); } } CommandLine.Handler.Handle(e.Args); Task.Run(() => { Thread.CurrentThread.Name = "Avalonia"; avaloniaApplication = AppBuilder.Configure <AvaloniaApp>() .UsePlatformDetect() .UseReactiveUI() .LogToDebug() .SetupWithoutStarting() .Instance; avaloniaApplication.ExitMode = ExitMode.OnExplicitExit; avaloniaApplication.Run(applicationClosedTokenSource.Token); }); base.OnStartup(e); }
protected override void OnStartup(StartupEventArgs e) { if (e.Args.Length == 2) { if (e.Args[0] == "command") { InterProcessCommunication.SendCommand(e.Args[1]); Shutdown(0); } } base.OnStartup(e); }