mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-16 22:26:36 +08:00
性能问题优化
This commit is contained in:
@@ -25,19 +25,13 @@
|
||||
<Style x:Key="gridHorizontalLineStyle" TargetType="Line" BasedOn="{StaticResource gridLineStyle}">
|
||||
<Setter Property="X2" Value="1" />
|
||||
<Setter Property="VerticalAlignment" Value="Bottom" />
|
||||
<Setter Property="Grid.ColumnSpan"
|
||||
Value="{Binding
|
||||
Path=ColumnDefinitions.Count,
|
||||
RelativeSource={RelativeSource AncestorType=Grid}}"/>
|
||||
<Setter Property="Grid.ColumnSpan" Value="2"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="gridVerticalLineStyle" TargetType="Line" BasedOn="{StaticResource gridLineStyle}">
|
||||
<Setter Property="Y2" Value="1" />
|
||||
<Setter Property="HorizontalAlignment" Value="Right" />
|
||||
<Setter Property="Grid.RowSpan"
|
||||
Value="{Binding
|
||||
Path=RowDefinitions.Count,
|
||||
RelativeSource={RelativeSource AncestorType=Grid}}"/>
|
||||
<Setter Property="Grid.RowSpan" Value="1000"/>
|
||||
</Style>
|
||||
|
||||
</Border.Resources>
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user