Search code examples
xamarin.formsstepper

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:


Solution

  • You can retrieve the model using the control's binding context. Then access the corresponding ID or other properties there:

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