A convenience type to express a constructor in a covariant way.
A default global factory for PAM
Instantiate a new widget from the factory.
The registered name of the widget to create
Get an attached property from the factory.
The registered name of the property
Register an attached property into the factory.
What name this property will be referenced by.
The AttachedProperty being registered.
Attached property names must begin with an uppercase letter! This allows the loader to differentiate between HTML attributes and attached properties. They must also be valid XML attribute names, but this function won't check for that. Of note; attribute names may include a dot.
Register a new widget into the factory.
What name this widget will be referenced by in the markup.
The constructor for the widget being registered.
The constructor should take no arguments.
TODO: Should we add additional props for things like attribute validation and has-children?
TODO: Should we perform normalization? HTML (and SGML in general) is generally case insensitive, whereas XML is generally case sensitive. This may cause problems, either in user understanding or interfacing with the HTML DOM.
Generated using TypeDoc
A widget factory for PAM applications.
To add your own widgets and properties to the PAM markup, use this factory to make them available to the parser.
For example, if you had a
PuppyWidget
that you wanted to use:WidgetFactory.global.registerWidget("Puppy", PuppyWidget);
Now you can use your
PuppyWidget
in PAM:<TabPanel> <Puppy /> <Puppy /> <TabPanel>
You can name widgets whatever you like, as long as they are valid XML tag names. That means you can have a
Dog.Puppy
,_Puppy42
, and evenಠ_ಠ
as names!Attached Properties
Attached Properties follow along the same lines as above, with one important caveat: All Attached Property names must begin with an uppercase character! This is to distinguish them from regular attributes, which are copied to the HTML DOM node directly.
<TabPanel> <Puppy MyPuppyProp="5" /> <!--works--> <Puppy myOtherProp="3" /> <!--doesn't work--> </TabPanel>
Another thing to keep in mind is that right now, AttachedProperties must be strings. I hope to fix this sooner or later, but don't have a workaround right now.