public SubClipViewModel(ISubClipView subClipView, IEventAggregator eventAggregator, IConfigurationService configurationService) { this.subClipView = subClipView; this.eventAggregator = eventAggregator; this.maxNumberOfAudioTracks = configurationService.GetParameterValueAsInt("MaxNumberOfAudioTracks").GetValueOrDefault(1); this.DropCommand = new DelegateCommand <DropPayload>(this.HandleDrop, this.CanHandleDrop); this.AudioPreviewSelectionChangedCommand = new DelegateCommand <StreamOption>(this.HandleAudioPreviewSelectionChanged); this.VideoPreviewSelectionChangedCommand = new DelegateCommand <StreamOption>(this.HandleVideoPreviewSelectionChanged); this.VideoSequenceSelectionChangedCommand = new DelegateCommand <StreamOption>(this.HandleVideoSequenceSelectionChanged); this.KeyboardActionCommand = new DelegateCommand <Tuple <KeyboardAction, object> >(this.HandleKeyboardAction); this.AudioSequenceSelectionChangedCommand = new DelegateCommand <StreamOption>(this.HandleAudioSequenceSelectionChanged); this.Title = "Sub-Clip Tool"; this.AvailableVideoStreams = new ObservableCollection <StreamOption>(); this.AvailableAudioStreams = new ObservableCollection <StreamOption>(); this.eventAggregator.GetEvent <AddPreviewEvent>().Subscribe(this.AddPreview, ThreadOption.PublisherThread, true, this.FilterAddPreviewEvent); this.subClipView.SetDataContext(this); this.eventAggregator.GetEvent <ResetWindowsEvent>().Subscribe(this.ResetWindow); }
public void Initialize() { this.RegisterViewsAndServices(); ISubClipView subClipView = this.unityContainer.Resolve <ISubClipViewModel>().View; bool shouldSubClipWindow = this.windowManager.ShouldDisplayWindow(subClipView.GetType().ToString(), true); if (shouldSubClipWindow) { this.regionManager.Regions[RegionNames.MainRegion].Add(subClipView); } IMenuButtonViewModel menuViewModel = this.unityContainer.Resolve <IMenuButtonViewModel>(); menuViewModel.IsViewActive = shouldSubClipWindow; menuViewModel.ViewToDisplay = subClipView; menuViewModel.Text = "Sub-Clip"; this.regionManager.Regions[RegionNames.MenuRegion].Add(menuViewModel.View); }