using System.Windows.Input;
using ChatController.LoginKlassen;

namespace ownChat
{
    public partial class LoginMaske
    {
        public LoginMaske()
        {
            InitializeComponent();

            Title = "ownChat Desktop";
        }

        private void LoginControl_OnOnLogin(ChatDatenUebergabe cdu)
        {
            var mainWindow = new MainWindow(cdu);
            mainWindow.Show();
            Close();
        }

        private void LoginMaske_OnKeyDown(object sender, KeyEventArgs e)
        {
            if(e.Key == Key.Enter)
            {
                LoginControl.Login();
            }
        }
    }
}
