예제 #1
0
 public TrackDetailMotiveViewModel(IRepoManager repoManager,
                                   INavigation navigation,
                                   ITabiConfiguration configuration,
                                   TrackMotiveViewModel motiveViewModel,
                                   MotiveSelectionViewModel motiveSelectionViewModel) : base(repoManager, navigation, configuration, motiveSelectionViewModel)
 {
     Motive = motiveViewModel ?? throw new ArgumentNullException(nameof(motiveViewModel));
     SetupMotives();
 }
예제 #2
0
        private void PrepareForMotive()
        {
            // Find an existing Motive for the current track.
            Motive stopMotive = _repoManager.MotiveRepository.GetByTrackId(_trackEntry.Id);

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

            Motive = new TrackMotiveViewModel(stopMotive, _motiveConfig);

            _motiveListItem = new ListItem()
            {
                Name     = AppResources.TrackMotiveLabel,
                Subtitle = Motive.ConvertedText ?? AppResources.SetTrackMotiveHint,
                Command  = OpenTrackMotiveCommand
            };

            DataItems.Add(_motiveListItem);

            Motive.PropertyChanged += Motive_PropertyChanged;;
        }