Files
Proftaak-RH-B4/ClientApp/ViewModels/LoginViewModel.cs
2020-10-07 16:31:44 +02:00

31 lines
980 B
C#

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Input;
using ClientApp.Utils;
using GalaSoft.MvvmLight.Command;
namespace ClientApp.ViewModels
{
class LoginViewModel : ObservableObject
{
public string Username { get; set; }
private MainWindowViewModel mainWindowViewModel;
public LoginViewModel(MainWindowViewModel mainWindowViewModel)
{
this.mainWindowViewModel = mainWindowViewModel;
LoginCommand = new RelayCommand<object>((parameter) =>
{
Debug.WriteLine($"username {Username} password {((PasswordBox)parameter).Password}");
//TODO send username and password to server
this.mainWindowViewModel.SelectedViewModel = new MainViewModel();
});
}
public ICommand LoginCommand { get; set; }
}
}