예제 #1
0
        private void TextEditor_Unloaded(object sender, RoutedEventArgs e)
        {
            if (!(sender is TextEditor textEditor))
            {
                return;
            }

            textEditor.TextChanging     -= TextEditor_TextChanging;
            textEditor.SelectionChanged -= TextEditor_SelectionChanged;

            if (Sets.Items?.Count == 0)
            {
                Application.Current.Exit();
            }

            if (SearchBarPlaceHolder.Visibility == Visibility.Visible)
            {
                SearchBarPlaceHolder.Dismiss();
            }
        }
예제 #2
0
        private void ShowFindAndReplaceControl(bool showReplaceBar)
        {
            var findAndReplace = (FindAndReplaceControl)SearchBarPlaceHolder.Content;

            if (findAndReplace == null)
            {
                return;
            }

            SearchBarPlaceHolder.Height = findAndReplace.GetHeight(showReplaceBar);
            findAndReplace.ShowReplaceBar(showReplaceBar);

            if (SearchBarPlaceHolder.Visibility == Visibility.Collapsed)
            {
                SearchBarPlaceHolder.Show();
            }

            Task.Factory.StartNew(
                () => Dispatcher.RunAsync(CoreDispatcherPriority.Low,
                                          () => findAndReplace.Focus()));
        }
예제 #3
0
 private void FindAndReplaceControl_OnDismissKeyDown(object sender, RoutedEventArgs e)
 {
     SearchBarPlaceHolder.Dismiss();
     FocusOnSelectedTextEditor();
 }