lepoco / wpfui

WPF UI provides the Fluent experience in your known and loved WPF framework. Intuitive design, themes, navigation and new immersive controls. All natively and effortlessly.
https://wpfui.lepo.co
MIT License
7.03k stars 666 forks source link

Fix: possible NullReferenceException in PasswordBox #1091

Closed textGamex closed 1 month ago

textGamex commented 1 month ago

Pull request type

Please check the type of change your PR introduces:

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 screenshot

Issue Number: N/A

What is the new behavior?

Other information