Please forgive this if the answer is obvious.. I am fairly new to Xamarin, but not to programing or C#.
I have a ListView that works and binds just fine to the top level object and it immediate properties:
public ObservableCollection ActiveGamesCollection { get; } = new ObservableCollection();
public class GameDTOModel
{
public int Id { get; set; }
public string Name { get; set; }
public string Details { get; set; } .....
.
.
public GameType gametype { get; set; } // Which Type of Game is used in this game
.
... etc
}
public class GameType
{
public int Id { get; set; }
public string Name { get; set; }
public virtual ICollection<Prize> Prizes { get; set; }
...etc
}
public class Prize
{
public int Id { get; set; }
public string Name { get; set; }
public string ImageURL { get; set; }
...etc
}
On the main page I have a list view of available games...
<ListView x:Name="GamesView" ItemSelected="GamesViewItemSelected">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout BackgroundColor="#eee" Orientation="Vertical">
.... stuff ....
<StackLayout Orientation="Horizontal">
... more stuff ...
</StackLayout>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
The data source is in the code behind:
GamesView.ItemsSource = gamesmodel.ActiveGamesCollection;
GamesView.SelectedItem = gamesmodel.SelectedGame;
GamesView.IsPullToRefreshEnabled = true;
This all works pretty ok.
But I want to put a horizontal list of images (GameDTOModel.GameType.Prizes.ImageUrl)
But short of copying the Ilist to one directly in the GameDTOModel I cant figure out how to do it.
I see you cant nest a Listview (or shouldnt ...) I have used the syncfusion Listview to do it on the actual prize page where I have access to the objects.
I would like to do the same on he overview.
Thoughts?