SearchViewBase Class
Provides the abstract base class for a view with editor-searching UI.
[TemplatePart(Name = "PART_CloseButton", Type = typeof(ButtonBase))]
[TemplatePart(Name = "PART_FindAllButton", Type = typeof(ButtonBase))]
[TemplatePart(Name = "PART_FindNextButton", Type = typeof(ButtonBase))]
[TemplatePart(Name = "PART_FindWhatTextBox", Type = typeof(TextBox))]
[TemplatePart(Name = "PART_MatchCaseButton", Type = typeof(ButtonBase))]
[TemplatePart(Name = "PART_MatchWholeWordButton", Type = typeof(ButtonBase))]
[TemplatePart(Name = "PART_ModeToggleButton", Type = typeof(ButtonBase))]
[TemplatePart(Name = "PART_ReplaceAllButton", Type = typeof(ButtonBase))]
[TemplatePart(Name = "PART_ReplaceNextButton", Type = typeof(ButtonBase))]
[TemplatePart(Name = "PART_ReplaceWithTextBox", Type = typeof(TextBox))]
[TemplatePart(Name = "PART_SearchScopeComboBox", Type = typeof(ComboBox))]
[TemplatePart(Name = "PART_SearchUpButton", Type = typeof(ButtonBase))]
[TemplatePart(Name = "PART_UseRegularExpressionsButton", Type = typeof(ButtonBase))]
public abstract class SearchViewBase : Control
- Inheritance:
- object Visual UIElement FrameworkElement Control object
- Derived:
- EditorSearchView SearchOverlayPane
Constructors
SearchViewBase()
Initializes an instance of the class.
protected SearchViewBase()
Properties
AnimationDuration
The Duration of the expander animations.
public Duration AnimationDuration { get; set; }
Property Value
- Duration:
The default value is
100milliseconds.
ButtonStyle
The Style to apply to buttons.
CanToggleReplace
Indicates whether replace UI can be toggled visible by the end user.
public bool CanToggleReplace { get; set; }
Property Value
- bool:
trueif replace UI can be toggled visible by the end user; otherwise,false. The default value istrue.
FindAllCommand
The ICommand that performs a find all operation.
FindNextCommand
The ICommand that performs a find next operation.
FindWhatTextBox
The TextBox in the template.
HasNoSearchResults
Indicates whether there are no search results for the current find text.
public bool HasNoSearchResults { get; set; }
Property Value
- bool:
trueif there are no search results for the current find text; otherwise,false. The default value isfalse.
Remarks
When true, some search UI may show an indicator that there is no search match.
IsFindAllButtonVisible
Indicates whether the find all button is visible.
public bool IsFindAllButtonVisible { get; set; }
Property Value
- bool:
trueif the find all button is visible; otherwise,false. The default value isfalse.
IsOptionsPanelExpanded
Indicates whether the options panel is currently visible.
public bool IsOptionsPanelExpanded { get; set; }
Property Value
- bool:
trueif the options panel is currently visible; otherwise,false. The default value isfalse.
IsReplaceVisible
Indicates whether replace UI is currently visible.
public bool IsReplaceVisible { get; set; }
Property Value
- bool:
trueif replace UI is currently visible; otherwise,false. The default value isfalse.
ReplaceAllCommand
The ICommand that performs a replace all operation.
ReplaceNextCommand
The ICommand that performs a replace next operation.
ReplaceWithTextBox
The TextBox in the template.
SearchOptions
The IEditorSearchOptions to use when searching within the editor with the search overlay pane.
public IEditorSearchOptions? SearchOptions { get; set; }
Property Value
Remarks
This property defaults to using the static Default property value.
SearchPatternProviderFactory
The ISearchPatternProviderFactory that creates the collection of available search pattern providers.
public ISearchPatternProviderFactory SearchPatternProviderFactory { get; set; }
Property Value
SearchPatternProviders
The read-only collection of available ISearchPatternProvider objects.
public ReadOnlyCollection<ISearchPatternProvider> SearchPatternProviders { get; }
Property Value
Remarks
Change the SearchPatternProviderFactory property value to update this collection.
TargetView
The target IEditorView in which the searching will occur.
ToggleOptionsPanelExpandedCommand
The ICommand that toggles if the options panel is expanded.
UseRegularExpressions
Indicates whether to use regular expressions for searching.
public bool UseRegularExpressions { get; set; }
Property Value
- bool:
trueif regular expressions should be used for searching; otherwise,false. The default value isfalse.
Remarks
Setting this property will toggle the PatternProvider between RegularExpression and Normal.
Methods
FocusFindWhatTextBox()
Attempts to select all and focus the find-what TextBox.
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate().
public override void OnApplyTemplate()
OnFindSearchOptionsChanged()
Occurs when a search option is changed that may affect find results, such as those used for search result highlighting.
protected virtual void OnFindSearchOptionsChanged()
OnFindWhatTextBoxKeyDown(KeyEventArgs)
Occurs when a key is pressed.
protected virtual void OnFindWhatTextBoxKeyDown(KeyEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | KeyEventArgs | The event data. |
OnReplaceWithTextBoxKeyDown(KeyEventArgs)
Occurs when a key is pressed.
protected virtual void OnReplaceWithTextBoxKeyDown(KeyEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | KeyEventArgs | The event data. |
OnSearchOptionsChanged()
Occurs when the search options have changed.
protected virtual void OnSearchOptionsChanged()
OnSearchScopeChanged()
Occurs when the search scope has changed.
protected virtual void OnSearchScopeChanged()
OnSearching(SearchOperationType)
Occurs before a search operation is executed by the end user.
protected virtual void OnSearching(SearchOperationType operationType)
| Parameter | Type | Description |
|---|---|---|
| operationType | SearchOperationType | A SearchOperationType that indicates the search operation type. |
RaiseCanExecuteChangedForCommands()
Raise the can-execute changed events for commands.
protected virtual void RaiseCanExecuteChangedForCommands()
Events
SearchOptionsChanged
Occurs when the search options or one of its properties have changed.
Fields
AnimationDurationProperty
Defines the AnimationDuration property.
public static readonly DependencyProperty AnimationDurationProperty
ButtonStyleProperty
Defines the ButtonStyle property.
public static readonly DependencyProperty ButtonStyleProperty
CanToggleReplaceProperty
Defines the CanToggleReplace property.
public static readonly DependencyProperty CanToggleReplaceProperty
HasNoSearchResultsProperty
Defines the HasNoSearchResults property.
public static readonly DependencyProperty HasNoSearchResultsProperty
IsFindAllButtonVisibleProperty
Defines the IsFindAllButtonVisible property.
public static readonly DependencyProperty IsFindAllButtonVisibleProperty
IsOptionsPanelExpandedProperty
Defines the IsOptionsPanelExpanded property.
public static readonly DependencyProperty IsOptionsPanelExpandedProperty
IsReplaceVisibleProperty
Defines the IsReplaceVisible property.
public static readonly DependencyProperty IsReplaceVisibleProperty
SearchOptionsProperty
Defines the SearchOptions property.
public static readonly DependencyProperty SearchOptionsProperty
SearchPatternProviderFactoryProperty
Defines the SearchPatternProviderFactory property.
public static readonly DependencyProperty SearchPatternProviderFactoryProperty
UseRegularExpressionsProperty
Defines the UseRegularExpressions property.
public static readonly DependencyProperty UseRegularExpressionsProperty