You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Binding not works properly in NumberBox when binded a Nullable float property
**MainWindow.xaml**
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="Binded with Double Nullable Property" FontWeight="Medium"/>
<NumberBox Width="200" Height="30" Value="{Binding Price,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<NumberBox Width="200" Height="30" Value="{Binding Price,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<TextBlock Text="Binded with Float Nullable Property" FontWeight="Medium"/>
<NumberBox Width="200" Height="30" Value="{Binding Rate,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<NumberBox Width="200" Height="30" Value="{Binding Rate,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<StackPanel.DataContext>
<local:ViewModel/>
</StackPanel.DataContext>
</StackPanel>
**ViewModel**
public class ViewModel : INotifyPropertyChanged
{
private double? _price;
public double? Price { get { return _price; } set { _price = value; RaisePropertyChanged("Price"); } }
private float? _rate;
public float? Rate { get { return _rate; } set { _rate = value; RaisePropertyChanged("Rate"); } }
public ViewModel() { }
public event PropertyChangedEventHandler PropertyChanged;
public void RaisePropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
Steps to reproduce the bug
1.Declare a Numberbox and bind a value property of NumberBox to a Nullable float property.
2.Declare another Numberbox and bind a value property of NumberBox to the same Nullable float property.
3.Edit the value in the first Number Box.
Observed Behavior:
Value is not updated based on binding.
Note: For Nullable double property it works properly.
Expected behavior
Edited value should be reflected in both the number box because of binding.
Screenshots
NumberBoxDemo.mp4
NuGet package version
WinUI 3 - Windows App SDK 1.4.0: 1.4.230822000
Windows version
Windows 11 (21H2): Build 22000
Additional context
No response
The text was updated successfully, but these errors were encountered:
Hi, I have a quite similar problem:
I try to bind the value property of a numberbox to a byte value, which causes an error at binding (when I am getting the actual BindingExpressionValue and try to bindingExpressionValue?.UpdateSource(), it leads me to a DebugSettings.BindingFailed in App.g.i.cs) but everything works fine, when I am binding the numberbox value to an int value.
So for me it seems that, depending on the datatype I am binding to that causes a problem.
So when it is getting fixed, pls check also the binding to other datatypes if they are working well.
Describe the bug
Binding not works properly in NumberBox when binded a Nullable float property
Steps to reproduce the bug
1.Declare a Numberbox and bind a value property of NumberBox to a Nullable float property.
2.Declare another Numberbox and bind a value property of NumberBox to the same Nullable float property.
3.Edit the value in the first Number Box.
Observed Behavior:
Value is not updated based on binding.
Note: For Nullable double property it works properly.
Expected behavior
Edited value should be reflected in both the number box because of binding.
Screenshots
NumberBoxDemo.mp4
NuGet package version
WinUI 3 - Windows App SDK 1.4.0: 1.4.230822000
Windows version
Windows 11 (21H2): Build 22000
Additional context
No response
The text was updated successfully, but these errors were encountered: