iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
In most apps Composite ViewModel is helpful, such as in Home Page. Multiple subviews can have different data sources. It is easy to implement this in native development environments, just create some subviews/controllers under a parent view and load data into them seperately. But in Crosslight, I don't know how to do this. The sismular one in Crosslight is MultiPageViewModelBase/UITabBarController, it can hold multiple subviews.
Can you give me some suggestions?
Assume I will create a home page as below:
There are several sub-views under the home page view. Some of them are simple UIView, some of them are TableView/ScrollView, they bind to the different datasources. I tried nested viewmodels and tried to bind sub-views to the sub-viewmodels, but it does not work.
Do you have any solutions?
Dear Leo,
Yes, Crosslight supports composite view scenario since its data binding is built specifically for each view component. In your case, your view can have any number of list controls such as table view and collection view. Of course, you will have to register different ID for each of your view using the RegisterViewIdentifier method in the code behind of your view controller (you'll find this in most of our samples).
In your ViewModel, you need to have the property that represent the datasource for each list control. For instance, your ViewModel can have these properties:
public IList<Album> HotAlbums { ... }
public IList<Album> EditorPicks { ... }
Finally, make sure you bind these properties to the correct target ID in the binding provider. At the most minimum, you will need to bind the ItemsSource property and ItemBindingDescription property.
Hope this helps.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname