dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.26k stars 1.76k forks source link

Stepper doesn't change increment value when being bound to a double in MVVM context (Windows) #20706

Open vanillaFriday opened 9 months ago

vanillaFriday commented 9 months ago

Description

I want to change the Increment value of a stepper dynamically. Since I use MVVM pattern I bind the value to a double in my ViewModel which can be manipulated by the user:

<Stepper x:Name="Stepper1"
         Increment="{Binding Increment}" />
public double Increment
{
    set => SetProperty(ref _increment, value);
    get => _increment;
}

What I get is the first change (set in the constructor of the ViewModel). Any later manipulations have no effect on the increment value it sticks with the first set value. The value in the ViewModel does change (see lable under the buttons).

If I run the same project with Android Simulator (Pixel 5, API 33) it does work like expected.

Steps to Reproduce

  1. Clone the project link.
  2. Run the project on windows (10.0.19041.0 or above)

Link to public reproduction project repository

https://github.com/vanillaFriday/StepperBindingIncrement/tree/master

Version with bug

7.0.101 & 8.0.6 (SR1)

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

= Windows 10.0.19041.0

Did you find any workaround?

no

Relevant log output

no response
vanillaFriday commented 9 months ago

The same bug is present in MAUI .NET8.06 SR1 -> working on Android not working on Windows

ghost commented 9 months ago

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

XamlTest commented 8 months ago

Verified this on VS 17.10.0 Preview 2.0(8.0.14). Repro on Windows 11 iOS 17.2 and MacCatalyst, not repro on Android 14.0-API34 with below Project: StepperBindingIncrement.zip Stepper