diff --git a/StructureHelper/Services/Settings/GlobalRepository.cs b/StructureHelper/Services/Settings/GlobalRepository.cs index b0ac354..6f4cbdb 100644 --- a/StructureHelper/Services/Settings/GlobalRepository.cs +++ b/StructureHelper/Services/Settings/GlobalRepository.cs @@ -1,5 +1,6 @@ using StructureHelper.Models.Materials; using StructureHelperCommon.Infrastructures.Interfaces; +using StructureHelperCommon.Models.Forces; using StructureHelperCommon.Models.Repositories; using StructureHelperLogics.Models.Materials; using System; @@ -13,6 +14,8 @@ namespace StructureHelper.Services.Settings internal static class GlobalRepository { private static IDataRepository materials; + private static IDataRepository actions; + public static IDataRepository Materials { get @@ -21,5 +24,13 @@ namespace StructureHelper.Services.Settings return materials; } } + public static IDataRepository Actions + { + get + { + actions ??= new ListRepository(new ActionUpdateStrategy()); + return actions; + } + } } } diff --git a/StructureHelper/Windows/Forces/ForceCombinationByFactorView.xaml b/StructureHelper/Windows/Forces/ForceCombinationByFactorView.xaml index df27e40..f6cdd63 100644 --- a/StructureHelper/Windows/Forces/ForceCombinationByFactorView.xaml +++ b/StructureHelper/Windows/Forces/ForceCombinationByFactorView.xaml @@ -7,11 +7,12 @@ xmlns:vm="clr-namespace:StructureHelper.Windows.ViewModels.Forces" d:DataContext="{d:DesignInstance vm:ForceCombinationByFactorVM}" mc:Ignorable="d" - Title="Force Combination By Factor" Height="250" Width="350" WindowStartupLocation="CenterScreen" ResizeMode="NoResize"> + Title="Force Combination By Factor" Height="290" Width="350" MinHeight="290" WindowStartupLocation="CenterScreen" ResizeMode="NoResize"> + @@ -49,5 +50,6 @@ + diff --git a/StructureHelper/Windows/Forces/ForceCombinationByFactorView.xaml.cs b/StructureHelper/Windows/Forces/ForceCombinationByFactorView.xaml.cs index 798ced7..0b1826b 100644 --- a/StructureHelper/Windows/Forces/ForceCombinationByFactorView.xaml.cs +++ b/StructureHelper/Windows/Forces/ForceCombinationByFactorView.xaml.cs @@ -27,6 +27,7 @@ namespace StructureHelper.Windows.Forces InitializeComponent(); viewModel = new ForceCombinationByFactorVM(forceCombination); DataContext = viewModel; + viewModel.ParentWindow = this; } } } diff --git a/StructureHelper/Windows/Forces/ForceCombinationView.xaml b/StructureHelper/Windows/Forces/ForceCombinationView.xaml index f914571..7dc2efd 100644 --- a/StructureHelper/Windows/Forces/ForceCombinationView.xaml +++ b/StructureHelper/Windows/Forces/ForceCombinationView.xaml @@ -7,16 +7,18 @@ xmlns:vm="clr-namespace:StructureHelper.Windows.ViewModels.Forces" d:DataContext="{d:DesignInstance vm:ForceCombinationViewModel}" mc:Ignorable="d" - Title="Force Combination" Height="250" Width="550" MinHeight="300" MinWidth="450" MaxWidth="500" WindowStartupLocation="CenterScreen"> + Title="Force Combination" Height="350" Width="550" MinHeight="300" MinWidth="450" MaxWidth="500" WindowStartupLocation="CenterScreen"> + + diff --git a/StructureHelper/Windows/Forces/ForceCombinationView.xaml.cs b/StructureHelper/Windows/Forces/ForceCombinationView.xaml.cs index b0d0011..f4917d1 100644 --- a/StructureHelper/Windows/Forces/ForceCombinationView.xaml.cs +++ b/StructureHelper/Windows/Forces/ForceCombinationView.xaml.cs @@ -27,13 +27,11 @@ namespace StructureHelper.Windows.Forces viewModel = _viewModel; DataContext = viewModel; InitializeComponent(); + viewModel.ParentWindow = this; } - public ForceCombinationView(IForceCombinationList combinationList) + public ForceCombinationView(IForceCombinationList combinationList) : this(new ForceCombinationViewModel(combinationList)) { - viewModel = new ForceCombinationViewModel(combinationList); - DataContext = viewModel; - InitializeComponent(); } } } diff --git a/StructureHelper/Windows/MainWindow/MainViewModel.cs b/StructureHelper/Windows/MainWindow/MainViewModel.cs index 4138bf8..e3ad7bd 100644 --- a/StructureHelper/Windows/MainWindow/MainViewModel.cs +++ b/StructureHelper/Windows/MainWindow/MainViewModel.cs @@ -407,6 +407,10 @@ namespace StructureHelper.Windows.MainWindow { GlobalRepository.Materials.Create(item); } + foreach (var item in newRepository.ForceActions) + { + GlobalRepository.Actions.Create(item); + } return primitives; } return new List(); diff --git a/StructureHelper/Windows/MainWindow/Materials/HeadMaterialsView.xaml b/StructureHelper/Windows/MainWindow/Materials/HeadMaterialsView.xaml index ca0c51f..7e57013 100644 --- a/StructureHelper/Windows/MainWindow/Materials/HeadMaterialsView.xaml +++ b/StructureHelper/Windows/MainWindow/Materials/HeadMaterialsView.xaml @@ -15,13 +15,12 @@ - - + @@ -42,19 +41,7 @@ -