Material Update Strategy was added

This commit is contained in:
Evgeny Redikultsev
2023-07-02 22:03:30 +05:00
parent 2595d7e733
commit 03b882f54d
74 changed files with 456 additions and 184 deletions

View File

@@ -2,6 +2,7 @@
using StructureHelper.Infrastructure;
using StructureHelper.Infrastructure.UI.DataContexts;
using StructureHelper.Models.Materials;
using StructureHelper.Services.Settings;
using StructureHelper.Windows.PrimitiveTemplates.RCs.Beams;
using StructureHelper.Windows.PrimitiveTemplates.RCs.RectangleBeam;
using StructureHelper.Windows.ViewModels;
@@ -10,7 +11,6 @@ using StructureHelper.Windows.ViewModels.Materials;
using StructureHelper.Windows.ViewModels.NdmCrossSections;
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Infrastructures.Exceptions;
using StructureHelperCommon.Infrastructures.Strings;
using StructureHelperLogics.Models.CrossSections;
using StructureHelperLogics.Models.Templates.CrossSections.RCs;
using StructureHelperLogics.Models.Templates.RCs;
@@ -403,6 +403,10 @@ namespace StructureHelper.Windows.MainWindow
item.RegisterDeltas(CanvasWidth / 2, CanvasHeight / 2);
}
PrimitiveLogic.Refresh();
foreach (var item in newRepository.HeadMaterials)
{
GlobalRepository.Materials.Create(item);
}
return primitives;
}
return new List<PrimitiveBase>();

View File

@@ -14,7 +14,12 @@
<Window.Resources>
<ResourceDictionary Source="/Infrastructure/UI/Resources/Materials.xaml"/>
</Window.Resources>
<ScrollViewer>
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="35"/>
</Grid.RowDefinitions>
<ScrollViewer>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="46"/>
@@ -46,4 +51,6 @@
<StackPanel Grid.Row="1" x:Name="StpMaterialProperties"/>
</Grid>
</ScrollViewer>
<ContentControl Grid.Row="1" ContentTemplate="{StaticResource OkCancelButtons}" Content="{Binding}"/>
</Grid>
</Window>

View File

@@ -1,7 +1,6 @@
using StructureHelper.Models.Materials;
using StructureHelper.Windows.ViewModels.Materials;
using StructureHelperCommon.Infrastructures.Exceptions;
using StructureHelperCommon.Infrastructures.Strings;
using StructureHelperLogics.Models.Materials;
using System;
using System.Collections.Generic;
@@ -31,7 +30,10 @@ namespace StructureHelper.Windows.MainWindow.Materials
{
InitializeComponent();
this.headMaterial = headMaterial;
vm = new HeadMaterialViewModel(this.headMaterial);
vm = new HeadMaterialViewModel(this.headMaterial)
{
ParentWindow = this
};
DataContext = vm;
AddDataTemplates();
}