Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Displaying different class instances in a ListView

$
0
0

Let's say I have a super class called Vehicle. Furthermore I've have three subclasses called Motorcycle, Car, Boat. In my app I want the user to be able to list all of his/her vehicles, that is I want to be able to display all instances of the three subclasses and set them as my ListView.Itemsource. How would you have implemented such scenario? Is it possible to use a List as ItemSource?

At the moment I use a "ListHelperClass" which contains all possible parameters that the subclasses contains. Once all instances are converted to my helper class I set it as my ItemSource.


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>