diff --git a/CLEditor/windows/PropertyBox.xaml.cs b/CLEditor/windows/PropertyBox.xaml.cs
index f2c1f3a0b45c4ca222ab3bf1098aff55bafbbac1..41ca23db1d33bc69c2fb8b5051ed2a8d832204eb 100644
--- a/CLEditor/windows/PropertyBox.xaml.cs
+++ b/CLEditor/windows/PropertyBox.xaml.cs
@@ -1,5 +1,4 @@
-using System;
-using System.Windows;
+using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
@@ -11,23 +10,25 @@ namespace CLEngine.Editor.windows
///
/// PropertyBox.xaml 的交互逻辑
///
- public partial class PropertyBox : UserControl
+ public partial class PropertyBox
{
- object selected;
+ private object selected;
public object SelectedObject
{
get { return PropertyGrid.SelectedObject; }
set
{
- Dispatcher.Invoke(delegate
- {
- selected = value;
- PropertyGrid.SelectedObject = value;
- Title.Content = CHelper.SplitCamelCase(value.ToString());
-
- SettingsBtn.Visibility = value is ObjectComponent ? System.Windows.Visibility.Visible : System.Windows.Visibility.Hidden;
- });
+ Dispatcher?.Invoke(delegate
+ {
+ selected = value;
+ PropertyGrid.SelectedObject = value;
+ Title.Content = CHelper.SplitCamelCase(value.ToString());
+
+ SettingsBtn.Visibility = value is ObjectComponent
+ ? Visibility.Visible
+ : Visibility.Hidden;
+ });
}
}
@@ -36,16 +37,6 @@ namespace CLEngine.Editor.windows
InitializeComponent();
}
- void PropertyGrid_SelectedPropertyItemChanged(object sender, RoutedPropertyChangedEventArgs e)
- {
-
- }
-
- void PropertyGrid_SelectedObjectChanged(object sender, RoutedPropertyChangedEventArgs