Interpolation View for calculation result was added
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using StructureHelper.Infrastructure;
|
||||
using StructureHelper.Models.Materials;
|
||||
using StructureHelper.Services.Primitives;
|
||||
using StructureHelper.Windows.AddMaterialWindow;
|
||||
using StructureHelper.Windows.MainWindow;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Settings;
|
||||
@@ -56,6 +57,29 @@ namespace StructureHelper.Windows.ViewModels.Materials
|
||||
public ICommand DeleteMaterialCommand { get; set; }
|
||||
public ICommand EditHeadMaterial;
|
||||
|
||||
private RelayCommand showSafetyfactors;
|
||||
|
||||
public RelayCommand ShowSafetyFactors
|
||||
{
|
||||
get
|
||||
{
|
||||
return showSafetyfactors ??
|
||||
(
|
||||
showSafetyfactors = new RelayCommand(o =>
|
||||
{
|
||||
if (selectedMaterial.HelperMaterial is ILibMaterial)
|
||||
{
|
||||
var material = selectedMaterial.HelperMaterial as ILibMaterial;
|
||||
var wnd = new SafetyFactorsView(material.SafetyFactors);
|
||||
wnd.ShowDialog();
|
||||
OnPropertyChanged(nameof(Items));
|
||||
}
|
||||
}, o=> SelectedLibMaterial != null
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private ICommand addElasticMaterialCommand;
|
||||
|
||||
public ObservableCollection<IHeadMaterial> HeadMaterials { get; private set; }
|
||||
@@ -74,6 +98,19 @@ namespace StructureHelper.Windows.ViewModels.Materials
|
||||
}
|
||||
}
|
||||
|
||||
public ObservableCollection<IMaterialSafetyFactor> Items
|
||||
{
|
||||
get
|
||||
{
|
||||
if (selectedMaterial.HelperMaterial is ILibMaterial)
|
||||
{
|
||||
var material = selectedMaterial.HelperMaterial as ILibMaterial;
|
||||
return new ObservableCollection<IMaterialSafetyFactor>(material.SafetyFactors);
|
||||
}
|
||||
else return null;
|
||||
}
|
||||
}
|
||||
|
||||
public string SelectedName
|
||||
{
|
||||
get => selectedMaterial.Name;
|
||||
|
||||
15
Windows/ViewModels/Materials/ISafetyFactorViewModel.cs
Normal file
15
Windows/ViewModels/Materials/ISafetyFactorViewModel.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using StructureHelper.Infrastructure;
|
||||
using StructureHelperCommon.Models.Materials.Libraries;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelper.Windows.ViewModels.Materials
|
||||
{
|
||||
internal interface ISafetyFactorViewModel<TItem> : ICRUDViewModel<TItem>
|
||||
{
|
||||
RelayCommand ShowPartialFactors { get; }
|
||||
}
|
||||
}
|
||||
22
Windows/ViewModels/Materials/PartialFactorsViewModel.cs
Normal file
22
Windows/ViewModels/Materials/PartialFactorsViewModel.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using StructureHelperCommon.Models.Materials.Libraries;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelper.Windows.ViewModels.Materials
|
||||
{
|
||||
internal class PartialFactorsViewModel : CRUDViewModelBase<IMaterialPartialFactor>
|
||||
{
|
||||
public override void AddMethod(object parameter)
|
||||
{
|
||||
NewItem = new MaterialPartialFactor();
|
||||
base.AddMethod(parameter);
|
||||
}
|
||||
|
||||
public PartialFactorsViewModel(List<IMaterialPartialFactor> safetyFactors) : base(safetyFactors)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
41
Windows/ViewModels/Materials/SafetyFactorsViewModel.cs
Normal file
41
Windows/ViewModels/Materials/SafetyFactorsViewModel.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using StructureHelper.Infrastructure;
|
||||
using StructureHelper.Windows.MainWindow.Materials;
|
||||
using StructureHelperCommon.Models.Materials.Libraries;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelper.Windows.ViewModels.Materials
|
||||
{
|
||||
internal class SafetyFactorsViewModel : CRUDViewModelBase<IMaterialSafetyFactor>
|
||||
{
|
||||
private RelayCommand showPartialCommand;
|
||||
|
||||
public RelayCommand ShowPartialFactors
|
||||
{
|
||||
get
|
||||
{
|
||||
return showPartialCommand ??
|
||||
(showPartialCommand = new RelayCommand(o =>
|
||||
{
|
||||
var wnd = new PartialFactorsView(SelectedItem.PartialFactors);
|
||||
wnd.ShowDialog();
|
||||
}, o => SelectedItem != null
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddMethod(object parameter)
|
||||
{
|
||||
NewItem = new MaterialSafetyFactor();
|
||||
base.AddMethod(parameter);
|
||||
}
|
||||
|
||||
public SafetyFactorsViewModel(List<IMaterialSafetyFactor> safetyFactors) : base(safetyFactors)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user