title: Data from view model not binding to view - Xamarin Forms, Reactive UI
body: <p>Welcome, I'm trying to bind array of strings to collection view item source, but it seems like my view model can't pass data, or isn't activated at all. I'm stuck at this moment. I tried to search on the internet and couldnt find any solution, also tried exacly as shown in the reactive ui sample, and stil same results, or should I say, no results.</p>
  <p>View:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  
  &lt;xamForms:ReactiveContentPage x:TypeArguments=&quot;dashboard:DashboardViewModel&quot; xmlns=&quot;http://xamarin.com/schemas/2014/forms&quot;
                                xmlns:x=&quot;http://schemas.microsoft.com/winfx/2009/xaml&quot;
                                xmlns:xamForms=&quot;clr-namespace:ReactiveUI.XamForms;assembly=ReactiveUI.XamForms&quot;
                                xmlns:dashboard=&quot;clr-namespace:RoutinesTracker.Pages.Dashboard;assembly=RoutinesTracker&quot;
                                x:Class=&quot;RoutinesTracker.Pages.Dashboard.DashboardView&quot;
                                Title=&quot;Home&quot;
                                BackgroundColor=&quot;{DynamicResource PageBackgroundColor}&quot;&gt;
      &lt;ContentPage.Content&gt;
          &lt;StackLayout Padding=&quot;15, 20&quot;&gt;
              
              &lt;CollectionView x:Name=&quot;ExampleCollectionView&quot;&gt;
                  &lt;CollectionView.ItemTemplate&gt;
                      &lt;DataTemplate x:DataType=&quot;x:String&quot;&gt;
                          &lt;StackLayout&gt;
                              &lt;Frame 
                                  CornerRadius=&quot;15&quot; 
                                  HasShadow=&quot;False&quot;
                                  BackgroundColor=&quot;{DynamicResource PageElementColor}&quot;
                                  Margin=&quot;0, 5&quot;&gt;
                                  &lt;StackLayout&gt;
                                      &lt;Label Text=&quot;{Binding}&quot;
                                             VerticalOptions=&quot;CenterAndExpand&quot;
                                             HorizontalOptions=&quot;CenterAndExpand&quot; 
                                             TextColor=&quot;{DynamicResource PrimaryTextColor}&quot;/&gt;
                                  &lt;/StackLayout&gt;
                              &lt;/Frame&gt;
                          &lt;/StackLayout&gt;
                      &lt;/DataTemplate&gt;
                  &lt;/CollectionView.ItemTemplate&gt;
              &lt;/CollectionView&gt;
          &lt;/StackLayout&gt;
      &lt;/ContentPage.Content&gt;
  &lt;/xamForms:ReactiveContentPage&gt;
  </code></pre>
  <p>View.cs</p>
  <pre><code>using ReactiveUI;
  using Xamarin.Forms.Xaml;
  
  namespace RoutinesTracker.Pages.Dashboard
  {
      [XamlCompilation(XamlCompilationOptions.Compile)]
      public partial class DashboardView
      {
          public DashboardView()
          {
              InitializeComponent();
  
              this.WhenActivated(disposable =&gt;
              {
                  this.OneWayBind(ViewModel, vm =&gt; vm.ExampleCollectionList, v =&gt; v.ExampleCollectionView.ItemsSource);
              });
          }
      }
  }
  </code></pre>
  <p>ViewModel</p>
  <pre><code>using Prism.Navigation;
  using RoutinesTracker.Core.Layout.ViewModels;
  
  namespace RoutinesTracker.Pages.Dashboard
  {
      public abstract class DashboardViewModel : ViewModelBase
      {
          public string[] ExampleCollectionList { get; set; }
  
          protected DashboardViewModel(INavigationService navigationService) : base(navigationService)
          {
              ExampleCollectionList = new[]
              {
                  &quot;Item 1&quot;,
                  &quot;Item 2&quot;,
                  &quot;Item 3&quot;,
                  &quot;Item 4&quot;,
                  &quot;Item 5&quot;
              };
          }
      }
  }
  </code></pre>
  <p>And if anyone need, ViewModelBase class:</p>
  <pre><code>using Prism.Navigation;
  using ReactiveUI;
  
  namespace RoutinesTracker.Core.Layout.ViewModels
  {
      public abstract class ViewModelBase : ReactiveObject
      {
          private readonly INavigationService _navigationService;
  
          protected ViewModelBase(INavigationService navigationService) =&gt; _navigationService = navigationService;
      }
  }
  </code></pre>