Browse Source

add an options class for ClassicDesktopStyleApplicationLifeCycle.

pull/5639/head
Dan Walmsley 6 years ago
parent
commit
344c876c44
  1. 11
      src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs

11
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<ClassicDesktopStyleApplicationLifetimeOptions>();
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

Loading…
Cancel
Save