Properties
Remarks: Some platforms may use this to identify controls (e.g. web)
LocalizedName
#Gets the localized name of the font for the current UI language
Remarks: This will return a name suitable to display to the user in their own language, if the font provides a specific name for their UI language. For platforms that do not support localized font names, or for fonts that do not have a specific name for the current language, the value of Name will be returned.
Value: The localized name of this font.
Name
#Gets the name of the font family
Remarks: This should be the same as what is used to create new instances of a font family using the Create(string) method
NativeHandle
nint NativeHandle { get; }
Gets the native platform-specific handle for integration purposes
Value: The native handle.
Methods
Create
#Creates a new instance of a font family with a given name
Parameters:
| familyName (string) | Name of the font family to create this instance for |
CreateFromFiles
#Creates a new instance of a font family with the given file names.
Parameters:
| fileNames (IEnumerable<string>) | Paths to the font files to include in this FontFamily |
CreateFromStreams
#Creates a new instance of a font family with the given font file streams.
Parameters:
| streams (IEnumerable<Stream>) | Streams to each of the font files to include in this FontFamily |
Remarks: Most events are late bound by this method. Instead of wiring all events, this will be called with an event string that is defined by the control. This is called automatically when attaching to events, but must be called manually when users of the control only override the event's On... method.
Initialize
void Initialize()
Called after the widget is constructed
Remarks: This gets called automatically after the control is constructed and the Widget.IHandler.Widget and Widget.Platform properties are set. When the handler has specialized construction methods, then the AutoInitializeAttribute can be used to disable automatic initialization. In this case, it is the responsibility of the subclass to call Widget.Initialize()
UnhandleEvent
Called when the last subscriber to an event has been removed, so the platform can stop listening for it.
Remarks: Only reached for events whose remove accessor uses PropertyStore.RemoveHandlerEvent(string, Delegate), and only for events that were attached because something subscribed to them. An event attached because the widget overrides its On[Event] method is never detached, since it has to keep firing regardless. Most events stay attached for the life of the widget, which costs nothing. Detaching is worth wiring up for the few that hold onto something expensive or process wide while they are attached, such as a system wide hook. Handlers deriving from WidgetHandler<TWidget> get an implementation of this that dispatches to WidgetHandler<TWidget>.DetachEvent(string), which is what to override.
Parameters:
| id (string) | ID of the event to stop handling |