Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wpf.Ui.Controls.NumberBox event ValueChanged called early #1315

Open
APerricone opened this issue Jan 14, 2025 · 0 comments
Open

Wpf.Ui.Controls.NumberBox event ValueChanged called early #1315

APerricone opened this issue Jan 14, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@APerricone
Copy link

Describe the bug

ValueChanged event is called before the binded value changes

To Reproduce

with this piece of code we can see that NumberBox.Value is the correct value but the binded value doesn't.

         <StackPanel Grid.Row="2" Margin="20" Grid.ColumnSpan="2">
            <ui:NumberBox Value="{Binding testValue}" ValueChanged="NumberBox_ValueChanged"  HorizontalAlignment="Left"/>
            <TextBlock x:Name="bugReport" TextWrapping="Wrap"/>
         </StackPanel>
      public double testValue { get; set; } = 10.12345567788;
      private void NumberBox_ValueChanged(object sender, System.Windows.RoutedEventArgs e) {
         if(bugReport == null)
            return;
         bugReport.Text += $" - {( (NumberBox)sender ).Value.ToString()} ({testValue})";
      }

Expected behavior

The event is called after the binded value is associated

Screenshots

image

OS version

Window 11

.NET version

.net 9.0

WPF-UI NuGet version

3.0.5

Additional context

No response

@APerricone APerricone added the bug Something isn't working label Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant