This project is read-only.
1
Vote

Bug: SelectedProperty not changed when using TAB or Up/Down keys

description

When moving between properties with the TAB or Up/Down keys the SelectedProperty is not updated to the new property, this results in the wrong property begin updated then you press Enter.

Adding the following to the PropertyGrid_PreviewKeyDown method solves the issue:
//Finish Editing of a TextBox with Enter!
    void PropertyGrid_PreviewKeyDown(object sender, KeyEventArgs e)
    {
        var OrginalSource = (e.OriginalSource as FrameworkElement);

        if (OrginalSource.DataContext != null && OrginalSource.DataContext.GetType() == typeof(Property))
        {
            SelectedProperty = (Property)OrginalSource.DataContext; 
        }
        else
            SelectedProperty = null;

comments