EquipmentAddOrEdit.xaml.cs
879 Bytes
using HHECS.DAQClient.ViewModel.EquipmentVM;
using Microsoft.Extensions.DependencyInjection;
using System.Windows;
namespace HHECS.DAQClient.View.EquipmentView
{
/// <summary>
/// Equipment_Add.xaml 的交互逻辑
/// </summary>
public partial class EquipmentAddOrEditView : Window
{
public EquipmentAddOrEditView()
{
InitializeComponent();
var vm = App.Current.Services.GetService<EquipmentAddOrEditVM>();
vm.Owner = this;
vm.InitialData();
this.DataContext = vm;
}
public EquipmentAddOrEditView(int equipmentId)
{
InitializeComponent();
var vm = App.Current.Services.GetService<EquipmentAddOrEditVM>();
vm.Owner = this;
vm.InitialData(equipmentId);
this.DataContext = vm;
}
}
}