deserialize method
Deserializes the FML template elements, attributes and children
Implementation
@override
void deserialize(XmlElement xml)
{
// deserialize
super.deserialize(xml);
// clear items
this.items.forEach((item) => item.dispose());
this.items.clear();
// build items
List<MenuItemModel> items = findChildrenOfExactType(MenuItemModel).cast<MenuItemModel>();
// set prototype
if ((!S.isNullOrEmpty(datasource)) && (items.isNotEmpty))
{
prototype = S.toPrototype(items[0].element.toString());
items.removeAt(0);
}
// build items
items.forEach((item) => this.items.add(item));
}