From 0eab974552eec7e1e2ec71b7cb2ae9fd30d1015b Mon Sep 17 00:00:00 2001 From: ear Date: Mon, 9 Jan 2023 16:15:19 +0500 Subject: [PATCH] Bug of deleting of NdmPrimitives from calculatirs was fixed --- .../NdmCrossSections/PrimitiveViewModelLogic.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Windows/ViewModels/NdmCrossSections/PrimitiveViewModelLogic.cs b/Windows/ViewModels/NdmCrossSections/PrimitiveViewModelLogic.cs index 59477cf..e8df0e8 100644 --- a/Windows/ViewModels/NdmCrossSections/PrimitiveViewModelLogic.cs +++ b/Windows/ViewModels/NdmCrossSections/PrimitiveViewModelLogic.cs @@ -18,6 +18,7 @@ using ViewModelBase = StructureHelper.Infrastructure.ViewModelBase; using System.Windows.Forms; using System.Windows.Documents; using StructureHelper.Windows.PrimitiveProperiesWindow; +using StructureHelperLogics.NdmCalculations.Analyses.ByForces; namespace StructureHelper.Windows.ViewModels.NdmCrossSections { @@ -106,6 +107,14 @@ namespace StructureHelper.Windows.ViewModels.NdmCrossSections { var ndmPrimitive = SelectedItem.GetNdmPrimitive(); repository.Primitives.Remove(ndmPrimitive); + foreach (var calc in repository.CalculatorsList) + { + if (calc is IForceCalculator) + { + var forceCalc = calc as IForceCalculator; + forceCalc.Primitives.Remove(ndmPrimitive); + } + } Items.Remove(SelectedItem); } OnPropertyChanged(nameof(Items));