public CandidatesViewModel(IRecruitmentQueryService recruitmentQueryService, IAlertService alertService)
        {
            this.recruitmentQueryService = recruitmentQueryService;
            this.alertService            = alertService;

            Candidates = new ObservableCollection <Candidate>();

            Title = "Candidates";
        }
        public MatchCriteriaViewModel(IRecruitmentQueryService recruitmentQueryService, IDataService dataService, IAlertService alertService)
        {
            this.recruitmentQueryService = recruitmentQueryService;
            this.dataService             = dataService;
            this.alertService            = alertService;

            PropertyChanged += MatchCriteriaViewModel_PropertyChanged;

            Title = "Match Criteria";

            #region Input Suggestion

            TechnologySuggestions = new ObservableCollection <string>();

            TechnologyTextChangedCommand = new Command <AutoSuggestTextChangeReason>(async reason =>
            {
                if (reason == AutoSuggestTextChangeReason.UserInput)
                {
                    if (!string.IsNullOrEmpty(Technology))
                    {
                        if (Technology.Length >= 2)
                        {
                            TechnologySuggestions = (await recruitmentQueryService.GetTechnologiesAsync())
                                                    .Where(t => t.Name.ToLower().Contains(Technology.ToLower()))
                                                    .Select(t => t.Name).ToList();
                        }
                    }
                    else
                    {
                        TechnologySuggestions = null;
                    }
                }
            });

            TechnologySuggestionChosenCommand = new Command <string>(chosenSuggestion =>
            {
                Technology = chosenSuggestion;
            });

            TechnologyQuerySubmittedCommand = new Command <QuerySubmitArgs>(args =>
            {
                if (args.ChosenSuggestion != null)
                {
                    // User selected an item from the suggestion list, take an action on it here.
                }
                else
                {
                    // User hit Enter from the search box. Use args.QueryText to determine what to do.
                }
            });

            #endregion
        }
예제 #3
0
        public SwipeMatchesViewModel(
            IRecruitmentQueryService recruitmentQueryService,
            IAlertService alertService,
            IVibrationService vibrationService)
        {
            this.recruitmentQueryService = recruitmentQueryService;
            this.alertService            = alertService;
            this.vibrationService        = vibrationService;

            Matches = new ObservableCollection <Candidate>();
            Matches.CollectionChanged += Matches_CollectionChanged;

            SwipeCommand = new Command <SwipedCardEventArgs>(OnSwipe);

            Title = "Matches";
        }