public void LoadData(object dataInstance)
        {
            var helper = ((OverviewDataHelper)dataInstance);

            using (mailbox.Messages.ReaderLock)
                SelectedMessage =
                    mailbox.Messages.FirstOrDefault(
                        c => c.MessageId == helper.MessageId);

            if (SelectedMessage == null)
            {
                throw new ApplicationException(
                          String.Format("Message was not found. MessageId = {0}", ((OverviewDataHelper)dataInstance).MessageId));
            }

            // Mark all messages as read
            SelectedMessage.MarkRead();

            OnPropertyChanged("SelectedMessage");
            OnPropertyChanged("Title");

            if (SelectedConversation == null || SelectedMessage.Conversation != SelectedConversation)
            {
                SelectedConversation = SelectedMessage.Conversation;
                OnPropertyChanged("SelectedConversation");

                Messages.Replace(SelectedConversation.Messages);

                if (list != null)
                {
                    list.SelectedItem = SelectedMessage;

                    Dispatcher.BeginInvoke(DispatcherPriority.Input, (Action)(() => list.ScrollIntoView(SelectedMessage)));
                }
            }

            MessageActionsBox.Show(SelectedMessage);
            ThreadView.Show(SelectedMessage);
            UserProfileControl.SourceAddress = SelectedMessage.From;

            FocusHelper.Focus(TabSink);
        }
        void GotoLabel_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            ClientStats.LogEventWithSegment("Goto folder (keyboard)", ActivityView.Label.ToString());

            LogicalTreeWalker.Walk((FrameworkElement)TabHost.HeaderContent, delegate(UIElement element)
            {
                if (Responder.GetIsSearchResponder(element))
                {
                    FocusHelper.Focus(element);

                    if (element is TextBox)
                    {
                        var tb = (TextBox)element;

                        tb.Text           = "label: ";
                        tb.SelectionStart = tb.Text.Length;
                    }
                }
            });
        }
Exemple #3
0
        void AddLabel_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            ClientStats.LogEvent("Add label in stream");

            using (new ListViewIndexFix(streamView.StreamListView))
            {
                if (State.SelectedMessages.Count == 1)
                {
                    var lvItem = (ListViewItem)streamView.StreamListView.ItemContainerGenerator.ContainerFromItem(State.SelectedMessage);
                    var editor = (LabelsEditorControl)VisualTreeWalker.FindName("LabelsEditor", lvItem);

                    editor.Visibility = Visibility.Visible;
                    FocusHelper.Focus(editor);
                }
                else
                {
                    // Show modal labels adder
                    EventBroker.Publish(AppEvents.RequestAddLabels, State.SelectedMessages.ToList());
                }
            }
        }
        void Cancel_Click(object sender, RoutedEventArgs e)
        {
            ClientStats.LogEvent("Cancel status update in realtime streams overview column");

            if (ShowViral)
            {
                ShowViral = false;
                OnPropertyChanged("ShowViral");

                SettingsManager.ClientSettings.AppConfiguration.IsFirstStatusUpdate = false;
                SettingsManager.Save();
            }
            else
            {
                ReplyTo = null;
                OnPropertyChanged("ReplyTo");
            }

            PART_StatusUpdateTextbox.Text = String.Empty;

            // Put focus back on listview
            FocusHelper.Focus(((TabItem)StreamsTab.SelectedItem));
        }
Exemple #5
0
        private void forceRefreshDataUI()
        {
            MetadatasListView.Items.Refresh();
            if (MetadatasListView.Items.Count > 0)
            {
                MetadatasListView.SelectedIndex = 0;
            }
            MetadataAttributesListView.Items.Refresh();
            if (MetadataAttributesListView.Items.Count > 0)
            {
                MetadataAttributesListView.SelectedIndex = 0;
            }
            //if (MetadatasListView.IsVisible)
            //{
            //    FocusHelper.Focus(MetadatasListView);
            //}
            OnSelectionChanged_MetadataList(null, null);

            DescriptionsListView.Items.Refresh();
            if (DescriptionsListView.Items.Count > 0)
            {
                DescriptionsListView.SelectedIndex = 0;
            }
            MetadatasAltContentListView.Items.Refresh();
            if (MetadatasAltContentListView.Items.Count > 0)
            {
                MetadatasAltContentListView.SelectedIndex = 0;
            }
            //if (DescriptionsListView.IsVisible)
            //{
            //    FocusHelper.Focus(DescriptionsListView);
            //}
            OnSelectionChanged_DescriptionsList(null, null);

            FocusHelper.Focus(ImageLabel);
        }
