public DescriptionsNavigationViewModel( IEventAggregator eventAggregator, ILoggerFacade logger, [Import(typeof(IShellView), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)] IShellView view, [Import(typeof(IUrakawaSession), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)] IUrakawaSession urakawaSession) { m_EventAggregator = eventAggregator; m_Logger = logger; m_UrakawaSession = urakawaSession; m_ShellView = view; m_Logger.Log("DescriptionsNavigationViewModel.initializeCommands", Category.Debug, Priority.Medium); CommandFindFocusDescriptions = new RichDelegateCommand( @"DESCRIPTIONS CommandFindFocus DUMMY TXT", @"DESCRIPTIONS CommandFindFocus DUMMY TXT", null, // KeyGesture set only for the top-level CompositeCommand null, () => { m_ShellView.RaiseEscapeEvent(); if (View != null) { IsSearchVisible = true; FocusHelper.Focus(View.SearchBox); View.SearchBox.SelectAll(); } }, () => View != null //&& View.SearchBox.Visibility == Visibility.Visible && View.SearchBox.IsEnabled, null, //Settings_KeyGestures.Default, null //PropertyChangedNotifyBase.GetMemberName(() => Settings_KeyGestures.Default.Keyboard_Nav_TOCFindNext) ); CommandFindNextDescription = new RichDelegateCommand( @"DESCRIPTIONS CommandFindNext DUMMY TXT", @"DESCRIPTIONS CommandFindNext DUMMY TXT", null, // KeyGesture set only for the top-level CompositeCommand null, () => { m_ShellView.RaiseEscapeEvent(); DescriptionsNavigator.FindNext(true); }, () => DescriptionsNavigator != null && !string.IsNullOrEmpty(DescriptionsNavigator.SearchTerm), null, //Settings_KeyGestures.Default, null //PropertyChangedNotifyBase.GetMemberName(() => Settings_KeyGestures.Default.Keyboard_Nav_DescriptionsFindNext) ); CommandFindPrevDescription = new RichDelegateCommand( @"DESCRIPTIONS CommandFindPrevious DUMMY TXT", @"DESCRIPTIONS CommandFindPrevious DUMMY TXT", null, // KeyGesture set only for the top-level CompositeCommand null, () => { m_ShellView.RaiseEscapeEvent(); DescriptionsNavigator.FindPrevious(true); }, () => DescriptionsNavigator != null && !string.IsNullOrEmpty(DescriptionsNavigator.SearchTerm), null, //Settings_KeyGestures.Default, null //PropertyChangedNotifyBase.GetMemberName(() => Settings_KeyGestures.Default.Keyboard_Nav_DescFindPrev) ); m_EventAggregator.GetEvent <ProjectLoadedEvent>().Subscribe(onProjectLoaded, ProjectLoadedEvent.THREAD_OPTION); m_EventAggregator.GetEvent <ProjectUnLoadedEvent>().Subscribe(onProjectUnLoaded, ProjectUnLoadedEvent.THREAD_OPTION); m_EventAggregator.GetEvent <DescribableTreeNodeFoundByFlowDocumentParserEvent>().Subscribe(onDescribableTreeNodeFoundByFlowDocumentParser, DescribableTreeNodeFoundByFlowDocumentParserEvent.THREAD_OPTION); m_EventAggregator.GetEvent <TreeNodeSelectionChangedEvent>().Subscribe(OnTreeNodeSelectionChanged, TreeNodeSelectionChangedEvent.THREAD_OPTION); }