title: Not able to get the text property of custom stepper used in the xaml file to its cs file in xamarin forms
body: <p>Here group binding is done and the products are listed under the corresponding dealers. I want to multiply the price and quantity of each products under one dealer and store it in a List_model-<code>OrderModel</code> when the <code>View Order</code> button is clicked. I am not able to access the <strong>quantity value in the custom stepper text</strong> in my cs file.
  I tried <code>var qty = stepper.Text</code>. but the name <code>stepper</code> is not coming. <code>CustomStepper</code> and <code>Stepper</code> is coming the dropdown.</p>
  
  <p>This is my custom stepper:</p>
  
  <pre><code>/*Created this class to make a custon stepper to add quantity */
  public class CustomStepper : StackLayout
  {
      Button PlusBtn;
      Button MinusBtn;
      Label QtyLbl;
  
      public static readonly BindableProperty TextProperty =
        BindableProperty.Create(
           propertyName: "Text",
            returnType: typeof(int),
            declaringType: typeof(CustomStepper),
            defaultValue: 0,
            defaultBindingMode: BindingMode.TwoWay);
  
      public int Text
      {
          get { return (int)GetValue(TextProperty); }
          set { SetValue(TextProperty, value); }
      }
  
      public CustomStepper()
      {
          PlusBtn = new Button { Text = "+", WidthRequest = 23, HeightRequest = 25, FontSize = 11, BackgroundColor = Color.LightGray, Padding = 0};
          MinusBtn = new Button { Text = "-", WidthRequest = 23, HeightRequest = 25, FontSize = 11, BackgroundColor = Color.LightGray, Padding = 0};
  
          Orientation = StackOrientation.Horizontal;
          PlusBtn.Clicked += PlusBtn_Clicked;
          MinusBtn.Clicked += MinusBtn_Clicked;
  
          QtyLbl = new Label { FontSize = 11, VerticalTextAlignment = TextAlignment.Center, HorizontalTextAlignment = TextAlignment.Center, WidthRequest = 20   };
          QtyLbl.SetBinding(Entry.TextProperty, new Binding(nameof(Text), BindingMode.TwoWay, source:this));
  
          Children.Add(MinusBtn);
          Children.Add(QtyLbl);            
          Children.Add(PlusBtn);
      }
  
      private void MinusBtn_Clicked(object sender, EventArgs e)
      {
          if (Text &gt; 0)
              Text--;
      }
  
      private void PlusBtn_Clicked(object sender, EventArgs e)
      {
          if (Text &lt; 10)
              Text++;
      }
  }
  </code></pre>
  
  <p>This is my Model class code:</p>
  
  <pre><code>public partial class AllProductListview
  {
      public decimal PK { get; set; }
      public decimal VendorFK { get; set; }
      public string Vendorname { get; set; }
      public string distance { get; set; }
      public string NameE { get; set; }
      public string NameC { get; set; }
      public float SalesPrice { get; set; }
      public int Quantity { get; set; }  
      public decimal DChargeMode { get; set; }
      public string VatForm { get; set; }
      public float TotalAmount { get; set; }
      public string DeliveryCharge { get; set; }
  
    }
  
  public class OrderModel
  {
      public int PK { get; set; }
      public int VendorFK { get; set; }
  
      public string NameE { get; set; }
      public string NameC { get; set; }
      public float SalesPrice { get; set; }
      public int DChargeMode { get; set; }
      public string VatForm { get; set; }
      public string DeliveryCharge { get; set; }
      public int Quantity { get; set; }
      public float TotalAmount { get; set; }
      public string Delete { get; set; }
  }
  </code></pre>
  
  <p>I have this in my button click in the corresponding cs file:</p>
  
  <pre><code>private async void viewOrderBtn_Clicked(object sender, EventArgs e)
      {
          var item = (Button)sender;  
  
          /*item.BindingContext contains all the values [whn i did step by step debugging] as in AllProductListview..now I have to put it in a loop and calculate the total by multiplying the price and quantity and store it in OrderModel by adding the record into the Orderlist*/
          var productList = item.BindingContext as AllProductListview; 
          List&lt;OrderModel&gt; Orderlist = new List&lt;OrderModel&gt;();
      }
  </code></pre>
  
  <p>My xaml file :</p>
  
  <pre><code>&lt;Grid Grid.Row="3"&gt;
              &lt;Frame HasShadow="True"
                     BackgroundColor="White"
                     Margin="1" 
                     Padding="5"&gt; &lt;!--@ambi : changed margin from 2 to 1 padding-10--&gt;
                  &lt;ListView 
                          x:Name="Prodlistview"       
                          IsGroupingEnabled="True"
                          ItemsSource="{Binding GroupedData}"  
                          GroupDisplayBinding="{Binding Key}"
                          ItemSelected="Prodlistview_ItemSelected"
                          SeparatorVisibility="Default"&gt;
  
                      &lt;ListView.GroupHeaderTemplate&gt;
                          &lt;DataTemplate&gt;
                              &lt;ViewCell Height="5"&gt;&lt;!--@ambi : height-15--&gt;
                                  &lt;StackLayout VerticalOptions="CenterAndExpand"  
                                               Padding="0,0"    
                                               Orientation="Horizontal"
  
                                              BackgroundColor="#e3e2de"&gt;
                                      &lt;!--padding - 10  FontAttributes="Bold"--&gt;
                                      &lt;Label Text="{Binding Key}"                                                
                                             TextColor="Black" 
                                             VerticalOptions="CenterAndExpand" 
                                             HorizontalOptions="CenterAndExpand"
                                             FontSize="12" 
                                             Style="{StaticResource listlabel}"/&gt;
  
                                      &lt;Button x:Name="viewOrderBtn"
                                              Text= "{lang:Translate DriverViewOrder}"
                                              HorizontalOptions="EndAndExpand"
                                              FontAttributes="None"
                                              CommandParameter="{Binding Key}"
                                              Clicked="viewOrderBtn_Clicked"  
                                              Margin="2,5"
                                              Padding="1"
                                              FontSize="12"/&gt; &lt;!--@ambi : added button in the group view--&gt;
                                  &lt;/StackLayout&gt;
                              &lt;/ViewCell&gt;                                
                          &lt;/DataTemplate&gt;
  
                      &lt;/ListView.GroupHeaderTemplate&gt;
  
                      &lt;ListView.ItemTemplate&gt;
                          &lt;DataTemplate&gt;
                              &lt;local:ListViewSelectionColorRender SelectedBackgroundColor="Transparent"&gt;
                                  &lt;ViewCell.View&gt;
                                      &lt;Grid&gt;
                                          &lt;Grid.ColumnDefinitions&gt;
                                              &lt;ColumnDefinition Width="*"/&gt;
                                              &lt;ColumnDefinition Width="*"/&gt;                                                
                                              &lt;ColumnDefinition Width="*"/&gt;
                                              &lt;ColumnDefinition Width="*"/&gt;    &lt;!--qty..width 0.55--&gt;
                                          &lt;/Grid.ColumnDefinitions&gt;
                                          &lt;Label Grid.Column="0" Text="{Binding NameE}" 
                                                 Style="{StaticResource listlabel}" MaxLines="1" 
                                                 HorizontalTextAlignment="Start"
                                                 LineBreakMode="TailTruncation"/&gt;
                                          &lt;!--@ambi : HorizontalTextAlignment="Start"--&gt;
                                          &lt;Label Grid.Column="1" Text="{Binding distance}" Style="{StaticResource listlabel}" 
                                                 TextColor="DarkGoldenrod"/&gt;
  
                                          &lt;Label Grid.Column="2" Text="{Binding SalesPrice}" 
                                                 Padding="0,0,15,0"
                                                 HorizontalTextAlignment="End"
                                                 Style="{StaticResource listlabel}"/&gt;
  
                                          &lt;StackLayout Grid.Column="3" VerticalOptions="Center" x:Name="Container"&gt;
                                              &lt;!--&lt;Frame BorderColor="Gray" HeightRequest="30" WidthRequest="40" 
                                                     CornerRadius="7" Padding="5,0" Margin="0,0" HasShadow="False"&gt;
                                                  &lt;local:BorderlessPicker x:Name="picker"
                                                                          Title="{lang:Translate Select}" 
                                                                          Style="{StaticResource picker}" 
                                                                          SelectedIndex="{Binding Pickerindex}"
                                                                          ItemsSource="{Binding QtyListModel}" 
                                                                          SelectedIndexChanged="QtyPicker_SelectedIndexChanged"                                                                                                                                              
                                                                          ItemDisplayBinding="{Binding Quantity}" 
                                                                          TextColor="Black"/&gt;                                                    
                                              &lt;/Frame&gt;--&gt;                                                
                                              &lt;!--@ambi : Custom stepper added to check a different method--&gt;
                                                  &lt;local:CustomStepper x:Name="stepper"                                                                           
                                                                       Text="{Binding Quantity, Mode=TwoWay}"                                                                          
                                                                       Padding="3,0" /&gt;                                                
                                          &lt;/StackLayout&gt;  
                                      &lt;/Grid&gt;
                                  &lt;/ViewCell.View&gt;
                              &lt;/local:ListViewSelectionColorRender&gt;
                          &lt;/DataTemplate&gt;
                      &lt;/ListView.ItemTemplate&gt;
                  &lt;/ListView&gt;
              &lt;/Frame&gt;
          &lt;/Grid&gt;
  </code></pre>
  
  <p>Image :
  <a href="https://i.stack.imgur.com/y1gFf.jpg" rel="nofollow noreferrer">My screen</a></p>
  
  <p><strong>Update :</strong> 
  I have attached the pic of my debug window. Please walk me from here. I could bring the data from the xaml. I'm new to xamarin forms. No idea how to go from here.  </p>
  
  <pre><code>private async void viewOrderBtn_Clicked(object sender, EventArgs e)
      {            
          /*item.BindingContext contains all the values [whn i did step by step *debugging] as in AllProductListview..now I have to put it in a loop and *calculate the total by multiplying the price and quantity and store it in *OrderModel by adding the record into the Orderlist*/
          var item = (Button)sender;
          var itemobj = item?.BindingContext as AllProductListview;
          List&lt;OrderModel&gt; Orderlist = new List&lt;OrderModel&gt;();
          int ID = Convert.ToInt32(itemobj.PK); //showing no value assigned
          int vendorfk = Convert.ToInt32(itemobj.VendorFK); //showing no value assigned
          float price = itemobj.SalesPrice; //showing no value assigned
          int quantity = itemobj.Quantity; //showing no value assigned
          float total = price * quantity;
      }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/wsXNV.png" rel="nofollow noreferrer">Debug window</a></p>