CommunicationAddOrEditView.xaml.cs
1014 Bytes
using HHECS.RobotTool.ViewModel.CommunicationVM;
using Microsoft.Extensions.DependencyInjection;
using RobotTool;
using System.Windows;
namespace HHECS.RobotTool.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;
}
}
}