From 630f888fbe2814b92da398ddb3df3c4fef3eb25b Mon Sep 17 00:00:00 2001 From: NaBian <836904362@qq.com> Date: Sat, 16 Jan 2021 19:04:53 +0800 Subject: [PATCH] fixed #613 --- .../Controls/PropertyGrid/PropertyGrid.cs | 6 ++++++ 1 file changed, 6 insertions(+) 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)) {