CTFontManager.Notifications.ObserveRegisteredFontsChanged Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Strongly typed notification for the P:CoreText.CTFontManager.RegisteredFontsChangedNotification constant.
public static Foundation.NSObject ObserveRegisteredFontsChanged (EventHandler<Foundation.NSNotificationEventArgs> handler);
static member ObserveRegisteredFontsChanged : EventHandler<Foundation.NSNotificationEventArgs> -> Foundation.NSObject
Parameters
- handler
- EventHandler<NSNotificationEventArgs>
Method to invoke when the notification is posted.
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 for P:CoreText.CTFontManager.RegisteredFontsChangedNotification notifications.
// Listen to all notifications posted for any object
var token = CTFontManager.Notifications.ObserveRegisteredFontsChanged ((notification) => {
Console.WriteLine ("Observed RegisteredFontsChangedNotification!");
};
// Listen to all notifications posted for a single object
var token = CTFontManager.Notifications.ObserveRegisteredFontsChanged (objectToObserve, (notification) => {
Console.WriteLine ($"Observed RegisteredFontsChangedNotification for {nameof (objectToObserve)}!");
};
// Stop listening for notifications
token.Dispose ();