Exemplo n.º 1
0
 public RefereeFormViewModel(IRegionManager regionManager, IViewToDataService viewToDataService, ILeagueService leagueService)
 {
     this.regionManager     = regionManager;
     this.leagueService     = leagueService;
     this.viewToDataService = viewToDataService;
     this.Referee           = new Referee();
 }
 public SeasonFormViewModel(IRegionManager regionManager, IViewToDataService viewToDataService, ILeagueService leagueService)
 {
     this.regionManager     = regionManager;
     this.leagueService     = leagueService;
     this.viewToDataService = viewToDataService;
     this.Season            = new Season();
 }
 public SelectEditItemViewModel(IRegionManager regionManager, IViewToDataService viewToDataService, ILeagueService leagueService)
 {
     this.regionManager     = regionManager;
     this.leagueService     = leagueService;
     this.viewToDataService = viewToDataService;
     this.NextViewCommand   = new DelegateCommand(() =>
     {
         if (this.SelectedItem == null)
         {
             return;
         }
         var parameter = new NavigationParameters();
         parameter.Add("id", this.SelectedItem.Id);
         regionManager.RequestNavigate(UiRegions.MainRegion, this.nextView, parameter);
     });
 }
Exemplo n.º 4
0
        public TeamFormViewModel(IRegionManager regionManager, IViewToDataService viewToDataService, ILeagueService leagueService, IInteractionService interactionService)
        {
            this.regionManager      = regionManager;
            this.leagueService      = leagueService;
            this.viewToDataService  = viewToDataService;
            this.interactionService = interactionService;
            this.Team = new Team()
            {
                Address = new Address()
            };
            this.RemovePlayerCommand = new DelegateCommand <Footballer>((Footballer player) =>
            {
                if (player != null)
                {
                    this.leagueService.RemovePlayerFromTeam(player);
                    this.Footballers.Remove(player);
                    OnPropertyChanged("Team");
                }
            });

            this.RemoveSeasonCommand = new DelegateCommand <Table>(async(Table table) =>
            {
                if (table != null)
                {
                    this.IsEnabled = GlobalCommands.BlockWindowButtons();
                    var result     = await this.leagueService.RemoveTeamFromSeason(table.Id);
                    if (result)
                    {
                        this.Tables.Remove(table);
                    }
                    else
                    {
                        await this.interactionService.ShowMessageBox("Cannot remove team from season", "This team is already included in fixtures");
                    }
                    this.IsEnabled = GlobalCommands.UnlockWindowButtons();
                }
            });
        }
 public MatchListFormViewModel(IRegionManager regionManager, IRefereeService refereeService, IViewToDataService viewToDataService)
 {
     this.regionManager     = regionManager;
     this.refereeService    = refereeService;
     this.viewToDataService = viewToDataService;
 }