我如何以 xamarin 形式发送带有步进器的 属性 id?

How can i, send property id with stepper in xamarin forms?

i want create purchase cart in list view and use stepper for change count of products and change online price but i do not know what to send product id to server.my code:

要获取步进器中的当前选定值,您只需:

  void OnStepperValueChanged(object sender, ValueChangedEventArgs e)
    {
        double count = e.NewValue;
    }

您可以使用控件的绑定上下文检索模型。然后在那里访问相应的ID或其他属性:

private void OnStepperValueChanged(object sender, ValueChangedEventArgs e)
{
    Stepper stepper = sender as Stepper;
    var model = stepper.BindingContext;
    // model.id
    // model.Count
}