title: Xamarin Forms UWP Does Not React to Bindingcontext
body: <p>I am working on a xamarin forms open source project, the app pulls data from id.wikihow.com.</p>
  
  <p>Github repo : <a href="https://github.com/become90/Otodidak" rel="nofollow noreferrer">https://github.com/become90/Otodidak</a></p>
  
  <p>My problem is the app works on Android but not quite works on UWP.</p>
  
  <p>No data displayed on the view on UWP, it just blank.
  The view reacts if the data is local.</p>
  
  <p>UPDATE :
  On further investigation, i checked if the INotifyPropertyChanged Handler is triggered on UWP, and it's triggered. But somehow the view does not reflect the viewmodel.</p>
  
  <p><a href="https://i.stack.imgur.com/kyBXX.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kyBXX.jpg" alt="enter image description here"></a></p>
  
  <p>Here is my viewmodel :</p>
  
  <pre><code>namespace Otodidak.ViewModels
   {
  public class HalamanUtamaViewModel:BaseViewModel
  {
      public ObservableRangeCollection&lt;Post&gt; BodyPosts { get; set; }
      public ObservableRangeCollection&lt;Post&gt; HeaderPosts { get; set; } 
  
      public Command LoadHeaderCommand { get; set; }
      public Command LoadBodyCommand { get; set; }
  
      public HalamanUtamaViewModel()
      {
          HeaderPosts = new ObservableRangeCollection&lt;Post&gt;();
          BodyPosts = new ObservableRangeCollection&lt;Post&gt;();
  
          LoadHeaderCommand = new Command(async () =&gt; await ExecuteHeaderCommand());
          LoadBodyCommand = new Command(async () =&gt; await ExecuteBodyCommand());
      }
  
      public async Task ExecuteHeaderCommand()
      {
          if (IsHeaderBusy)
              return;
  
          IsHeaderBusy = true;
  
          try
          {
              HeaderPosts.Clear();
              await getHeaderArticleData();
          }
          catch (Exception ex)
          {
              Debug.WriteLine(ex);
              MessagingCenter.Send(new MessagingCenterAlert
              {
                  Title = "Error",
                  Message = "Unable to load items.",
                  Cancel = "OK"
              }, "message");
          }
          finally
          {
              IsHeaderBusy = false;
          }
      }
  
      public async Task ExecuteBodyCommand()
      {
          if (IsBodyBusy)
              return;
  
          IsBodyBusy = true;
  
          try
          {
              BodyPosts.Clear();
              await getBodyArticleData();
          }
          catch (Exception ex)
          {
              Debug.WriteLine(ex);
              MessagingCenter.Send(new MessagingCenterAlert
              {
                  Title = "Error",
                  Message = "Unable to load items.",
                  Cancel = "OK"
              }, "message");
          }
          finally
          {
              IsBodyBusy = false;
          }
      }
  
      public async Task getHeaderArticle()
      {
          await getHeaderArticleData();
  
      }
  
      public async Task getHeaderArticleData()
      {
  
          if (HeaderPosts.Count != 0)
              return;
  
          string htmlPage;
  
          try
          {
              using (var client = new HttpClient())
              {
                  htmlPage = await client.GetStringAsync("http://id.wikihow.com/Halaman-Utama").ConfigureAwait(false);
              }
  
  
              htmlDocument.LoadHtml(htmlPage);
              var innerText = htmlDocument.DocumentNode
                  .Descendants("div")
                  .Where(o =&gt; o.GetAttributeValue("class", "") == "hp_top").ToList();
  
  
              foreach (var div in innerText)
              {
                  Post newPosts = new Post();
                  string imageUrl = "";
                  string title = "";
                  string url = "";
  
                  string htmlDiv = "&lt;html&gt;" + div.OuterHtml + "&lt;/html&gt;";
  
  
  
                  imageUrl = Regex.Match(htmlDiv, "&lt;img.+?src=[\"'](.+?)[\"'].*?&gt;", RegexOptions.IgnoreCase).Groups[1].Value;
                  title = Regex.Match(htmlDiv, "&lt;div.+?title=[\"'](.+?)[\"'].*?&gt;", RegexOptions.IgnoreCase).Groups[1].Value;
                  url = Regex.Match(htmlDiv, "&lt;a.+?href=[\"'](.+?)[\"'].*?&gt;", RegexOptions.IgnoreCase).Groups[1].Value;
                  title = WebUtility.HtmlDecode(title);
                  //HtmlDecode
                  //"http://id.wikihow.com" +
                  newPosts.Title ="CARA "+ title;
                  newPosts.ImageUrl = imageUrl;
                  newPosts.PostUrl = "http://id.wikihow.com" + url;
  
                  HeaderPosts.Add(newPosts);
  
              }
          }
          catch (Exception)
          {
  
          }
  
      }
  
      public async Task getBodyArticle()
      {
          await getBodyArticleData();
      }
  
      public async Task getBodyArticleData()
      {
          if (BodyPosts.Count != 0)
              return;
  
          string htmlPage;
  
          try
          {
              using (var client = new HttpClient())
              {
                  htmlPage = await client.GetStringAsync("http://id.wikihow.com/Halaman-Utama").ConfigureAwait(false);
              }
  
  
              htmlDocument.LoadHtml(htmlPage);
              var innerText = htmlDocument.DocumentNode
                  .Descendants("div")
                  .Where(o =&gt; o.GetAttributeValue("id", "") == "fa_container").FirstOrDefault();
  
              innerHtmlDocument.LoadHtml(innerText.OuterHtml);
  
              var td = innerHtmlDocument.DocumentNode
                  .Descendants("td").ToList();
  
              PostHelper ph = new PostHelper();
              var bodyposts = ph.GetPostFromTd(td);
              BodyPosts.ReplaceRange(bodyposts);
          }
          catch (Exception)
          {
  
          }
  
  
      }
  }
  
   }
  </code></pre>
  
  <p>Here is how i consume it</p>
  
  <pre><code> namespace Otodidak.Views
   {
  public partial class HeaderPage : ContentPage
  {
      HalamanUtamaViewModel vm;
  
      public HeaderPage()
      {
          InitializeComponent();
          BindingContext = vm = new HalamanUtamaViewModel();
          //BindingContext = vm = new HalamanUtamaViewModel();
      }
  
      async void OnItemSelected(object sender, SelectedItemChangedEventArgs args)
      {
          var item = args.SelectedItem as Post;
          if (item == null)
              return;
  
          await Navigation.PushModalAsync(new NavigationPage(new ItemDetailPage(new ItemDetailViewModel(item))));
  
          // Manually deselect item
          HeaderListView.SelectedItem = null;
      }
  
  
      protected override void OnAppearing()
      {
  
          base.OnAppearing();
          if (vm.HeaderPosts.Count == 0)
              vm.LoadHeaderCommand.Execute(null);
  
  
      }
  }
   }
  </code></pre>
  
  <p>And this is the xaml page</p>
  
  <pre><code>&lt;ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
           xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
           x:Class="Otodidak.Views.HeaderPage"
           Title="Halaman Utama"&gt;
  
  &lt;ContentPage.Content&gt;
      &lt;StackLayout&gt;
      &lt;ListView x:Name="HeaderListView"
                ItemsSource="{Binding HeaderPosts}"
                VerticalOptions="FillAndExpand"
                HasUnevenRows="true"
                RefreshCommand="{Binding LoadHeaderCommand}"
                IsPullToRefreshEnabled="true"
                IsRefreshing="{Binding IsHeaderBusy, Mode=OneWay}"
                CachingStrategy="RecycleElement"
                ItemSelected="OnItemSelected"&gt;
          &lt;ListView.ItemTemplate&gt;
              &lt;DataTemplate&gt;
                  &lt;ViewCell &gt;
                      &lt;Grid Margin="0,0,0,20"&gt;
                              &lt;Grid.RowDefinitions&gt;
                                  &lt;RowDefinition Height="*" /&gt;
                                  &lt;RowDefinition Height="Auto" /&gt;
                              &lt;/Grid.RowDefinitions&gt;
                              &lt;Image Aspect="AspectFill"
                                     HorizontalOptions="FillAndExpand"
                                     Source="{Binding ImageUrl}"
                                     Grid.Row="0"
                                     Grid.RowSpan="2" /&gt;
                              &lt;StackLayout Grid.Row="1"
                                           Orientation="Horizontal"
                                           VerticalOptions="Start"
                                           Padding="20"
                                           BackgroundColor="{StaticResource Primary}"&gt;
                                  &lt;Label TextColor="White"
                                         Text="{Binding Title, Converter={StaticResource UpperCaseHelper}}"
                                         FontSize="15"
                                         LineBreakMode="CharacterWrap"
                                         FontAttributes="Bold"&gt;
                                      &lt;Label.FontFamily&gt;
                                          &lt;OnPlatform x:TypeArguments="x:String"&gt;
                                              &lt;OnPlatform.iOS&gt;MarkerFelt-Thin&lt;/OnPlatform.iOS&gt;
                                              &lt;OnPlatform.Android&gt;Droid Sans Mono&lt;/OnPlatform.Android&gt;
                                              &lt;OnPlatform.WinPhone&gt;"Comic Sans MS&lt;/OnPlatform.WinPhone&gt;
                                          &lt;/OnPlatform&gt;
                                      &lt;/Label.FontFamily&gt;
                                  &lt;/Label&gt;
                          &lt;/StackLayout&gt;
                      &lt;/Grid&gt;
                  &lt;/ViewCell&gt;
              &lt;/DataTemplate&gt;
          &lt;/ListView.ItemTemplate&gt;
      &lt;/ListView&gt;
      &lt;/StackLayout&gt;
  &lt;/ContentPage.Content&gt;
  &lt;/ContentPage&gt;
  </code></pre>