public CreateNewEventViewModel( IValidationObjectFactory validationObjectFactory, ITeamActionsManagmentDataItems teamActionsManagmentDataItems, ISchedulingService schedulingService) : base( validationObjectFactory, teamActionsManagmentDataItems, schedulingService) { GameManagingHeader = CREATE_NEW_EVENT_HEADER; IsSaveAndCreateAnotherCommandAvalilable = true; SaveCommand = new Command(async() => { Guid busyKey = Guid.NewGuid(); SetBusy(busyKey, true); ResetCancellationTokenSource(ref _createEventCancellationTokenSource); CancellationTokenSource cancellationTokenSource = _createEventCancellationTokenSource; EventDTO eventAction = await CreateNewEventAsync(cancellationTokenSource); if (eventAction != null) { await NavigationService.GoBackAsync(); } SetBusy(busyKey, false); }); }
public EditGameViewModel( IValidationObjectFactory validationObjectFactory, ITeamActionsManagmentDataItems teamActionsManagmentDataItems, ISchedulingService schedulingService) : base( validationObjectFactory, teamActionsManagmentDataItems, schedulingService) { GameManagingHeader = EDIT_GAME_HEADER; SaveCommand = new Command(async() => { Guid busyKey = Guid.NewGuid(); SetBusy(busyKey, true); ResetCancellationTokenSource(ref _updateGameCancellationTokenSource); CancellationTokenSource cancellationTokenSource = _updateGameCancellationTokenSource; GameDTO createdGame = await UpdateGameAsync(cancellationTokenSource); if (createdGame != null) { await NavigationService.GoBackAsync(); } SetBusy(busyKey, false); }); }
public AssignmentViewModel( IValidationObjectFactory validationObjectFactory, ITeamActionsManagmentDataItems teamActionsManagmentDataItems) { _validationObjectFactory = validationObjectFactory; _teamActionsManagmentDataItems = teamActionsManagmentDataItems; AssignmentStatuses = _teamActionsManagmentDataItems.BuildAssignmentStatusDataItems(); ResetValidationObjects(); }
public EventsViewModel( ITeamMemberService teamMemberService, ITeamActionsManagmentDataItems teamActionsManagmentDataItems, IStateService stateService) { _teamMemberService = teamMemberService; _teamActionsManagmentDataItems = teamActionsManagmentDataItems; _stateService = stateService; GameEventActions = _teamActionsManagmentDataItems.BuildActionCreatingDataItems(new Command(async(object args) => { ContentPageBaseViewModel relativeBasePage = NavigationService.LastPageViewModel as ContentPageBaseViewModel; Guid busyKey; if (relativeBasePage != null) { busyKey = Guid.NewGuid(); relativeBasePage.SetBusy(busyKey, true); await Task.Delay(AppConsts.DELAY_STUB); } if (((TeamActionManagmentDataItem)args).ActionTitle == TeamActionsManagmentDataItems.NEW_GAME_ACTION_TITLE) { await NavigationService.NavigateToAsync <CreateNewGameViewModel>(SelectedTeam); } else if (((TeamActionManagmentDataItem)args).ActionTitle == TeamActionsManagmentDataItems.NEW_EVENT_ACTION_TITLE) { await NavigationService.NavigateToAsync <CreateNewEventViewModel>(SelectedTeam); } else { Debugger.Break(); } if (relativeBasePage != null) { relativeBasePage.SetBusy(busyKey, false); } })); IsNestedPullToRefreshEnabled = true; }
public EventManagingViewModelBase( IValidationObjectFactory validationObjectFactory, ITeamActionsManagmentDataItems teamActionsManagmentDataItems, ISchedulingService schedulingService) { _validationObjectFactory = validationObjectFactory; _teamActionsManagmentDataItems = teamActionsManagmentDataItems; _schedulingService = schedulingService; AppBackgroundImage = GlobalSettings.Instance.UserProfile.AppBackgroundImage?.Url; ActionBarViewModel = ViewModelLocator.Resolve <ModeActionBarViewModel>(); ActionBarViewModel.InitializeAsync(this); ((ModeActionBarViewModel)ActionBarViewModel).IsModesAvailable = false; AddLocationPopupViewModel = ViewModelLocator.Resolve <AddLocationPopupViewModel>(); AddLocationPopupViewModel.InitializeAsync(this); Repeatings = _teamActionsManagmentDataItems.BuildRepeatingsDataItems(); ResetValidationObjects(); }