wpfui
wpfui copied to clipboard
Fix: possible NullReferenceException in PasswordBox
Pull request type
Please check the type of change your PR introduces:
- [ ] Update
- [x] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] Documentation content changes
What is the current behavior?
In the current version v3.0.4, binding the Password property of the PasswordBox control to a null property results in a NullReferenceException being thrown
<ui:PasswordBox Password="{Binding Password}" />
public partial class MainWindow : Window
{
public MainWindowsViewModel Context { get; set; }
public MainWindow()
{
Context = new MainWindowsViewModel();
DataContext = Context;
InitializeComponent();
}
}
public partial class MainWindowsViewModel : ObservableObject
{
[ObservableProperty]
private string? _password = null;
}
screenshot
Issue Number: N/A
What is the new behavior?
- Fix this bug.