title: How can retrieve data from various entries (each single-line), calculate it, then be able to display results in real time?
body: <p>I would like to know a way to able to retrieve data from various entries from a Grid Layout and have their values ready to calculate inside other classes/methods. I want the results to automatically change depending on what you enter in the Score, ScoreGot and Weight of each grade. </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
               xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
               x:Class="GradeThisForMe.GradeCalculator"
               NavigationPage.HasNavigationBar="False"
               BackgroundImage="WallpaperBlueSkyBlurMedium.png"&gt;
      &lt;StackLayout&gt;
      &lt;ScrollView&gt;
          &lt;Grid x:Name="tableGrid" RowSpacing="0" ColumnSpacing="0"&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition Height="*"/&gt;
              &lt;RowDefinition Height="*"/&gt;
              &lt;RowDefinition Height="*"/&gt;
              &lt;RowDefinition Height="*"/&gt;
              &lt;RowDefinition Height="*"/&gt;
              &lt;RowDefinition Height="*"/&gt;
              &lt;RowDefinition Height="*"/&gt;
              &lt;RowDefinition Height="*"/&gt;
          &lt;/Grid.RowDefinitions&gt;
  
          &lt;Grid.ColumnDefinitions&gt;
              &lt;ColumnDefinition Width="*"/&gt;
              &lt;ColumnDefinition Width="*"/&gt;
              &lt;ColumnDefinition Width="*"/&gt;
              &lt;ColumnDefinition Width="*"/&gt;
          &lt;/Grid.ColumnDefinitions&gt;
  
          &lt;Label Text="Target Grade: " Style="{StaticResource GridTopLabelStyle}" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"  /&gt;
          &lt;Entry Text="{Binding TargetGrade}" Style="{StaticResource GridTopEntryStyle}" Grid.Row="0" Grid.Column="2" Grid.ColumnSpan="1"/&gt;
  
          &lt;Label Text="Current Grade: " Style="{StaticResource GridTopLabelStyle}" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2"  /&gt;
          &lt;Label Text="{Binding AverageGrade}" Style="{StaticResource GridTopLabelStyle}" Grid.Row="1" Grid.Column="2" Grid.ColumnSpan="2"/&gt;
  
          &lt;Label Text="You need: " Style="{StaticResource GridTopLabelStyle}" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2"  /&gt;
          &lt;Label Text="{Binding GradeNeeded}" Style="{StaticResource GridTopLabelStyle}" Grid.Row="2" Grid.Column="2" Grid.ColumnSpan="2"/&gt;
  
          &lt;Label Text="#" Style="{StaticResource GridBottomLabelStyle}" Grid.Row="3" Grid.Column="0"/&gt;
          &lt;Label Text="Score" Style="{StaticResource GridBottomLabelStyle}" Grid.Row="3" Grid.Column="1"/&gt;
          &lt;Label Text="Score Got" Style="{StaticResource GridBottomLabelStyle}" Grid.Row="3" Grid.Column="2"/&gt;
          &lt;Label Text="Weight" Style="{StaticResource GridBottomLabelStyle}" Grid.Row="3" Grid.Column="3"/&gt;
  
          &lt;Entry Text="{Binding Grade1Name}" Style="{StaticResource GridBottomEntryStyle}" Placeholder="Grade#1" Grid.Row="4" Grid.Column="0"/&gt;
          &lt;Entry Text="{Binding Score1}" Style="{StaticResource GridNumericEntryStyle}" Grid.Row="4" Grid.Column="1"/&gt;
          &lt;Entry Text="{Binding ScoreGot1}" Style="{StaticResource GridNumericEntryStyle}" Grid.Row="4" Grid.Column="2"/&gt;
          &lt;Entry Text="{Binding Weight1}" Style="{StaticResource GridNumericEntryStyle}" Grid.Row="4" Grid.Column="3"/&gt;
  
          &lt;Entry  Style="{StaticResource GridBottomEntryStyle}" Placeholder="Grade#2" Grid.Row="5" Grid.Column="0"/&gt;
          &lt;Entry  Style="{StaticResource GridNumericEntryStyle}"  Grid.Row="5" Grid.Column="1"/&gt;
          &lt;Entry  Style="{StaticResource GridNumericEntryStyle}"  Grid.Row="5" Grid.Column="2"/&gt;
          &lt;Entry  Style="{StaticResource GridNumericEntryStyle}"  Grid.Row="5" Grid.Column="3"/&gt;
  
          &lt;Entry Style="{StaticResource GridBottomEntryStyle}" Placeholder="Grade#3" Grid.Row="6" Grid.Column="0"/&gt;
          &lt;Entry Style="{StaticResource GridNumericEntryStyle}" Grid.Row="6" Grid.Column="1"/&gt;
          &lt;Entry Style="{StaticResource GridNumericEntryStyle}" Grid.Row="6" Grid.Column="2"/&gt;
          &lt;Entry Style="{StaticResource GridNumericEntryStyle}" Grid.Row="6" Grid.Column="3"/&gt;
  
          &lt;Entry Style="{StaticResource GridBottomEntryStyle}" Placeholder="Grade#4" Grid.Row="7" Grid.Column="0"/&gt;
          &lt;Entry Style="{StaticResource GridNumericEntryStyle}" Grid.Row="7" Grid.Column="1"/&gt;
          &lt;Entry Style="{StaticResource GridNumericEntryStyle}" Grid.Row="7" Grid.Column="2"/&gt;
          &lt;Entry Style="{StaticResource GridNumericEntryStyle}" Grid.Row="7" Grid.Column="3"/&gt;
  
          &lt;Entry Style="{StaticResource GridBottomEntryStyle}" Placeholder="Grade#5" Grid.Row="8" Grid.Column="0"/&gt;
          &lt;Entry Style="{StaticResource GridNumericEntryStyle}" Grid.Row="8" Grid.Column="1"/&gt;
          &lt;Entry Style="{StaticResource GridNumericEntryStyle}" Grid.Row="8" Grid.Column="2"/&gt;
          &lt;Entry Style="{StaticResource GridNumericEntryStyle}" Grid.Row="8" Grid.Column="3"/&gt;
  
          &lt;Entry Style="{StaticResource GridBottomEntryStyle}" Placeholder="Grade#6" Grid.Row="9" Grid.Column="0"/&gt;
          &lt;Entry Style="{StaticResource GridNumericEntryStyle}" Grid.Row="9" Grid.Column="1"/&gt;
          &lt;Entry Style="{StaticResource GridNumericEntryStyle}" Grid.Row="9" Grid.Column="2"/&gt;
          &lt;Entry Style="{StaticResource GridNumericEntryStyle}" Grid.Row="9" Grid.Column="3"/&gt;
  
              &lt;/Grid&gt;
  
          &lt;/ScrollView&gt;
          &lt;Button Text="Calculate"
          Style="{StaticResource PrimaryButton}"/&gt;
      &lt;/StackLayout&gt;
  &lt;/ContentPage&gt;
  </code></pre>
  
  <p>For testing purposes, my goal is to change and display the results of AverageGrade in real time after entering the score and score got in grade#1. To notice property changes, the value has to be a string. To calculate results, In Grade1Total, I tried to convert the Score1 and ScoreGot1 values temporarily into double. After converting the calculation results to string, it never shows up on display. What do you recommend I should do? </p>
  
  <p><strong><em>Note:</em></strong> I know that some parts of the code like Calculate button are incomplete or unnecessary. My priority right now is to fix this situation.    </p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Runtime.CompilerServices;
  using System.Text;
  using System.Threading.Tasks;
  using Xamarin.Forms;
  
  namespace GradeThisForMe
  {
      public class AddGradesDetails: INotifyPropertyChanged
      {
          string targetGrade;
  
          string grade1_Name;
  
          string score1;
          double dbl_score1;
  
          string score_got1;
          double dbl_score_got1;
  
          string weight1;
  
          string total_grade1;
          double dbl_total_grade1;
  
          string decimal_weight1;
          string average_grade;
  
          string grade_needed;
  
  
  
          public event PropertyChangedEventHandler PropertyChanged;
  
          void OnPropertyChanged([CallerMemberName] string total_grade1 = "")
          {
              PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(total_grade1));
          }
  
          public string Grade1Name
          {
              get { return grade1_Name; }
              set
              {
                  grade1_Name = value;
                  OnPropertyChanged(Grade1Name);
  
  
              }
  
  
          }
  
          public string Score1
          {
              get { return score1; }
              set
              {
  
                  score1 = value;
                  OnPropertyChanged(Score1);
                  OnPropertyChanged(nameof(AverageGrade));
  
              }
  
  
  
  
          }
  
          public string ScoreGot1
          {
              get { return score_got1; }
              set
              {
                  score_got1 = value;
                  OnPropertyChanged(ScoreGot1);
                  OnPropertyChanged(nameof(AverageGrade));
  
  
  
              }
  
  
  
      } 
  
          public string Weight1
          {
              get { return weight1; }
              set
              {
                  weight1 = value;
                  OnPropertyChanged(Weight1);
                  OnPropertyChanged(nameof(AverageGrade));
  
              }
  
  
  
          }
  
          public string Grade1Total
          {
              get { return total_grade1; }
              set
              {
  
  
                  dbl_score1 = Convert.ToDouble(Score1);
                  dbl_score_got1 = Convert.ToDouble(ScoreGot1);
                  dbl_total_grade1 = ((dbl_score_got1 / dbl_score1)*100);
  
                  total_grade1 = Convert.ToString(dbl_score1);
                  OnPropertyChanged(Grade1Total);
                  OnPropertyChanged(nameof(AverageGrade));
  
              }
  
  
          }
  
  
          public string AverageGrade
          {
              get { return $"{Grade1Total}"; }
              set
              {
  
  
                  OnPropertyChanged(nameof(AverageGrade));
              }
  
  
  
          }
          public string TargetGrade
          {
              get { return targetGrade; }
              set
              {
                  targetGrade = value;
                  OnPropertyChanged(TargetGrade);
              }
  
  
          }
  
          public string GradeNeeded
          {
              get { return grade_needed; }
              set
              {
  
              }
          }
  
  
      }
  
  
  
  
  }
  
  
  </code></pre>