| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using GalaSoft.MvvmLight;
- using GalaSoft.MvvmLight.Command;
- namespace Egametang
- {
- public class MainViewModel : ViewModelBase
- {
- private Main main = new Main();
- private RelayCommand loginCmd = null;
- private LoginRealm loginRealm = null;
- public MainViewModel()
- {
- loginCmd = new RelayCommand(Login);
- loginRealm = new LoginRealm(this);
- }
- public string LoginResult
- {
- get
- {
- return main.LoginResult;
- }
- set
- {
- if (main.LoginResult == value)
- {
- return;
- }
- main.LoginResult = value;
- RaisePropertyChanged("LoginResult");
- }
- }
- public RelayCommand LoginCmd
- {
- get
- {
- return loginCmd;
- }
- }
- private void Login()
- {
- loginRealm.Login();
- }
- public override void Cleanup()
- {
- base.Cleanup();
- }
- }
- }
|