In addition to hand-crafted Json, I'm looking at the idea of allowing users to provide a simple description within each ViewModel.
I initially started this by looking at using Attributes, but now I'm moving more towards getting the user to provide descriptive methods, like the one below. This code is now working on Droid - but some refactoring is still needed to properly integrate it and to make it really beautiful.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public ElementDescription DefaultView() | |
{ | |
var auto = new RootAuto(caption: "TestRootElement") | |
{ | |
new SectionAuto(header: "Customer Info") | |
{ | |
new StringAuto(caption: "ID", bindingExpression: () => Customer.ID), | |
new StringAuto(caption: "Name", bindingExpression: () => Customer.Name), | |
new StringAuto(caption: "Website", | |
bindingExpression: () => Customer.Website, | |
selectedCommand: () => ShowWebsiteCommand), | |
new StringAuto(caption: "Phone", | |
bindingExpression: () => Customer.PrimaryPhone, | |
selectedCommand: () => CallCustomerCommand), | |
}, | |
new SectionAuto(header: "General Info") | |
{ | |
new StringAuto(caption: "Address", | |
bindingExpression: () => Customer.PrimaryAddress, | |
selectedCommand: () => ShowOnMapCommand), | |
} | |
}; | |
return auto.ToElementDescription(); | |
} |
No comments:
Post a Comment