We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
<ComboBox Items="{Binding Items}" SelectedItem="{Binding SelectedItem}" />
class ViewModel : ReactiveObject { private string _selectedItem = "4"; public IEnumerable<string> Items { get; } = Enumerable.Range(0, 5).Select(i => i.ToString()).ToArray(); public string SelectedItem { get => _selectedItem; set => this.RaiseAndSetIfChanged(ref _selectedItem, value); // breakpoint here } }
The breakpoint will be triggered on initialization, even though the selected item is correct and exists on Items.
Items
The problem is comparing by reference here: https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Base/Data/Core/SettableNode.cs#L45.
Replacing Object.ReferenceEquals with Object.Equals works as expected, but I'm not sure if this would be the correct behavior.
Object.ReferenceEquals
Object.Equals
The text was updated successfully, but these errors were encountered:
Fixed by #13970
Sorry, something went wrong.
No branches or pull requests
Repro
The breakpoint will be triggered on initialization, even though the selected item is correct and exists on
Items
.Problem
The problem is comparing by reference here: https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Base/Data/Core/SettableNode.cs#L45.
Replacing
Object.ReferenceEquals
withObject.Equals
works as expected, but I'm not sure if this would be the correct behavior.The text was updated successfully, but these errors were encountered: