ZoomBox待完成,还需要调整

This commit is contained in:
艾竹
2023-02-13 22:50:50 +08:00
parent 4d36eac218
commit dfe76438c2
9 changed files with 132 additions and 68 deletions

View File

@@ -400,6 +400,20 @@ namespace AIStudio.Wpf.DiagramDesigner
}
}
private double _delayZoomValue = 1;
[Browsable(false)]
public double DelayZoomValue
{
get
{
return _delayZoomValue;
}
set
{
SetProperty(ref _delayZoomValue, value);
}
}
private string _name;
[Browsable(false)]
public string Name
@@ -691,6 +705,8 @@ namespace AIStudio.Wpf.DiagramDesigner
public event DiagramEventHandler Event;
private IDisposable ZoomValueChangedSubscription;
public DiagramViewModel()
{
CreateNewDiagramCommand = new SimpleCommand(ExecuteEnable, ExecuteCreateNewDiagramCommand);
@@ -733,6 +749,14 @@ namespace AIStudio.Wpf.DiagramDesigner
Mediator.Instance.Register(this);
Items.CollectionChanged += Items_CollectionChanged;
ZoomValueChangedSubscription = WhenPropertyChanged.Where(o => o.ToString() == nameof(ZoomValue)).Throttle(TimeSpan.FromMilliseconds(100)).Subscribe(OnZoomValueChanged);//Sample
}
//提供给标尺计算延迟100ms等布局改变再计算。
private void OnZoomValueChanged(string obj)
{
DelayZoomValue = ZoomValue;
}
public DiagramViewModel(DiagramItem diagramItem) : this()