LoginView.xaml.cs 783 Bytes
using HHECS.RobotTool.ViewModel.AccountVM;
using Microsoft.Extensions.DependencyInjection;
using RobotTool;
using System.Windows;
using System.Windows.Input;

namespace HHECS.RobotTool.View.AccountView
{
    /// <summary>
    /// LoginView.xaml 的交互逻辑
    /// </summary>
    public partial class LoginView : Window
    {
        private readonly LoginVM vm;
        public LoginView()
        {
            InitializeComponent();
            vm = App.Current.Services.GetService<LoginVM>()!;
            vm.Owner = this;
            DataContext = vm;
        }

        private void txt_pwd_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                vm.CommintCommand.Execute(null);
            }
        }
    }
}