Exemple #6
0
        private void intializeCommands()
        {
            m_Logger.Log("HeadingPaneViewModel.initializeCommands", Category.Debug, Priority.Medium);

            //
            CommandExpandAll = new RichDelegateCommand(
                Tobi_Plugin_NavigationPane_Lang.CmdTreeExpandAll_ShortDesc,
                Tobi_Plugin_NavigationPane_Lang.CmdTreeExpandAll_LongDesc,
                null,
                m_ShellView.LoadTangoIcon("list-add"),
                () => HeadingsNavigator.ExpandAll(),
                () => HeadingsNavigator != null,
                null, null);
            //
            CommandCollapseAll = new RichDelegateCommand(
                Tobi_Plugin_NavigationPane_Lang.CmdTreeCollapseAll_ShortDesc,
                Tobi_Plugin_NavigationPane_Lang.CmdTreeCollapseAll_LongDesc,
                null,
                m_ShellView.LoadTangoIcon("list-remove"),
                () => HeadingsNavigator.CollapseAll(),
                () => HeadingsNavigator != null,
                null, null);
            //
            m_ShellView.RegisterRichCommand(CommandExpandAll);
            m_ShellView.RegisterRichCommand(CommandCollapseAll);
            //
            CommandFindFocus = new RichDelegateCommand(
                @"HEADINGS CommandFindFocus DUMMY TXT",
                @"HEADINGS 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)
                );
            //
            CommandFindNext = new RichDelegateCommand(
                @"HEADINGS CommandFindNext DUMMY TXT", //UserInterfaceStrings.TreeFindNext,
                @"HEADINGS CommandFindNext DUMMY TXT", //UserInterfaceStrings.TreeFindNext_,
                null,                                  // KeyGesture set only for the top-level CompositeCommand
                null,
                () =>
            {
                m_ShellView.RaiseEscapeEvent();

                HeadingsNavigator.FindNext(true);
            },
                () => HeadingsNavigator != null && !string.IsNullOrEmpty(HeadingsNavigator.SearchTerm),
                null, //Settings_KeyGestures.Default,
                null  //PropertyChangedNotifyBase.GetMemberName(() => Settings_KeyGestures.Default.Keyboard_Nav_TOCFindNext)
                );
            //
            CommandFindPrev = new RichDelegateCommand(
                @"HEADINGS CommandFindPrev DUMMY TXT", //UserInterfaceStrings.TreeFindPrev,
                @"HEADINGS CommandFindPrev DUMMY TXT", //UserInterfaceStrings.TreeFindPrev_,
                null,                                  // KeyGesture set only for the top-level CompositeCommand
                null,
                () =>
            {
                m_ShellView.RaiseEscapeEvent();

                HeadingsNavigator.FindPrevious(true);
            },
                () => HeadingsNavigator != null && !string.IsNullOrEmpty(HeadingsNavigator.SearchTerm),
                null, //Settings_KeyGestures.Default,
                null  //PropertyChangedNotifyBase.GetMemberName(() => Settings_KeyGestures.Default.Keyboard_Nav_TOCFindPrev)
                );


            /*
             *          CommandExpand = new RichDelegateCommand(
             *              UserInterfaceStrings.TreeExpand,
             *              UserInterfaceStrings.TreeExpand_,
             *              null,
             *              shellView.LoadGnomeNeuIcon("Neu_list-add"),
             *              ()=> _headingsNavigator.Expand((HeadingTreeNodeWrapper)obj),
             *              ()=> (_headingsNavigator != null && (obj as HeadingTreeNodeWrapper).HasChildren && !(obj as HeadingTreeNodeWrapper).IsExpanded));
             */
            //

            /*
             *          CommandCollapse = new RichDelegateCommand(
             *              UserInterfaceStrings.TreeCollapse,
             *              UserInterfaceStrings.TreeCollapse_,
             *              null,
             *              shellView.LoadGnomeNeuIcon("Neu_list-remove"),
             *              ()=> _headingsNavigator.Collapse((HeadingTreeNodeWrapper)obj),
             *              ()=> (_headingsNavigator != null && (obj as HeadingTreeNodeWrapper).HasChildren && (obj as HeadingTreeNodeWrapper).IsExpanded));
             */
            /*CommandEditText = new RichDelegateCommand(
             *  UserInterfaceStrings.TreeEdit,
             *  UserInterfaceStrings.TreeEdit_,
             *  null,
             *  shellView.LoadTangoIcon("accessories-text-editor"),
             *  ()=> _headingsNavigator.EditText((HeadingTreeNodeWrapper)obj),
             *  ()=> _headingsNavigator!=null);*/
        }
        public PagesPaneViewModel(
            IEventAggregator eventAggregator,
            ILoggerFacade logger,
            [Import(typeof(IShellView), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IShellView view,
            [Import(typeof(IUrakawaSession), RequiredCreationPolicy = CreationPolicy.Shared, AllowDefault = false)]
            IUrakawaSession session)
        {
            m_EventAggregator = eventAggregator;
            m_Logger          = logger;

            m_ShellView = view;
            m_session   = session;

            m_Logger.Log("PagesPaneViewModel.initializeCommands", Category.Debug, Priority.Medium);

            CommandRenumberPages = new RichDelegateCommand(
                Tobi_Plugin_NavigationPane_Lang.CmdNavigationRenumberPages_ShortDesc,
                Tobi_Plugin_NavigationPane_Lang.CmdNavigationRenumberPages_LongDesc,
                null, // KeyGesture obtained from settings (see last parameters below)
                null, //m_ShellView.LoadTangoIcon("bookmark-new"),
                () =>
            {
                if (PagesNavigator_Pages.Count <= 0)
                {
                    return;
                }

                var textBox_pageNumberStringPrefix = new TextBox()
                {
                    Text = ""
                };

                var label_pageNumberStringPrefix = new TextBlock()
                {
                    Text   = Tobi_Plugin_NavigationPane_Lang.PageNumberPrefix + ": ",
                    Margin = new Thickness(8, 0, 8, 0),
                    HorizontalAlignment = HorizontalAlignment.Center,
                    VerticalAlignment   = VerticalAlignment.Center,
                    Focusable           = true,
                    TextWrapping        = TextWrapping.Wrap
                };

                var panel_pageNumberStringPrefix = new DockPanel()
                {
                    HorizontalAlignment = HorizontalAlignment.Stretch,
                    VerticalAlignment   = VerticalAlignment.Center,
                    Margin = new Thickness(0, 0, 0, 18)
                };
                label_pageNumberStringPrefix.SetValue(DockPanel.DockProperty, Dock.Left);
                panel_pageNumberStringPrefix.Children.Add(label_pageNumberStringPrefix);
                panel_pageNumberStringPrefix.Children.Add(textBox_pageNumberStringPrefix);

                var textBox_pageNumberIntegerStart = new TextBox()
                {
                    Text = "1"
                };

                var label_pageNumberIntegerStart = new TextBlock()
                {
                    Text   = Tobi_Plugin_NavigationPane_Lang.PageNumberStart + ": ",
                    Margin = new Thickness(8, 0, 8, 0),
                    HorizontalAlignment = HorizontalAlignment.Center,
                    VerticalAlignment   = VerticalAlignment.Center,
                    Focusable           = true,
                    TextWrapping        = TextWrapping.Wrap
                };

                var panel_pageNumberIntegerStart = new DockPanel()
                {
                    HorizontalAlignment = HorizontalAlignment.Stretch,
                    VerticalAlignment   = VerticalAlignment.Center,
                    Margin = new Thickness(0, 0, 0, 0)
                };
                label_pageNumberIntegerStart.SetValue(DockPanel.DockProperty, Dock.Left);
                panel_pageNumberIntegerStart.Children.Add(label_pageNumberIntegerStart);
                panel_pageNumberIntegerStart.Children.Add(textBox_pageNumberIntegerStart);



                var panel = new StackPanel
                {
                    Orientation         = Orientation.Vertical,
                    HorizontalAlignment = HorizontalAlignment.Stretch,
                    VerticalAlignment   = VerticalAlignment.Center,
                };

                panel.Children.Add(panel_pageNumberStringPrefix);
                panel.Children.Add(panel_pageNumberIntegerStart);

                var windowPopup = new PopupModalWindow(m_ShellView,
                                                       UserInterfaceStrings.EscapeMnemonic(Tobi_Plugin_NavigationPane_Lang.CmdNavigationRenumberPages_ShortDesc),
                                                       panel,
                                                       PopupModalWindow.DialogButtonsSet.OkCancel,
                                                       PopupModalWindow.DialogButton.Ok,
                                                       false, 250, 160, null, 40, null);
                windowPopup.ShowModal();

                if (windowPopup.ClickedDialogButton != PopupModalWindow.DialogButton.Ok)
                {
                    return;
                }


                string prefix = "";
                if (!String.IsNullOrEmpty(textBox_pageNumberStringPrefix.Text))
                {
                    prefix = textBox_pageNumberStringPrefix.Text;
                }

                int pageNumber = 1;
                if (!String.IsNullOrEmpty(textBox_pageNumberIntegerStart.Text))
                {
                    try
                    {
                        pageNumber = Int32.Parse(textBox_pageNumberIntegerStart.Text);
                    }
                    catch (Exception ex)
                    {
                        return;
                    }
                }



                var treeNodes = new List <TreeNode>(PagesNavigator_Pages.Count);
                foreach (Page marked in PagesNavigator_Pages)
                {
                    treeNodes.Add(marked.TreeNode);
                }

                string pageNumberStr = "";

                m_session.DocumentProject.Presentations.Get(0).UndoRedoManager.StartTransaction(Tobi_Plugin_NavigationPane_Lang.CmdNavigationRenumberPages_ShortDesc, Tobi_Plugin_NavigationPane_Lang.CmdNavigationRenumberPages_LongDesc, "PAGE_BREAKS_RENUMBER");
                foreach (TreeNode treeNode in treeNodes)
                {
                    pageNumberStr = prefix + (pageNumber++);
                    var cmd       = treeNode.Presentation.CommandFactory.CreateTreeNodeChangeTextCommand(treeNode, pageNumberStr);
                    treeNode.Presentation.UndoRedoManager.Execute(cmd);
                }
                m_session.DocumentProject.Presentations.Get(0).UndoRedoManager.EndTransaction();
            },
                () => m_session.DocumentProject != null && !m_session.isAudioRecording &&
                !m_session.IsXukSpine, //SelectedTreeNode != null, //!m_UrakawaSession.IsSplitMaster &&
                Settings_KeyGestures.Default,
                null)                  //PropertyChangedNotifyBase.GetMemberName(() => Settings_KeyGestures.Default.Keyboard_RemoveAllDocMarks)
            ;

            m_ShellView.RegisterRichCommand(CommandRenumberPages);

            CommandFindFocusPage = new RichDelegateCommand(
                @"PAGES CommandFindFocus DUMMY TXT",
                @"PAGES 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)
                );

            CommandFindNextPage = new RichDelegateCommand(
                @"PAGES CommandFindNext DUMMY TXT", //UserInterfaceStrings.PageFindNext,
                @"PAGES CommandFindNext DUMMY TXT", //UserInterfaceStrings.PageFindNext_,
                null,                               // KeyGesture set only for the top-level CompositeCommand
                null, () =>
            {
                m_ShellView.RaiseEscapeEvent();

                PagesNavigator.FindNext(true);
            },
                () => PagesNavigator != null && !string.IsNullOrEmpty(PagesNavigator.SearchTerm),
                null, //Settings_KeyGestures.Default,
                null  //PropertyChangedNotifyBase.GetMemberName(() => Settings_KeyGestures.Default.Keyboard_Nav_PageFindNext)
                );

            CommandFindPrevPage = new RichDelegateCommand(
                @"PAGES CommandFindPrevious DUMMY TXT", //UserInterfaceStrings.PageFindPrev,
                @"PAGES CommandFindPrevious DUMMY TXT", //UserInterfaceStrings.PageFindPrev_,
                null,                                   // KeyGesture set only for the top-level CompositeCommand
                null, () =>
            {
                m_ShellView.RaiseEscapeEvent();

                PagesNavigator.FindPrevious(true);
            },
                () => PagesNavigator != null && !string.IsNullOrEmpty(PagesNavigator.SearchTerm),
                null, //Settings_KeyGestures.Default,
                null  //PropertyChangedNotifyBase.GetMemberName(() => Settings_KeyGestures.Default.Keyboard_Nav_PageFindPrev)
                );

            m_EventAggregator.GetEvent <ProjectLoadedEvent>().Subscribe(onProjectLoaded, ProjectLoadedEvent.THREAD_OPTION);
            m_EventAggregator.GetEvent <ProjectUnLoadedEvent>().Subscribe(onProjectUnLoaded, ProjectUnLoadedEvent.THREAD_OPTION);

            m_EventAggregator.GetEvent <PageFoundByFlowDocumentParserEvent>().Subscribe(onPageFoundByFlowDocumentParser, PageFoundByFlowDocumentParserEvent.THREAD_OPTION);

            m_EventAggregator.GetEvent <TreeNodeSelectionChangedEvent>().Subscribe(OnTreeNodeSelectionChanged, TreeNodeSelectionChangedEvent.THREAD_OPTION);
        }
Exemple #8
0
        public MarkersPaneViewModel(
            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("MarkersPaneViewModel.initializeCommands", Category.Debug, Priority.Medium);

            CommandToggleMark = new RichDelegateCommand(
                Tobi_Plugin_NavigationPane_Lang.CmdNavigationToggleMark_ShortDesc,
                Tobi_Plugin_NavigationPane_Lang.CmdNavigationToggleMark_LongDesc,
                null,                     // KeyGesture obtained from settings (see last parameters below)
                m_ShellView.LoadTangoIcon("bookmark-new"),
                () =>
            {
                var cmd = SelectedTreeNode.Presentation.CommandFactory.CreateTreeNodeSetIsMarkedCommand(SelectedTreeNode, !SelectedTreeNode.IsMarked);
                SelectedTreeNode.Presentation.UndoRedoManager.Execute(cmd);
            },
                () => SelectedTreeNode != null && !m_UrakawaSession.isAudioRecording &&
                !m_UrakawaSession.IsXukSpine,         //!m_UrakawaSession.IsSplitMaster &&
                Settings_KeyGestures.Default,
                PropertyChangedNotifyBase.GetMemberName(() => Settings_KeyGestures.Default.Keyboard_ToggleDocMark));

            m_ShellView.RegisterRichCommand(CommandToggleMark);

            CommandRemoveAllMarks = new RichDelegateCommand(
                Tobi_Plugin_NavigationPane_Lang.CmdNavigationRemoveAllMarks_ShortDesc,
                Tobi_Plugin_NavigationPane_Lang.CmdNavigationRemoveAllMarks_LongDesc,
                null,                     // KeyGesture obtained from settings (see last parameters below)
                null,                     //m_ShellView.LoadTangoIcon("bookmark-new"),
                () =>
            {
                if (MarkersNavigator_MarkedTreeNodes.Count <= 0)
                {
                    return;
                }
                var treeNodes = new List <TreeNode>(MarkersNavigator_MarkedTreeNodes.Count);
                foreach (MarkedTreeNode marked in MarkersNavigator_MarkedTreeNodes)
                {
                    treeNodes.Add(marked.TreeNode);
                }

                m_UrakawaSession.DocumentProject.Presentations.Get(0).UndoRedoManager.StartTransaction(Tobi_Plugin_NavigationPane_Lang.CmdNavigationRemoveAllMarks_ShortDesc, Tobi_Plugin_NavigationPane_Lang.CmdNavigationRemoveAllMarks_LongDesc, "MARKS_REMOVE_ALL");
                foreach (TreeNode treeNode in treeNodes)
                {
                    var cmd = treeNode.Presentation.CommandFactory.CreateTreeNodeSetIsMarkedCommand(treeNode, !treeNode.IsMarked);
                    treeNode.Presentation.UndoRedoManager.Execute(cmd);
                }
                m_UrakawaSession.DocumentProject.Presentations.Get(0).UndoRedoManager.EndTransaction();
            },
                () => m_UrakawaSession.DocumentProject != null && !m_UrakawaSession.isAudioRecording &&
                !m_UrakawaSession.IsXukSpine,         //SelectedTreeNode != null, //!m_UrakawaSession.IsSplitMaster &&
                Settings_KeyGestures.Default,
                PropertyChangedNotifyBase.GetMemberName(() => Settings_KeyGestures.Default.Keyboard_RemoveAllDocMarks));

            m_ShellView.RegisterRichCommand(CommandRemoveAllMarks);

            CommandFindFocusMarkers = new RichDelegateCommand(
                @"MARKERS CommandFindFocus DUMMY TXT",
                @"MARKERS 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)
                );

            CommandFindNextMarkers = new RichDelegateCommand(
                @"MARKERS CommandFindNext DUMMY TXT", //UserInterfaceStrings.MarkersFindNext,
                @"MARKERS CommandFindNext DUMMY TXT", //UserInterfaceStrings.MarkersFindNext_,
                null,                                 // KeyGesture set only for the top-level CompositeCommand
                null, () =>
            {
                m_ShellView.RaiseEscapeEvent();

                MarkersNavigator.FindNext(true);
            },
                () => MarkersNavigator != null && !string.IsNullOrEmpty(MarkersNavigator.SearchTerm),
                null, //Settings_KeyGestures.Default,
                null  //PropertyChangedNotifyBase.GetMemberName(() => Settings_KeyGestures.Default.Keyboard_Nav_MarkersFindNext)
                );

            CommandFindPrevMarkers = new RichDelegateCommand(
                @"MARKERS CommandFindPrevious DUMMY TXT", //UserInterfaceStrings.MarkersFindPrev,
                @"MARKERS CommandFindPrevious DUMMY TXT", //UserInterfaceStrings.MarkersFindPrev_,
                null,                                     // KeyGesture set only for the top-level CompositeCommand
                null, () =>
            {
                m_ShellView.RaiseEscapeEvent();

                MarkersNavigator.FindPrevious(true);
            },
                () => MarkersNavigator != null && !string.IsNullOrEmpty(MarkersNavigator.SearchTerm),
                null, //Settings_KeyGestures.Default,
                null  //PropertyChangedNotifyBase.GetMemberName(() => Settings_KeyGestures.Default.Keyboard_Nav_MarkersFindPrev)
                );

            m_EventAggregator.GetEvent <ProjectLoadedEvent>().Subscribe(onProjectLoaded, ProjectLoadedEvent.THREAD_OPTION);
            m_EventAggregator.GetEvent <ProjectUnLoadedEvent>().Subscribe(onProjectUnLoaded, ProjectUnLoadedEvent.THREAD_OPTION);

            m_EventAggregator.GetEvent <MarkedTreeNodeFoundByFlowDocumentParserEvent>().Subscribe(onMarkedTreeNodeFoundByFlowDocumentParser, MarkedTreeNodeFoundByFlowDocumentParserEvent.THREAD_OPTION);

            m_EventAggregator.GetEvent <TreeNodeSelectionChangedEvent>().Subscribe(OnTreeNodeSelectionChanged, TreeNodeSelectionChangedEvent.THREAD_OPTION);
        }
Exemple #9
0
 private void WorkItemSelectorView_Loaded(object sender, System.Windows.RoutedEventArgs e)
 {
     FocusHelper.Focus(uxWorkItemId); // WTH is this necessary?
 }
        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);
        }
 void Window_Loaded(object sender, RoutedEventArgs e)
 {
     FocusHelper.Focus(LabelsEditor);
 }
Exemple #12
0
 void SearchPopup_Opened(object sender, EventArgs e)
 {
     FocusHelper.Focus(PART_SearchTextbox);
 }
        void AddLabel_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            ClientStats.LogEvent("Add label in message details view");

            FocusHelper.Focus(ThreadView.LabelsEditor);
        }
        void InlineReply_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            ClientStats.LogEvent("Inline reply in message details view");

            FocusHelper.Focus(ThreadView.QuickReplyAll);
        }