diff --git a/Aucma.Core.OldBoxFoam/ViewModels/RoadKindPageViewModel.cs b/Aucma.Core.OldBoxFoam/ViewModels/RoadKindPageViewModel.cs new file mode 100644 index 00000000..5355544c --- /dev/null +++ b/Aucma.Core.OldBoxFoam/ViewModels/RoadKindPageViewModel.cs @@ -0,0 +1,57 @@ +using Admin.Core.IService; +using Admin.Core.Model.Model_New; +using Admin.Core.Service; +using Aucma.Core.OldBoxFoam; +using Aucma.Core.OldBoxFoam.Models; +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; +using CommunityToolkit.Mvvm.Messaging; +using Microsoft.Extensions.DependencyInjection; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; + +namespace Aucma.Core.BoxFoam.ViewModels +{ + + + public partial class RoadKindPageViewModel : ObservableObject + { + protected readonly IBoxFoamPlanServices? _boxFoamPlanServices; + protected IOldBoxFoamTypeServices? _boxFoamTypeServices; + public RoadKindPageViewModel() + { + _boxFoamPlanServices = App.ServiceProvider.GetService(); + _boxFoamTypeServices = App.ServiceProvider.GetService(); + InitData(); + } + + public async void InitData() + { + List list = await _boxFoamTypeServices.QueryAsync(); + foreach(OldBoxFoamType item in list) + { + OldBoxFoamTypeModel model= new OldBoxFoamTypeModel(); + model.MaterialCode = item.MaterialCode; + model.Status = "1"; + Shapes.Add(model); + } + } + + #region 初始化 + private ObservableCollection _shapes = new ObservableCollection(); + public ObservableCollection Shapes + { + get => _shapes; + set => SetProperty(ref _shapes, value); + } + #endregion + + + + } +} diff --git a/Aucma.Core.OldBoxFoam/Views/RoadKindPageView.xaml b/Aucma.Core.OldBoxFoam/Views/RoadKindPageView.xaml index 37d10729..7e6dcc2d 100644 --- a/Aucma.Core.OldBoxFoam/Views/RoadKindPageView.xaml +++ b/Aucma.Core.OldBoxFoam/Views/RoadKindPageView.xaml @@ -121,71 +121,130 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + diff --git a/Aucma.Core.OldBoxFoam/Views/RoadKindPageView.xaml.cs b/Aucma.Core.OldBoxFoam/Views/RoadKindPageView.xaml.cs index b472df42..1c1007d8 100644 --- a/Aucma.Core.OldBoxFoam/Views/RoadKindPageView.xaml.cs +++ b/Aucma.Core.OldBoxFoam/Views/RoadKindPageView.xaml.cs @@ -1,4 +1,5 @@ -using Aucma.Core.OldBoxFoam.ViewModels; +using Aucma.Core.BoxFoam.ViewModels; +using Aucma.Core.OldBoxFoam.ViewModels; using System; using System.Collections.Generic; using System.Linq; @@ -24,7 +25,7 @@ namespace Aucma.Core.OldBoxFoam.Views public RoadKindPageView() { InitializeComponent(); - this.DataContext = new FoamPlanPageViewModel(); + this.DataContext = new RoadKindPageViewModel(); } } }