性能问题优化

This commit is contained in:
艾竹
2023-02-12 15:46:44 +08:00
parent da2d8cd9b3
commit 1c03c0f055
10 changed files with 66 additions and 55 deletions

View File

@@ -45,14 +45,7 @@ namespace AIStudio.Wpf.DiagramDesigner.Controls
protected virtual void OnSelectedObjectChanged(object oldValue, object newValue)
{
// We do not want to process the change now if the grid is initializing (ie. BeginInit/EndInit).
var obj = oldValue as INotifyPropertyChanged;
if (obj != null)
obj.PropertyChanged -= PropertyChanged;
DisplayProperties();
obj = newValue as INotifyPropertyChanged;
if (obj != null)
obj.PropertyChanged += PropertyChanged;
}
#endregion //SelectedObject
@@ -87,11 +80,6 @@ namespace AIStudio.Wpf.DiagramDesigner.Controls
DisplayProperties();
}
void PropertyChanged(object sender, PropertyChangedEventArgs e)
{
DisplayProperties();
}
private void DisplayProperties()
{
_panel.Children.Clear();