title: How to send data updwards? From a Datatemplate to above
body: <p>So I got this page when the user clicks the + and the - image buttons the TotalPrice label binding gets updated,no problem. This is in the Item Template binding. However, I need that whenever a product gets increased or decreased I need for the TotalOrderValue gets updated too. But I got no way to trigger the UpdateTotalOrderValue when something from the listview gets updated. How do I do this? </p>
  
  <p>I tried events but couldn't get them to work as it couldn't communicate upwards. </p>
  
  <p>This is the from the PAGE viewmodel </p>
  
  <pre><code>public decimal? TotalOrderValue
  {
      get { return totalOrderValue; }
      set
      {
          totalOrderValue = value;
          OnPropertyChanged();
      }
  }
  
  private void UpdateTotalOrderValue()
  {
      foreach (var product in Items)
      {
          TotalOrderValue += product.Price;
      }
  }
  </code></pre>
  
  <p>This is the ProductModel/The DataTemplate the listview binds to
  You can see my comment here of what I want to do. </p>
  
  <pre><code>public int ModelUpdateCount
  {
      get { return modelUpdateCount; }
      set
      {
          if (value &gt;= 0)
          {
              modelUpdateCount = value;
              TotalPrice = modelUpdateCount * Price;
              //ProductsPageViewModel.UpdateTotalOrderValu();
              NotifyPropertyChanged();
          }
      }
  }
  
  public decimal? TotalPrice
  {
      get { return totalPrice; }
      set
      {
          totalPrice = value;
          NotifyPropertyChanged();
      }
  }
  </code></pre>
  
  <p>This is the page itself</p>
  
  <pre><code>&lt;Grid HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Padding="0,0,0,0" RowSpacing="5" ColumnSpacing="0"&gt;
      &lt;Grid.RowDefinitions&gt;
          &lt;RowDefinition Height="60" /&gt;
          &lt;RowDefinition Height="60" /&gt;
          &lt;RowDefinition Height="*" /&gt;
          &lt;RowDefinition Height="120" /&gt;
          &lt;RowDefinition Height="60" /&gt;
      &lt;/Grid.RowDefinitions&gt;
      &lt;Grid.ColumnDefinitions&gt;
          &lt;ColumnDefinition Width="0.1*" /&gt;
          &lt;ColumnDefinition Width="0.1*"/&gt;
          &lt;ColumnDefinition Width="0.15*"/&gt;
          &lt;ColumnDefinition Width="0.3*"/&gt;
          &lt;ColumnDefinition Width="0.1*"/&gt;
          &lt;ColumnDefinition Width="0.1*"/&gt;
          &lt;ColumnDefinition Width="0.1*"/&gt;
          &lt;ColumnDefinition Width="0.2*"/&gt;
          &lt;ColumnDefinition Width="0.1*"/&gt;
      &lt;/Grid.ColumnDefinitions&gt;
  
      &lt;!--TOP LABELS--&gt;
  
  
      &lt;!--LIST OF PRODUCTS IN THE SCROLLVIEW--&gt;
  
      &lt;Label  Margin="5" Grid.Row="1" Grid.Column="0" BackgroundColor="LightGray" HorizontalOptions="Fill"  Text="IMAGE" Style="{StaticResource PanelText}" TextColor="Black" FontSize="20" VerticalOptions="Fill" /&gt;
      &lt;Label  Margin="5" Grid.Row="1" Grid.Column="1" BackgroundColor="LightGray" HorizontalOptions="Fill" Text="ARTICLE" Style="{StaticResource PanelText}" TextColor="Black" FontSize="20" VerticalOptions="Fill" /&gt;
      &lt;Label  Margin="5" Grid.Row="1" Grid.Column="2" BackgroundColor="LightGray" HorizontalOptions="Fill" Text="EAN NUMBER" Style="{StaticResource PanelText}" TextColor="Black" FontSize="20" VerticalOptions="Fill" /&gt;
      &lt;Label  Margin="5" Grid.Row="1" Grid.Column="3" BackgroundColor="LightGray" HorizontalOptions="Fill" Text="DESCRIPTION" Style="{StaticResource PanelText}" TextColor="Black" FontSize="20" VerticalOptions="Fill" /&gt;
      &lt;Label  Margin="5" Grid.Row="1" Grid.Column="4" BackgroundColor="LightGray" HorizontalOptions="Fill" Text="SIZE" Style="{StaticResource PanelText}" TextColor="Black" FontSize="20" VerticalOptions="Fill" /&gt;
      &lt;Label  Margin="5" Grid.Row="1" Grid.Column="5" BackgroundColor="LightGray" HorizontalOptions="Fill" Text="SRP" Style="{StaticResource PanelText}" TextColor="Black" FontSize="20" VerticalOptions="Fill" /&gt;
      &lt;Label  Margin="5" Grid.Row="1" Grid.Column="6" BackgroundColor="LightGray" HorizontalOptions="Fill" Text="PRIZE" Style="{StaticResource PanelText}" TextColor="Black" FontSize="20" VerticalOptions="Fill" /&gt;
      &lt;Label  Margin="5" Grid.Row="1" Grid.Column="7" BackgroundColor="LightGray" HorizontalOptions="Fill"  Text="QUANTITY" Style="{StaticResource PanelText}" TextColor="Black" FontSize="20" VerticalOptions="Fill" /&gt;
      &lt;Label  Margin="5" Grid.Row="1" Grid.Column="8" BackgroundColor="LightGray" HorizontalOptions="Fill" Text="TOTAL" Style="{StaticResource PanelText}" TextColor="Black" FontSize="20" VerticalOptions="Fill" /&gt;
  
  
      &lt;ListView x:Name="lvItemsList"
            ItemsSource="{Binding GroupedItems}"
            IsGroupingEnabled="True"
            GroupDisplayBinding="{Binding Key}"
            GroupShortNameBinding="{Binding Key}"
            HasUnevenRows="True"
            Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="9" HorizontalOptions="FillAndExpand" Margin="5"
          &gt;
          &lt;ListView.GroupHeaderTemplate&gt;
              &lt;DataTemplate&gt;
                  &lt;ViewCell Height="30"&gt;
                      &lt;Frame BorderColor="Gray" Padding="5"&gt;
                          &lt;Label Text="{Binding Key}" TextColor="Black" Font="Large" VerticalTextAlignment="Center" VerticalOptions="Center"/&gt;
                      &lt;/Frame&gt;
                  &lt;/ViewCell&gt;
              &lt;/DataTemplate&gt;
          &lt;/ListView.GroupHeaderTemplate&gt;
          &lt;ListView.ItemTemplate&gt;
              &lt;DataTemplate&gt;
                  &lt;ViewCell Height="60"&gt;
                      &lt;Grid FlexLayout.Basis="100%" HeightRequest="60"  Margin="5" RowSpacing="5" ColumnSpacing="10" HorizontalOptions="FillAndExpand"&gt;
                          &lt;Grid.ColumnDefinitions&gt;
                              &lt;ColumnDefinition Width="0.1*" /&gt;
                              &lt;ColumnDefinition Width="0.1*"/&gt;
                              &lt;ColumnDefinition Width="0.15*"/&gt;
                              &lt;ColumnDefinition Width="0.3*"/&gt;
                              &lt;ColumnDefinition Width="0.1*"/&gt;
                              &lt;ColumnDefinition Width="0.1*"/&gt;
                              &lt;ColumnDefinition Width="0.1*"/&gt;
                              &lt;ColumnDefinition Width="0.2*"/&gt;
                              &lt;ColumnDefinition Width="0.1*"/&gt;
                          &lt;/Grid.ColumnDefinitions&gt;
  
  
                          &lt;ffimageloading:CachedImage  
                                  Source="{Binding LocalImagePath}" HorizontalOptions="StartAndExpand" VerticalOptions="CenterAndExpand" Aspect="AspectFill"
                                  DownsampleToViewSize="true"
                              DownsampleHeight="180"
                              DownsampleWidth="120"
                              &gt;
  
                              &lt;ffimageloading:CachedImage.GestureRecognizers&gt;
                                  &lt;TapGestureRecognizer Command="{Binding Path=ViewModel.CmdImageTapped, Source={x:Reference Products}}"
                                                            CommandParameter="{Binding .}"
                                                            NumberOfTapsRequired="1"/&gt;
                              &lt;/ffimageloading:CachedImage.GestureRecognizers&gt;
                          &lt;/ffimageloading:CachedImage&gt;
  
                          &lt;Label VerticalOptions="CenterAndExpand"  Grid.Column="1"  Text="{Binding SkuNumber}" Style="{StaticResource PanelText}" HorizontalTextAlignment="Start" TextColor="Black"/&gt;
  
                          &lt;Label VerticalOptions="CenterAndExpand"  Grid.Column="2"  Text="{Binding Ean13}" Style="{StaticResource PanelText}" HorizontalTextAlignment="Center" TextColor="Black"/&gt;
  
                          &lt;Label  VerticalOptions="CenterAndExpand"  Grid.Column="3"  Text="{Binding ProductName}" Style="{StaticResource PanelText}" HorizontalTextAlignment="Start" TextColor="Black" FontAttributes="Bold" /&gt;
  
                          &lt;Label  VerticalOptions="CenterAndExpand"  Grid.Column="4"  Text="{Binding Size}" Style="{StaticResource PanelText}" HorizontalTextAlignment="Center" TextColor="Black"/&gt;
  
                          &lt;Label HorizontalOptions="FillAndExpand" VerticalOptions="CenterAndExpand"  Grid.Column="5"  Text="{Binding SalesRecommendedPrice}" Style="{StaticResource PanelText}" HorizontalTextAlignment="Center" TextColor="Black"/&gt;
  
                          &lt;Label HorizontalOptions="FillAndExpand" VerticalOptions="CenterAndExpand"  Grid.Column="6"  Text="{Binding PriceWithUnit}" Style="{StaticResource PanelText}" HorizontalTextAlignment="Center" TextColor="Black" FontAttributes="Bold"/&gt;
  
                          &lt;Grid VerticalOptions="CenterAndExpand" Grid.Column="7"&gt;
                              &lt;Grid.ColumnDefinitions&gt;
                                  &lt;ColumnDefinition Width="*" /&gt;
                                  &lt;ColumnDefinition Width="60"/&gt;
                                  &lt;ColumnDefinition Width="*"/&gt;
                              &lt;/Grid.ColumnDefinitions&gt;
                              &lt;Button Image="line_in_square.png" BackgroundColor="White" HorizontalOptions="Start" VerticalOptions="Start" Command="{Binding DeCrementCommand}" /&gt;
                              &lt;Frame Grid.Column="1" BorderColor="Gray" HorizontalOptions="Fill" VerticalOptions="Center" Padding="8"  &gt;
                                  &lt;Label Text="{Binding ModelUpdateCount, StringFormat='{0}'}" FontSize="16" TextColor="Black" VerticalTextAlignment="Center" HorizontalTextAlignment="Center"/&gt;
                              &lt;/Frame&gt;
                              &lt;Button BackgroundColor="White" Grid.Column="2" Image="plus_sign.png" HorizontalOptions="End" VerticalOptions="Start" Command="{Binding IncrementCommand}" /&gt;
                          &lt;/Grid&gt;
                          &lt;Label  VerticalOptions="CenterAndExpand" Grid.Column="8" Text="{Binding TotalPrice, StringFormat='{0:C2}'}" Style="{StaticResource PanelText}" FontAttributes="Bold" TextColor="Black"/&gt;
  
                      &lt;/Grid&gt;
                  &lt;/ViewCell&gt;
              &lt;/DataTemplate&gt;
          &lt;/ListView.ItemTemplate&gt;
      &lt;/ListView&gt;
  
      &lt;!-- Bottom Command Bar --&gt;
      &lt;Grid Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="9" BackgroundColor="LightGray"  VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" Padding="5"&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition Height="*" /&gt;
              &lt;RowDefinition Height="*" /&gt;
          &lt;/Grid.RowDefinitions&gt;
          &lt;Grid.ColumnDefinitions&gt;
              &lt;ColumnDefinition Width="120"/&gt;
              &lt;ColumnDefinition Width="*"/&gt;
              &lt;ColumnDefinition Width="360"/&gt;
          &lt;/Grid.ColumnDefinitions&gt;
  
          &lt;Label Text="COMMENTS&amp;#x0a;/ PO NUMBER:" BackgroundColor="LightGray" VerticalOptions="Center" HorizontalOptions="Center" TextColor="Black" /&gt;
  
          &lt;Editor BackgroundColor="White" TextColor="Black" Grid.Row="0" Grid.RowSpan="2" Grid.Column="1"  VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" Margin="10,10,10,10" /&gt;
  
          &lt;Label Grid.Row="0" Grid.Column="2" VerticalOptions="End" HorizontalOptions="End" Text="£ 221212" Margin="0,0,20,0" FontSize="16"/&gt;
          &lt;Label Grid.Row="0" Grid.Column="2" VerticalOptions="Center" HorizontalOptions="Start" FontSize="40" Text="{Binding TotalOrderValue}" Margin="35,0,0,0"/&gt;
  
          &lt;Button  Text="SUBMIT PART ORDER"  Command="{Binding SubmitOrderCommand}" BackgroundColor="#088da5" FontAttributes="Bold" TextColor="White" Grid.Row="1" Grid.Column="2"  VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" Margin="0,0,20,10"/&gt;
  </code></pre>
  
  <p>Image for visuals if needed:</p>
  
  <p><a href="https://gyazo.com/80f64e4146b6a661f983938d1fb5d1bf" rel="nofollow noreferrer">https://gyazo.com/80f64e4146b6a661f983938d1fb5d1bf</a></p>
  
  <p>It's the 0 that needs to be updated to be the total of all the products in the listview. </p>