title: ActivityIndicator freezes with binding
body: <p>I have a problem with activity indicator. Application is gathering data from REST server in a different thread, and binding it to carousel view. ActivityIndicator works fine, but whet I'm doing  <code>Device.BeginInvokeOnMainThread(() =&gt; BindingContext = ViewModel);</code>
  ActivityIndicator freezes until binding won't finish (usually it is 2-3 seconds).
  Is there any way to avoid this problem?<br /><br />
  Code: <br /></p>
  
  <pre><code>await Task.Run(async () =&gt;
  {
      DateTime startTime = DateTime.Now;
      try
      {
          selectedLocation = App.Session.DataProvider.GetLocation(selectedLocation.IdLocation, true);
          List&lt;OpLocationEquipment&gt; locationEq = App.Session.DataProvider.GetLocationEquipment(new long[] { selectedLocation.IdLocation });
          Logger.Logger.Log(Logger.EventID.Views.ItemDetailsPage.SelectedLocationInfo, Logger.Logger.Params(selectedLocation.IdLocation, selectedLocation.ToString()));
  
          ViewModel = new LocationDetailsViewModel(selectedLocation, locationEq);
          BindingContext = ViewModel; 
      }
      catch (Exception ex)
      {
          await DisplayAlert(ResourceWrapper.GetValue(Constants.StringKey.ApplicationName), ResourceWrapper.GetValue(Constants.StringKey.UnexpectedErrorOccurredDuringConnectingToServer), ResourceWrapper.GetValue(Constants.StringKey.OK));
          Logger.Logger.Log(EventID.Views.LoginPage.Exception, ex);
      }
      TimeSpan totalTime = DateTime.Now - startTime;
      Logger.Logger.Log(EventID.Views.ItemDetailsPage.TotalTime, Logger.Logger.Params(totalTime.TotalSeconds));
  });
  HideActivityIndicator();
  </code></pre>
  
  <p>Data template:</p>
  
  <pre><code>&lt;DataTemplate  x:Key="LocationTemplate"&gt;
      &lt;StackLayout&gt;
          &lt;Grid VerticalOptions="FillAndExpand" Padding="0" Margin="0,0,0,-10"&gt;
              &lt;Grid.RowDefinitions&gt;
                  &lt;RowDefinition /&gt;
                  &lt;RowDefinition Height="auto" /&gt;
              &lt;/Grid.RowDefinitions&gt;
              &lt;RelativeLayout Grid.Row="0" HorizontalOptions="FillAndExpand"&gt;
                  &lt;ffimageloading:CachedImage Source="{Binding BackgroundImage}" Opacity="1" Aspect="Fill" RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width}" RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height}"/&gt;
                  &lt;ScrollView RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width}" RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height}"&gt;
                      &lt;StackLayout&gt;
                          &lt;StackLayout Padding="15" BackgroundColor="White"&gt;
                              &lt;Grid&gt;
                                  &lt;Grid.ColumnDefinitions&gt;
                                      &lt;ColumnDefinition Width="*" /&gt;
                                      &lt;ColumnDefinition Width="auto"/&gt;
                                      &lt;ColumnDefinition Width="auto"/&gt;
                                  &lt;/Grid.ColumnDefinitions&gt;
                                  &lt;Grid.RowDefinitions&gt;
                                      &lt;RowDefinition Height="1" /&gt;
                                      &lt;RowDefinition Height="64"/&gt;
                                  &lt;/Grid.RowDefinitions&gt;
                                  &lt;BoxView Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" BackgroundColor="{StaticResource CompanyColor}" HeightRequest="1" VerticalOptions="End" HorizontalOptions="FillAndExpand"/&gt;
                                  &lt;StackLayout Grid.Column="0" Grid.Row="0" Grid.RowSpan="2"&gt;
                                      &lt;Label TextColor="{StaticResource CompanyColor}" FontSize="12" Text="{Binding LocationAddress}" VerticalOptions="CenterAndExpand" VerticalTextAlignment="Center" /&gt;
                                  &lt;/StackLayout&gt;
                                  &lt;Grid Grid.Row="1" Grid.Column="1"&gt;
                                      &lt;Grid.RowDefinitions&gt;
                                          &lt;RowDefinition Height="auto"/&gt;
                                          &lt;RowDefinition /&gt;
                                      &lt;/Grid.RowDefinitions&gt;
                                      &lt;Label Grid.Row="0" Text="Fuel status" TextColor="{StaticResource CompanyColor}" FontSize="7" HorizontalOptions="Center" HorizontalTextAlignment="Center"/&gt;
                                      &lt;Label Text="{Binding FuelStatus}" Grid.Row="1" TextColor="{StaticResource CompanyColor}" FontSize="28" HorizontalOptions="Center" HorizontalTextAlignment="Center" /&gt;
                                  &lt;/Grid&gt;
                                  &lt;Grid Grid.Row="1" Grid.Column="2"&gt;
                                      &lt;Grid.RowDefinitions&gt;
                                          &lt;RowDefinition Height="auto"/&gt;
                                          &lt;RowDefinition /&gt;
                                      &lt;/Grid.RowDefinitions&gt;
                                      &lt;Label Grid.Row="0" Text="Device status" TextColor="{StaticResource CompanyColor}" FontSize="7" HorizontalOptions="Center" HorizontalTextAlignment="Center" /&gt;
  
                                      &lt;ffimageloading:CachedImage HorizontalOptions="Center" VerticalOptions="Start" DownsampleToViewSize="true"
                                      Aspect="AspectFit" WidthRequest="32"  HeightRequest="32" Grid.Row="1" Source="{Binding DeviceStatusImage}"&gt;
                                      &lt;/ffimageloading:CachedImage&gt;
                                  &lt;/Grid&gt;
                              &lt;/Grid&gt;
                          &lt;/StackLayout&gt;
                          &lt;ListView
                                        ItemsSource="{Binding Values}"
                                        VerticalOptions="FillAndExpand"
                                        HasUnevenRows="false"
                                        BackgroundColor="Transparent"
                                        CachingStrategy="RecycleElement"
                                        HeightRequest="{Binding ListViewHeight}"
                                        Margin="10,0,10,0"
                                        SeparatorColor="White"&gt;
                              &lt;ListView.ItemTemplate&gt;
                                  &lt;DataTemplate&gt;
                                      &lt;ViewCell&gt;
                                          &lt;Grid Padding="15,0,15,15" Margin="0,0,0,0" HeightRequest="36"&gt;
                                              &lt;Grid.ColumnDefinitions&gt;
                                                  &lt;ColumnDefinition Width="auto" /&gt;
                                                  &lt;ColumnDefinition Width="5*"/&gt;
                                              &lt;/Grid.ColumnDefinitions&gt;
                                              &lt;Label Text="{Binding Descr}" Style="{DynamicResource ListItemTextStyle}" Grid.Column="0" VerticalOptions="CenterAndExpand" FontSize="12"/&gt;
                                              &lt;Label Text="{Binding Value}" Style="{DynamicResource ListItemTextStyle}" Grid.Column="1" VerticalOptions="CenterAndExpand" FontSize="12" HorizontalTextAlignment="End" /&gt;
                                          &lt;/Grid&gt;
                                      &lt;/ViewCell&gt;
                                  &lt;/DataTemplate&gt;
                              &lt;/ListView.ItemTemplate&gt;
                          &lt;/ListView&gt;
                          &lt;StackLayout Padding="15" BackgroundColor="White"&gt;
                              &lt;Label x:Name="lPlotTitle" TextColor="{StaticResource Primary}" VerticalOptions="CenterAndExpand" FontSize="11"/&gt;
                              &lt;Grid&gt;
                                  &lt;oxy:PlotView x:Name="plotView" Model="{Binding PlotModel}" VerticalOptions = "Fill" HorizontalOptions = "Fill" WidthRequest="{Binding PlotWidth}" HeightRequest="350"/&gt;
                              &lt;/Grid&gt;
                          &lt;/StackLayout&gt;
                      &lt;/StackLayout&gt;
                  &lt;/ScrollView&gt;
              &lt;/RelativeLayout&gt;
          &lt;/Grid&gt;
      &lt;/StackLayout&gt;
  &lt;/DataTemplate&gt;
  </code></pre>