{
"type": "Xamarin.Forms.ListView",
"customType": "Fabulous.XamarinForms.CustomListView",
"canBeInstantiated": true,
"name": "ListView",
"properties": [
// See Property
],
"events": [
// See Event
],
"attachedProperties": [
// See Attached Property
]
}
Field
Type
Required
Description
Type
string
✅ Yes
Full name of a control inside one of the dlls to bind
CustomType
string
❌ No
If specified, this type will be used when instantiating this control instead of the binded type. Not necessary that the control exists at generation time
CanBeInstantiated
boolean
❌ No
Indicates if the code generator should provide a public constructor for this type. If not specified, the value defaults to true
Name
boolean
❌ No
The name that will be used when generating code (e.g. View.MyCustomControl()). If not specified, the name will be inferred from the Type field
Properties
Property array
❌ No
All properties of this control to include in the code generation
Events
Event array
❌ No
All events of this control to include in the code generation
AttachedProperties
AttachedProperty array
❌ No
All attached properties of this control to include in the code generation
Name of the property used in the generated code (e.g. buttonViewElement.MyProperty(value))
If not specified, Source will be used instead
UniqueName
string
❌ No
Name to uniquely identify the property in the generated code
Use with caution. If not specified, Type and Name will be concatenated to create a unique name. (e.g. ButtonText). Subject to optimization
ShortName
string
❌ No
Name (lower camel case) to use in ViewElement constructor (e.g. View.Button(myProperty=value))
If not specified, Name will be used in lower camel case
DefaultValue
string
❓Depends
Default value to apply to the property if none is given by the user (e.g. 0.0f)
ElementType
string
❓Depends
(Apply only if property is a collection) Full name of the item type of the collection
If null, the property is not considered to be a collection
InputType
string
❓Depends
Type expected in the constructor (e.g. string => View.Button(text = "some string"))
ModelType
string
❌ No
Type as which the value will be stored in the ViewElement attributes dictionary
Make sure this type is efficient
ConvertInputToModel
string
❌ No
Function to convert the input value to the model type
Expects a signature of type 'Input -> 'Model. Function can be written directly inside the json, or make a reference to a function. If not specified, no conversion will be applied.
ConvertModelToValue
string
❌ No
Function to convert the model value to the expected type of the real property
Expects a signature of type 'Model -> 'Value. Function can be written directly inside the json, or make a reference to a function. If not specified, no conversion will be applied.
UpdateCode
string
❌ No
Function to use instead of the generated view diffing for this property
Expects a signature of type prev: ViewElement -> curr: ViewElement -> target: ControlType -> unit. Function can be written directly inside the json, or make a reference to a function. If not specified, the default view diffing code will be used.
There is 3 different categories of property:
Existing scalar property: A property present in one of the dlls to include with a simple data type
Existing collection property: A property present in one of the dlls to include which is a collection (e.g. Xamarin.Forms.View list)
Dummy property: A non-existent property to include which can be either of type scalar or collection
Name of the event used in the generated code (e.g. entryViewElement.TextChanged(value))
If not specified, Source will be used instead
UniqueName
string
❌ No
Name to uniquely identify the event in the generated code
Use with caution. If not specified, Type and Name will be concatenated to create a unique name. (e.g. EntryTextChanged). Subject to optimization
ShortName
string
❌ No
Name (lower camel case) to use in ViewElement constructor (e.g. View.Button(myProperty=value))
If not specified, Name will be used in lower camel case
InputType
string
❓Depends
Type expected in the constructor (e.g. Xamarin.Forms.TextChangedEventArgs -> unit => View.Button(textChanged = (fun args -> ())))
Expects a function
ModelType
string
❓Depends
Type as which the value will be stored in the ViewElement attributes dictionary
Expects an EventHandler
ConvertInputToModel
string
❓Depends
Function to convert the input value to the model type
Expects a signature of type 'Input -> 'Model. Function can be written directly inside the json, or make a reference to a function. If not specified, no conversion will be applied.
Name of the attached property to include (and overwrite)
TargetType
string
❌ No
Type to which this attached property will be applied to
If not specified, a default base target type will be applied
Name
string
❓ Depends
Name of the property used in the generated code (e.g. buttonViewElement.MyProperty(value))
If not specified, Source will be used instead
UniqueName
string
❌ No
Name to uniquely identify the property in the generated code
Use with caution. If not specified, Type and Name will be concatenated to create a unique name. (e.g. ButtonText). Subject to optimization
DefaultValue
string
❓ Depends
Default value to apply to the property if none is given by the user (e.g. 0.0f)
If not specified, Name will be used in lower camel case
ElementType
string
❓ Depends
(Apply only if attached property is a collection) Full name of the item type of the collection
If null, the attached property is not considered to be a collection
InputType
string
❓ Depends
Type expected in the constructor (e.g. string => View.Button(text = "some string"))
ModelType
string
❌ No
Type as which the value will be stored in the ViewElement attributes dictionary
Make sure this type is efficient
ConvertInputToModel
string
❌ No
Function to convert the input value to the model type
Expects a signature of type 'Input -> 'Model. Function can be written directly inside the json, or make a reference to a function. If not specified, no conversion will be applied.
ConvertModelToValue
string
❌ No
Function to convert the model value to the expected type of the real property
Expects a signature of type 'Model -> 'Value. Function can be written directly inside the json, or make a reference to a function. If not specified, no conversion will be applied.
UpdateCode
string
❌ No
Function to use instead of the generated view diffing for this property
Expects a signature of type prev: ViewElement -> curr: ViewElement -> target: ControlType -> unit. Function can be written directly inside the json, or make a reference to a function. If not specified, the default view diffing code will be used.