コード例 #1
0
        public TeamStatisticsViewModel(ITeamClient teamClient, IStatisticsClient statisticsClient, ITimerService timerService, IEventAggregator eventAggregator, ICacheService cacheService)
        {
            _teamClient = teamClient;
            _statisticsClient = statisticsClient;
            timerService.Start(TimeSpan.FromSeconds(10), OnRefresh);
            _eventAggregator = eventAggregator;
            _cacheService = cacheService;

            Func<Boolean> canExecute = () =>
            {
                var password = new NetworkCredential(string.Empty, TeamPassword).Password;
                return !String.IsNullOrWhiteSpace(TeamName) && !TeamName.Contains(" ") &&
                       !String.IsNullOrWhiteSpace(password) && !password.Contains(" ");
            };

            AcceptExistingTeamCommand = new RelayCommand(OnAcceptExistingTeam, canExecute);
            CreateNewTeamCommand = new RelayCommand(OnCreateNewTeam, canExecute);
        }