From 04bd3f1e299d769798714ba8cc0e118e640777c1 Mon Sep 17 00:00:00 2001 From: Sebastian Wittlich Date: Wed, 16 Oct 2024 15:22:37 +0200 Subject: [PATCH] The OnProjectCreated method is now called when the project is created. --- .../UniversalFpgaProjectCreatorViewModel.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/OneWare.UniversalFpgaProjectSystem/ViewModels/UniversalFpgaProjectCreatorViewModel.cs b/src/OneWare.UniversalFpgaProjectSystem/ViewModels/UniversalFpgaProjectCreatorViewModel.cs index 65804eaa..6535d87b 100644 --- a/src/OneWare.UniversalFpgaProjectSystem/ViewModels/UniversalFpgaProjectCreatorViewModel.cs +++ b/src/OneWare.UniversalFpgaProjectSystem/ViewModels/UniversalFpgaProjectCreatorViewModel.cs @@ -106,17 +106,19 @@ public async Task SaveAsync(FlexibleWindow window) ["Exclude"] = new JsonArray("build") }; var root = new UniversalFpgaProjectRoot(projectFile, defaultProperties); - - if (_fpgaService.Toolchains.FirstOrDefault(x => x.Name == _toolchainSetting.Value.ToString()) is { } tc) - root.Toolchain = tc; - + if (_fpgaService.Loaders.FirstOrDefault(x => x.Name == _loaderSetting.Value.ToString()) is { } loader) root.Loader = loader; - + + if (_fpgaService.Toolchains.FirstOrDefault(x => x.Name == _toolchainSetting.Value.ToString()) is { } tc) { + root.Toolchain = tc; + tc.OnProjectCreated(root); + } + await _manager.SaveProjectAsync(root); - + _projectExplorerService.Insert(root); - + _projectExplorerService.ActiveProject = root; if (_fpgaService.Templates.FirstOrDefault(x => x.Name == _templateSetting.Value.ToString()) is { } template)