diff --git a/ClientApp/Models/ClientInfo.cs b/ClientApp/Models/ClientInfo.cs deleted file mode 100644 index c048917..0000000 --- a/ClientApp/Models/ClientInfo.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using ClientApp.Utils; - -namespace ClientApp.Models -{ - class ClientInfo : ObservableObject - { - public string FirstName { get; set; } - public string LastName { get; set; } - } -} diff --git a/ClientApp/Models/Info.cs b/ClientApp/Models/Info.cs new file mode 100644 index 0000000..e976bda --- /dev/null +++ b/ClientApp/Models/Info.cs @@ -0,0 +1,14 @@ +using ClientApp.Utils; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ClientApp.Models +{ + class Info : ObservableObject + { + public bool ConnectedToServer { get; set; } + public bool ConnectedToVREngine { get; set; } + public bool DoctorConnected { get; set; } + } +} diff --git a/ClientApp/ViewModels/LoginViewModel.cs b/ClientApp/ViewModels/LoginViewModel.cs index dab0455..afeab98 100644 --- a/ClientApp/ViewModels/LoginViewModel.cs +++ b/ClientApp/ViewModels/LoginViewModel.cs @@ -2,6 +2,7 @@ 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; @@ -12,15 +13,15 @@ namespace ClientApp.ViewModels class LoginViewModel : ObservableObject { public string Username { get; set; } - //private MainWindowViewModel mainWindowViewModel; + private MainWindowViewModel mainWindowViewModel; public LoginViewModel(MainWindowViewModel mainWindowViewModel) { - //this.mainWindowViewModel = mainWindowViewModel; + this.mainWindowViewModel = mainWindowViewModel; LoginCommand = new RelayCommand((parameter) => { Debug.WriteLine($"username {Username} password {((PasswordBox)parameter).Password}"); //TODO send username and password to server - mainWindowViewModel.SelectedViewModel = new MainViewModel(); + this.mainWindowViewModel.SelectedViewModel = new MainViewModel(); }); } diff --git a/ClientApp/ViewModels/MainViewModel.cs b/ClientApp/ViewModels/MainViewModel.cs index 3e945e6..684564c 100644 --- a/ClientApp/ViewModels/MainViewModel.cs +++ b/ClientApp/ViewModels/MainViewModel.cs @@ -1,17 +1,29 @@ -using ClientApp.Utils; -using System; -using System.Collections.Generic; -using System.Text; +using ClientApp.Models; +using ClientApp.Utils; +using GalaSoft.MvvmLight.Command; +using System.Windows.Input; namespace ClientApp.ViewModels { class MainViewModel : ObservableObject { - public string StatusLabelText { get; set; } + public Info infoModel { get; set; } + public ICommand RetryServerCommand { get; set; } + public ICommand RetryVREngineCommand { get; set; } public MainViewModel() { - StatusLabelText = "Status: not running"; + this.infoModel = new Info(); + this.RetryServerCommand = new RelayCommand(() => + { + //try connect server + this.infoModel.ConnectedToServer = true; + }); + this.RetryVREngineCommand = new RelayCommand(() => + { + //try connect vr-engine + this.infoModel.ConnectedToVREngine = true; + }); } } } diff --git a/ClientApp/Views/MainView.xaml b/ClientApp/Views/MainView.xaml index 21d15ff..6c1796e 100644 --- a/ClientApp/Views/MainView.xaml +++ b/ClientApp/Views/MainView.xaml @@ -7,14 +7,46 @@ mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800"> - - + + + + + + - + + + + + + + + + + + + + + + + + + +