C# 当绑定属性设置为null时,Xceed PropertyGrid不清除
我正在使用Xceed PropertyGrid,它工作得很好,直到我将它绑定到的属性设置为null。这会清除属性网格,但不会。我需要做什么特别的事情来清理财产网格吗 XAML:C# 当绑定属性设置为null时,Xceed PropertyGrid不清除,c#,wpf,data-binding,propertygrid,xceed,C#,Wpf,Data Binding,Propertygrid,Xceed,我正在使用Xceed PropertyGrid,它工作得很好,直到我将它绑定到的属性设置为null。这会清除属性网格,但不会。我需要做什么特别的事情来清理财产网格吗 XAML: <xctkpg:PropertyGrid IsCategorized="True" NameColumnWidth="150" SelectedObject="{Binding SelectedObject}" ShowSearchBox="True" ShowSortOpt
<xctkpg:PropertyGrid
IsCategorized="True"
NameColumnWidth="150"
SelectedObject="{Binding SelectedObject}"
ShowSearchBox="True"
ShowSortOptions="False"
ShowTitle="False" />
#region SelectedObject
private object _SelectedObject;
public object SelectedObject
{
get { return this._SelectedObject; }
set
{
if (this._SelectedObject != value)
{
this._SelectedObject = value;
RaisePropertyChanged(nameof(this.SelectedObject));
}
}
}
#endregion SelectedObject
this.SelectedObject = this.SomeObject; <--- the property grid is correctly populated
代码中的其他地方:
<xctkpg:PropertyGrid
IsCategorized="True"
NameColumnWidth="150"
SelectedObject="{Binding SelectedObject}"
ShowSearchBox="True"
ShowSortOptions="False"
ShowTitle="False" />
#region SelectedObject
private object _SelectedObject;
public object SelectedObject
{
get { return this._SelectedObject; }
set
{
if (this._SelectedObject != value)
{
this._SelectedObject = value;
RaisePropertyChanged(nameof(this.SelectedObject));
}
}
}
#endregion SelectedObject
this.SelectedObject = this.SomeObject; <--- the property grid is correctly populated
this.SelectedObject=this.SomeObject;当您将它设置为null
时,它是否会命中RaisePropertyChanged
行?这是一个已知的错误,看。当您将它设置为null
时,它是否会命中RaisePropertyChanged
行?这是一个已知的错误,看。