UserAddOrEditView.xaml.cs
890 Bytes
using HHECS.RobotTool.ViewModel.AccountVM;
using Microsoft.Extensions.DependencyInjection;
using RobotTool;
using System.Windows;
namespace HHECS.RobotTool.View.AccountView
{
/// <summary>
/// UserAddOrEditView.xaml 的交互逻辑
/// </summary>
public partial class UserAddOrEditView : Window
{
private int communicationId;
public UserAddOrEditView()
{
InitializeComponent();
var vm = App.Current.Services.GetService<UserAddOrEditVM>()!;
vm.Owner = this;
vm.InitialData();
DataContext = vm;
}
public UserAddOrEditView(int userId)
{
InitializeComponent();
var vm = App.Current.Services.GetService<UserAddOrEditVM>()!;
vm.Owner = this;
vm.InitialData(userId);
DataContext = vm;
}
}
}