diff --git a/Workbench/Services/WorkbenchEventService.cs b/Workbench/Services/WorkbenchEventService.cs index 33bbd94..0e25087 100644 --- a/Workbench/Services/WorkbenchEventService.cs +++ b/Workbench/Services/WorkbenchEventService.cs @@ -3,6 +3,7 @@ using Newtonsoft.Json.Linq; using Serein.Library; using Serein.Library.Api; using Serein.Workbench.Api; +using Serein.Workbench.ViewModels; using System; using System.Collections.Generic; using System.IO; @@ -89,7 +90,20 @@ namespace Serein.Workbench.Services private void FlowEEForwardingService_OnProjectLoaded(ProjectLoadedEventArgs eventArgs) { + var edit = App.GetService().FlowEditViewModel; + App.UIContextOperation.Invoke(async () => { + + foreach (var item in flowNodeService.FlowCanvass) + { + await Task.Delay(50); + flowNodeService.CurrentSelectCanvas = item; + var tab = edit.CanvasTabs.First(tab => tab.Content == item); + edit.SelectedTab = tab; + } + }); + + } private void KeyEventService_OnKeyDown(System.Windows.Input.Key key) diff --git a/Workbench/ViewModels/FlowEditViewModel.cs b/Workbench/ViewModels/FlowEditViewModel.cs index ef37377..4fc1ad9 100644 --- a/Workbench/ViewModels/FlowEditViewModel.cs +++ b/Workbench/ViewModels/FlowEditViewModel.cs @@ -50,6 +50,14 @@ namespace Serein.Workbench.ViewModels partial void OnSelectedTabChanged(FlowEditorTabModel value) { flowNodeService.CurrentSelectCanvas = value?.Content; + if(value is not null) + { + App.UIContextOperation.Invoke(() => { + + value.Content.RefreshAllLine(); + }); + } + }