CommunicationAddOrEditView.xaml.cs 1 KB
using HHECS.DAQClient.Model;
using HHECS.DAQClient.ViewModel.CommunicationVM;
using Microsoft.Extensions.DependencyInjection;
using System.Windows;

namespace HHECS.DAQClient.View.CommunicationView
{
    /// <summary>
    /// CommunicationAddView.xaml 的交互逻辑
    /// </summary>
    public partial class CommunicationAddOrEditView : Window
    {
        public CommunicationAddOrEditView()
        {
            InitializeComponent();
            var dataContext = App.Current.Services.GetService<CommunicationAddOrEditVM>();
            dataContext.Owner = this;
            dataContext.InitialData();
            DataContext = dataContext;
        }

        public CommunicationAddOrEditView(int communicationConfigId)
        {
            InitializeComponent();
            var dataContext = App.Current.Services.GetService<CommunicationAddOrEditVM>();
            dataContext.Owner = this;
            dataContext.InitialData(communicationConfigId);
            DataContext = dataContext;
        }
    }
}