diff --git a/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs b/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs index f8606fcd6f..07a0510f13 100644 --- a/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs +++ b/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs @@ -104,7 +104,9 @@ namespace Avalonia.Controls.ApplicationLifetimes { Startup?.Invoke(this, new ControlledApplicationLifetimeStartupEventArgs(args)); - if (args.Length > 0) + var options = AvaloniaLocator.Current.GetService(); + + if(options != null && options.ProcessUrlActivationCommandLine && args.Length > 0) { ((IApplicationPlatformEvents)Application.Current).RaiseUrlsOpened(args); } @@ -122,6 +124,13 @@ namespace Avalonia.Controls.ApplicationLifetimes _activeLifetime = null; } } + + public class ClassicDesktopStyleApplicationLifetimeOptions + { + public bool ProcessUrlActivationCommandLine { get; set; } + + public bool IsSingleInstance { get; set; } + } } namespace Avalonia