示例#1
0
        public TeamPageViewModel(
            ILogger logger,
            IUiNavigationService navigationService,
            ITeamService teamService,
            BrainstormingContext context)
        {
            _logger            = logger;
            _navigationService = navigationService;
            _teamService       = teamService;
            _context           = context;

            TeamList = FillTeamList();
            if (TeamList.Any() && _context.CurrentBrainstormingTeam == null)
            {
                SelectedTeam = TeamList[0];
                _context.CurrentBrainstormingTeam = SelectedTeam;
            }
            SelectTeamCommand = new DelegateCommand(SelectTeam);
            CreateTeamCommand = new DelegateCommand(async() => await CreateTeam());
            JoinTeamCommand   = new DelegateCommand(async() => await JoinTeam());
            LeaveTeamCommand  = new DelegateCommand <BrainstormingTeam>(LeaveTeam);
            RefreshCommand    = new DelegateCommand(async() => await Task.Run(RefreshTeamList));
        }