Skip to main content

IActivatableLifetime Interface

Definition​

Assembly:Avalonia.Controls
Package:Avalonia

An interface for ApplicationLifetimes where the application can be Activated and Deactivated.

public interface IActivatableLifetime

Methods​

NameDescription
TryEnterBackgroundTells the application that it should attempt to enter its background state. For example on OSX this would be [NSApp hide]
TryLeaveBackgroundTells the application that it should attempt to leave its background state. For example on OSX this would be [NSApp unhide]

TryEnterBackground Method​

Tells the application that it should attempt to enter its background state. For example on OSX this would be [NSApp hide]

public bool TryEnterBackground()

Returns​

bool

true if it was possible and the platform supports this. false otherwise

TryLeaveBackground Method​

Tells the application that it should attempt to leave its background state. For example on OSX this would be [NSApp unhide]

public bool TryLeaveBackground()

Returns​

bool

true if it was possible and the platform supports this. false otherwise

Events​

NameDescription
ActivatedAn event that is raised when the application is Activated for various reasons as described by the Avalonia.Controls.ApplicationLifetimes.ActivationKind enumeration.
DeactivatedAn event that is raised when the application is Deactivated for various reasons as described by the Avalonia.Controls.ApplicationLifetimes.ActivationKind enumeration.

Activated Event​

An event that is raised when the application is Activated for various reasons as described by the Avalonia.Controls.ApplicationLifetimes.ActivationKind enumeration.

public event EventHandler<Avalonia.Controls.ApplicationLifetimes.ActivatedEventArgs> Activated

Deactivated Event​

An event that is raised when the application is Deactivated for various reasons as described by the Avalonia.Controls.ApplicationLifetimes.ActivationKind enumeration.

public event EventHandler<Avalonia.Controls.ApplicationLifetimes.ActivatedEventArgs> Deactivated