diff --git a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/PropertyGrid.cs b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/PropertyGrid.cs index 2c885403..8e5c2454 100644 --- a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/PropertyGrid.cs +++ b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/PropertyGrid.cs @@ -136,6 +136,8 @@ namespace HandyControl.Controls private void SortByCategory(object sender, ExecutedRoutedEventArgs e) { + if (_dataView == null) return; + using (_dataView.DeferRefresh()) { _dataView.GroupDescriptions.Clear(); @@ -148,6 +150,8 @@ namespace HandyControl.Controls private void SortByName(object sender, ExecutedRoutedEventArgs e) { + if (_dataView == null) return; + using (_dataView.DeferRefresh()) { _dataView.GroupDescriptions.Clear(); @@ -158,6 +162,8 @@ namespace HandyControl.Controls private void SearchBar_SearchStarted(object sender, FunctionEventArgs e) { + if (_dataView == null) return; + _searchKey = e.Info; if (string.IsNullOrEmpty(_searchKey)) {