I have a classic products catalog page with detail page in Xamarin forms 4 with MVVM pattern with appshell
Is my first app so i have some problems
I noted that the event Stepper_ValueChanged is executed twice:
-on stepper click (obviously)
-going on detail page (i use IQueryAttributable) from catalog
in ProductViewModel i do:
public void ApplyQueryAttributes(IDictionary<string, string> query)
{
string productCode = HttpUtility.UrlDecode(query["productCode"]);
Title = productCode;
Task.Run(async () => await LoadProduct(productCode));
}
question is how can fire valueChanged only on stepper click
void stepperQty_ValueChanged(object sender, ValueChangedEventArgs e)
{
var product = vm.Product;
var cartItem = new CartItem
{
....
};
vm.ChangeCartQuantity(cartItem);
}