示例#1
0
        public MainViewModel(Dispatcher dispatcher)
        {
            _dispatcher = dispatcher;

            _botHost = ((App)App.Current).XmppHost;
            _botHost.RegistrationComplete += RegistrationCompleteHandler;
            OpenXmppLogViewCommand = new RelayCommand(OpenXmppLogView, true);
            ExitApplicationCommand = new RelayCommand(ExitApplication, true);
            WindowTitle = "RPS - Connected as " + _botHost.Connection.MyJID.Bare;
            _gameController = ServiceLocator.Current.GetInstance<GameController>();

            if (((App)App.Current).IsServer)
                _gameController.ShowCreateTournamentView();
            else
                _gameController.ShowRegisterView();
        }