First you add a new class as a ViewModel like:

public class RoomViewModel : BaseViewModel
   [here following code]

If you don’t have BaseViewModel try to download from nuget Refractored.MvvmHelpers. Then in your class define an observable collection like

  public ObservableCollection<RoomRecommandation> _roomSuggestionList = 
               new ObservableCollection<RoomRecommandation>();
  public ObservableCollection<RoomRecommandation> Recommendations
     get { return _roomSuggestionList; }

In your ContentPage add a listview like:

<ListView ItemsSource="{Binding Recommendations}">
       <Grid Padding="10" RowSpacing="10" ColumnSpacing="10">
           <RowDefinition Height="" />
           <ColumnDefinition Width="Auto" />
           <ColumnDefinition Width="" />
           <ColumnDefinition Width="Auto" />
         <controls:CircleImage Grid.Column="0" BorderColor="#DDD3CB" 
                               BorderThickness="3" WidthRequest="66"
                               Source="{Binding Image}" />
         <Label Grid.Column="1" Text="{Binding Description}" 
                               VerticalOptions="Start" />
         <Label Grid.Column="2" Text="{Binding Price, StringFormat='£{0}'"
                               FontSize="Small" VerticalOptions="Start" />

Then in your ContentPage code:

  RoomViewModel vm = null;
  public RoomPage ()
      InitializeComponent ();

  public void LoadData()
      if (vm == null)
          vm = new RoomViewModel();
          BindingContext = vm;

Happy coding!

By Enrico

My greatest passion is technology. I am interested in multiple fields and I have a lot of experience in software design and development. I started professional development when I was 6 years. Today I am a strong full-stack .NET developer (C#, Xamarin, Azure)

This site uses Akismet to reduce spam. Learn how your comment data is processed.