title: Xamarin Forms Collectionview not showing anything on UI even when binding is set and data is added to observable collection
body: <p>I am quite a beginner so take it easy on me. I have a collection view which is bound to an observable collection. The observable collection receives data and has the items but the Collectionview doesn't display anything at all. Could someone please help me with this. Thanks.</p>
  <p>XAML</p>
  <pre><code>        &lt;CollectionView Grid.Row=&quot;1&quot; ItemsSource=&quot;{Binding Fav}&quot; x:Name=&quot;CVWatchItems&quot; SelectionMode=&quot;Single&quot; SelectionChanged=&quot;CVWatchItems_SelectionChangedAsync&quot;&gt;
              &lt;CollectionView.ItemTemplate&gt;
                  &lt;DataTemplate&gt;
                      &lt;StackLayout Padding=&quot;8, 8, 8, 0&quot;&gt;
                          &lt;Frame BorderColor=&quot;LightGray&quot; CornerRadius=&quot;0&quot; HasShadow=&quot;True&quot; Padding=&quot;5&quot;&gt;
                              &lt;Grid Padding=&quot;0&quot; ColumnSpacing=&quot;0&quot; RowSpacing=&quot;0&quot; Margin=&quot;2&quot;&gt;
                                  &lt;Grid.RowDefinitions&gt;
                                      &lt;RowDefinition Height=&quot;*&quot; /&gt;
                                  &lt;/Grid.RowDefinitions&gt;
                                  &lt;Grid.ColumnDefinitions&gt;
                                      &lt;ColumnDefinition Width=&quot;120&quot;/&gt;
                                      &lt;ColumnDefinition Width=&quot;*&quot;/&gt;
                                  &lt;/Grid.ColumnDefinitions&gt;
  
                                  &lt;ffimageloading:CachedImage Source=&quot;{Binding SingleimageUrl}&quot; Aspect=&quot;AspectFill&quot; WidthRequest=&quot;120&quot; HeightRequest=&quot;100&quot; Grid.Row=&quot;0&quot; Grid.Column=&quot;0&quot;/&gt;
  
                                  &lt;Grid Grid.Row=&quot;0&quot; Grid.Column=&quot;1&quot; Padding=&quot;5&quot;&gt;
                                      &lt;Grid.RowDefinitions&gt;
                                          &lt;RowDefinition Height=&quot;Auto&quot;/&gt;
                                          &lt;RowDefinition Height=&quot;Auto&quot;/&gt;
                                          &lt;RowDefinition Height=&quot;*&quot;/&gt;
                                      &lt;/Grid.RowDefinitions&gt;
                                      &lt;Label Padding=&quot;0, 0, 0, 3&quot; Text=&quot;{Binding Title}&quot; LineBreakMode=&quot;TailTruncation&quot; TextColor=&quot;Black&quot; FontSize=&quot;Medium&quot; Grid.Row=&quot;0&quot;/&gt;
                                      &lt;Label Text=&quot;{Binding Price, StringFormat='Nu.{0}'}&quot; FontSize=&quot;Small&quot; TextColor=&quot;Black&quot;  Grid.Row=&quot;1&quot;  HorizontalOptions=&quot;StartAndExpand&quot; /&gt;
                                      &lt;Grid Grid.Row=&quot;2&quot;&gt;
                                          &lt;Grid.ColumnDefinitions&gt;
                                              &lt;ColumnDefinition Width=&quot;7*&quot;/&gt;
                                              &lt;ColumnDefinition Width=&quot;Auto&quot;/&gt;
                                          &lt;/Grid.ColumnDefinitions&gt;
  
                                          &lt;Label Text=&quot;{Binding location}&quot; FontSize=&quot;Small&quot; TextColor=&quot;Gray&quot; Grid.Column=&quot;0&quot; HorizontalOptions=&quot;StartAndExpand&quot; VerticalOptions=&quot;EndAndExpand&quot;/&gt;
                                          &lt;!--Watchlist Icon--&gt;
                                          &lt;Image Source=&quot;{Binding Favorite}&quot; Grid.Column=&quot;1&quot; Aspect=&quot;AspectFill&quot; HeightRequest=&quot;28&quot; Margin=&quot;2, 0&quot; HorizontalOptions=&quot;EndAndExpand&quot; VerticalOptions=&quot;EndAndExpand&quot;&gt;
                                              &lt;Image.GestureRecognizers&gt;
                                                  &lt;TapGestureRecognizer Tapped=&quot;TapGestureRecognizer_Tapped&quot;/&gt;
                                                  &lt;!--Give ID to each ad and stored data is retrieved through id.--&gt;
                                              &lt;/Image.GestureRecognizers&gt;
                                          &lt;/Image&gt;
                                      &lt;/Grid&gt;
                                  &lt;/Grid&gt;
  
                              &lt;/Grid&gt;
                          &lt;/Frame&gt;
                      &lt;/StackLayout&gt;
                  &lt;/DataTemplate&gt;
              &lt;/CollectionView.ItemTemplate&gt;
          &lt;/CollectionView&gt;
  </code></pre>
  <p>Code behind</p>
  <pre><code>   public static ObservableCollection&lt;Item&gt; Fav { get; set; } = new ObservableCollection&lt;Item&gt;();
     public Watchlist ()
      {
          InitializeComponent ();
          NavigationPage.SetHasNavigationBar(this, false);
          NavigationPage.SetHasBackButton(this, false);
  
          CVWatchItems.SetBinding(CollectionView.ItemsSourceProperty, nameof(Fav));
  
          GetFavItems();
      }  
  
      private async void GetFavItems()
      {
          var MyFavorites = await Task.WhenAll(FirebaseDataHelper.GetFavoriteItems(allFavorites));
          
                  foreach (var favorite in MyFavorites)
                  {
                      if (favorite.Count &gt; 0)
                      {
                          for (int i = 0; i &lt; favorite.Count; i++)
                          {
                              favorite[i].IsFavorite = true;
                              if (!Fav.Any(s =&gt; s.Id == favorite[i].Id))
                                  Fav.Add(favorite[i]);
                                  
                          }
                      }
                  }
  
                 
        }
  </code></pre>
  <p>Thanks guys.</p>