Share via


UIApplication.Notifications.ObserveDidFinishLaunching Method

Definition

Overloads

ObserveDidFinishLaunching(EventHandler<UIApplicationLaunchEventArgs>)

Strongly typed notification for the DidFinishLaunchingNotification constant.

public static Foundation.NSObject ObserveDidFinishLaunching(EventHandler<UIKit.UIApplicationLaunchEventArgs> handler);
static member ObserveDidFinishLaunching : EventHandler<UIKit.UIApplicationLaunchEventArgs> -> Foundation.NSObject

Parameters

handler
EventHandler<UIApplicationLaunchEventArgs>

The handler that responds to the notification when it occurs.

Returns

Token object that can be used to stop receiving notifications by either disposing it or passing it to RemoveObservers(IEnumerable<NSObject>).

Remarks

This method can be used to subscribe to DidFinishLaunchingNotification notifications.

// Listen to all notifications posted for any object
var token = UIApplication.Notifications.ObserveDidFinishLaunching ((notification) => {
  Console.WriteLine ("Observed DidFinishLaunchingNotification!");
};

// Stop listening for notifications
token.Dispose ();

Applies to

ObserveDidFinishLaunching(NSObject, EventHandler<UIApplicationLaunchEventArgs>)

Strongly typed notification for the DidFinishLaunchingNotification constant.

public static Foundation.NSObject ObserveDidFinishLaunching(Foundation.NSObject objectToObserve, EventHandler<UIKit.UIApplicationLaunchEventArgs> handler);
static member ObserveDidFinishLaunching : Foundation.NSObject * EventHandler<UIKit.UIApplicationLaunchEventArgs> -> Foundation.NSObject

Parameters

objectToObserve
NSObject

The specific object to observe.

handler
EventHandler<UIApplicationLaunchEventArgs>

The handler that responds to the notification when it occurs.

Returns

Token object that can be used to stop receiving notifications by either disposing it or passing it to RemoveObservers(IEnumerable<NSObject>).

Remarks

This method can be used to subscribe to DidFinishLaunchingNotification notifications.

// Listen to all notifications posted for a single object
var token = UIApplication.Notifications.ObserveDidFinishLaunching (objectToObserve, (notification) => {
  Console.WriteLine ($"Observed DidFinishLaunchingNotification for {nameof (objectToObserve)}!");
};

// Stop listening for notifications
token.Dispose ();

Applies to