Fairly new to Xamarin Forms with a lot of background in C# ASP.Net MVC background. I am wondering what the best pattern would be in Xamarin Forms to pass more complex data models to a xaml view. What I am trying to achieve is passing the following data model:
String DateHeader
ObservableCollection<CustomObject>
String DateHeader
ObservableCollection<CustomObject>
String DateHeader
ObservableCollection<CustomObject>
String DateHeader
ObservableCollection<CustomObject>
String DateHeader
ObservableCollection<CustomObject>
To a RefreshView collection:
<RefreshView IsRefreshing="{Binding IsRefreshing}" Command="{Binding GetCustomObjectModelCommand}">
<CollectionView ItemsSource="{Binding CustomObjectModel}">
<CollectionView.ItemsLayout>
<LinearItemsLayout Orientation="Vertical"/>
</CollectionView.ItemsLayout>
<CollectionView.ItemTemplate>
<DataTemplate>
<StackLayout Padding="10">
// Data goes here
</StackLayout>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</RefreshView>
I currently have a model of single ObservableCollection passing back and binding working fine. In ASP.Net MVC I'd just had each and loop in the view, but trying to figure out how that is achieved in Xamarin Forms since there is less view logic.
The goal for the UI output would be something like:
Date Header
- list collection item
- list collection item
- list collection item
- list collection item
- list collection item
Date Header
- list collection item
- list collection item
- list collection item
- list collection item
- list collection item
Date Header
- list collection item
- list collection item
- list collection item
- list collection item
- list collection item
etc....
question from:
https://stackoverflow.com/questions/65881305/passing-and-binding-multiple-strings-and-observablecollection-to-refreshview-c 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…