Example #1
0
        public StopDetailMotiveViewModel(IRepoManager repoManager,
                                         INavigation navigation,
                                         ITabiConfiguration configuration,
                                         StopMotiveViewModel motiveViewModel,
                                         MotiveSelectionViewModel motiveSelectionViewModel) : base(repoManager, navigation, configuration, motiveSelectionViewModel)
        {
            Motive = motiveViewModel ?? throw new ArgumentNullException(nameof(motiveViewModel));

            SetupMotives();
        }
Example #2
0
        private void PrepareForMotive()
        {
            // Find an existing Motive for the current stopvisit.
            Motive stopMotive = _repoManager.MotiveRepository.GetByStopVisitId(_stopVisit.Id);

            // Initialize a new motive since the ViewModel needs one.
            stopMotive = stopMotive ?? new Motive()
            {
                StopVisitId = _stopVisit.Id
            };

            Motive = new StopMotiveViewModel(stopMotive, _motiveConfig);

            MotiveText      = MotiveTextFromString(Motive.ConvertedText);
            CompletedMotive = !string.IsNullOrEmpty(Motive.ConvertedText);

            Motive.PropertyChanged += MotiveViewModel_PropertyChanged;
        }