diff --git a/Torch/Views/PropertyGrid.xaml b/Torch/Views/PropertyGrid.xaml index 273c84f..78b24d5 100644 --- a/Torch/Views/PropertyGrid.xaml +++ b/Torch/Views/PropertyGrid.xaml @@ -17,7 +17,7 @@ - + diff --git a/Torch/Views/PropertyGrid.xaml.cs b/Torch/Views/PropertyGrid.xaml.cs index 4d44340..9e0bd39 100644 --- a/Torch/Views/PropertyGrid.xaml.cs +++ b/Torch/Views/PropertyGrid.xaml.cs @@ -49,12 +49,14 @@ namespace Torch.Views if (e.NewValue == null) { ScrollViewer.Content = null; + TbFilter.IsEnabled = false; return; } var content = GenerateForType(e.NewValue.GetType()); content.DataContext = e.NewValue; ScrollViewer.Content = content; + TbFilter.IsEnabled = true; } public Grid GenerateForType(Type t) @@ -274,6 +276,8 @@ namespace Torch.Views { var filterText = ((TextBox)sender).Text; var grid = (Grid)ScrollViewer.Content; + if (grid == null) + return; foreach (var child in grid.Children) { if (!(child is TextBlock block))