Share via


SearchHandler Class

Definition

Provides search functionality in a Shell application.

public ref class SearchHandler : Microsoft::Maui::Controls::BindableObject, Microsoft::Maui::Controls::Internals::IFontElement, Microsoft::Maui::Controls::ISearchHandlerController, Microsoft::Maui::Controls::ITextAlignmentElement, Microsoft::Maui::Controls::ITextElement
public ref class SearchHandler : Microsoft::Maui::Controls::BindableObject, Microsoft::Maui::Controls::Internals::IFontElement, Microsoft::Maui::Controls::ISearchHandlerController
public class SearchHandler : Microsoft.Maui.Controls.BindableObject, Microsoft.Maui.Controls.Internals.IFontElement, Microsoft.Maui.Controls.ISearchHandlerController, Microsoft.Maui.Controls.ITextAlignmentElement, Microsoft.Maui.Controls.ITextElement
public class SearchHandler : Microsoft.Maui.Controls.BindableObject, Microsoft.Maui.Controls.Internals.IFontElement, Microsoft.Maui.Controls.ISearchHandlerController
type SearchHandler = class
    inherit BindableObject
    interface ISearchHandlerController
    interface IFontElement
    interface ITextElement
    interface ITextAlignmentElement
type SearchHandler = class
    inherit BindableObject
    interface ISearchHandlerController
    interface IFontElement
Public Class SearchHandler
Inherits BindableObject
Implements IFontElement, ISearchHandlerController, ITextAlignmentElement, ITextElement
Public Class SearchHandler
Inherits BindableObject
Implements IFontElement, ISearchHandlerController
Inheritance
SearchHandler
Implements

Constructors

Name Description
SearchHandler()

Fields

Name Description
AutomationIdProperty

Bindable property for AutomationId.

BackgroundColorProperty

Bindable property for BackgroundColor.

CancelButtonColorProperty

Bindable property for CancelButtonColor.

CharacterSpacingProperty

Bindable property for CharacterSpacing.

ClearIconHelpTextProperty

Bindable property for ClearIconHelpText.

ClearIconNameProperty

Bindable property for ClearIconName.

ClearIconProperty

Bindable property for ClearIcon.

ClearPlaceholderCommandParameterProperty

Bindable property for ClearPlaceholderCommandParameter.

ClearPlaceholderCommandProperty

Bindable property for ClearPlaceholderCommand.

ClearPlaceholderEnabledProperty

Bindable property for ClearPlaceholderEnabled.

ClearPlaceholderHelpTextProperty

Bindable property for ClearPlaceholderHelpText.

ClearPlaceholderIconProperty

Bindable property for ClearPlaceholderIcon.

ClearPlaceholderNameProperty

Bindable property for ClearPlaceholderName.

CommandParameterProperty

Bindable property for CommandParameter.

CommandProperty

Bindable property for Command.

DisplayMemberNameProperty

Bindable property for DisplayMemberName.

FontAttributesProperty

Bindable property for FontAttributes.

FontAutoScalingEnabledProperty

Bindable property for FontAutoScalingEnabled.

FontFamilyProperty

Bindable property for FontFamily.

FontSizeProperty

Bindable property for FontSize.

HorizontalTextAlignmentProperty

Bindable property for HorizontalTextAlignment.

IsFocusedProperty

Bindable property for IsFocused.

IsFocusedPropertyKey

Bindable property key for IsFocused.

IsSearchEnabledProperty

Bindable property for IsSearchEnabled.

ItemsSourceProperty

Bindable property for ItemsSource.

ItemTemplateProperty

Bindable property for ItemTemplate.

KeyboardProperty

Bindable property for Keyboard.

PlaceholderColorProperty

Bindable property for PlaceholderColor.

PlaceholderProperty

Bindable property for Placeholder.

QueryIconHelpTextProperty

Bindable property for QueryIconHelpText.

QueryIconNameProperty

Bindable property for QueryIconName.

QueryIconProperty

Bindable property for QueryIcon.

QueryProperty

Bindable property for Query.

SearchBoxVisibilityProperty

Bindable property for SearchBoxVisibility.

SelectedItemProperty

Bindable property for SelectedItem.

ShowsResultsProperty

Bindable property for ShowsResults.

TextColorProperty

Bindable property for TextColor.

TextTransformProperty

Bindable property for TextTransform.

VerticalTextAlignmentProperty

Bindable property for VerticalTextAlignment.

Properties

Name Description
AutomationId
BackgroundColor

Gets or sets the background color of the search box. This is a bindable property.

BindingContext

Gets or sets an object that contains the properties that will be targeted by the bound properties that belong to this BindableObject. This is a bindable property.

(Inherited from BindableObject)
CancelButtonColor

Gets or sets the color of the cancel button. This is a bindable property.

CharacterSpacing

Gets or sets the character spacing for the search text. This is a bindable property.

ClearIcon

Gets or sets the icon displayed for the clear button. This is a bindable property.

ClearIconHelpText

Gets or sets the accessibility help text for the clear icon. This is a bindable property.

ClearIconName

Gets or sets the accessibility name for the clear icon. This is a bindable property.

ClearPlaceholderCommand

Gets or sets the command invoked when the clear placeholder button is pressed. This is a bindable property.

ClearPlaceholderCommandParameter

Gets or sets the parameter passed to ClearPlaceholderCommand. This is a bindable property.

ClearPlaceholderEnabled

Gets or sets a value indicating whether the clear placeholder button is enabled. This is a bindable property.

ClearPlaceholderHelpText

Gets or sets the accessibility help text for the clear placeholder icon. This is a bindable property.

ClearPlaceholderIcon

Gets or sets the icon displayed for the clear placeholder button. This is a bindable property.

ClearPlaceholderName

Gets or sets the accessibility name for the clear placeholder icon. This is a bindable property.

Command

Gets or sets the command invoked when the search query is confirmed. This is a bindable property.

CommandParameter

Gets or sets the parameter passed to Command. This is a bindable property.

Dispatcher

Gets the dispatcher that was available when this bindable object was created, otherwise tries to find the nearest available dispatcher (probably the window's/app's).

(Inherited from BindableObject)
DisplayMemberName
Obsolete.

Gets or sets the name of the property to display for search results. This is a bindable property.

FontAttributes

Gets or sets the font attributes for the search text. This is a bindable property.

FontAutoScalingEnabled
FontFamily

Gets or sets the font family for the search text. This is a bindable property.

FontSize

Gets or sets the font size for the search text. This is a bindable property.

HorizontalTextAlignment

Gets or sets the horizontal alignment of the search text. This is a bindable property.

IsFocused

Gets a value indicating whether this search handler currently has focus. This is a bindable property.

IsSearchEnabled

Gets or sets a value indicating whether search is enabled. This is a bindable property.

ItemsSource

Gets or sets the collection of items to display as search suggestions. This is a bindable property.

ItemTemplate

Gets or sets the template for displaying search result items. This is a bindable property.

Keyboard

Gets or sets the keyboard type for the search input. This is a bindable property.

Placeholder

Gets or sets the text displayed when the search box is empty. This is a bindable property.

PlaceholderColor

Gets or sets the color of the placeholder text. This is a bindable property.

Query

Gets or sets the current search query text. This is a bindable property.

QueryIcon

Gets or sets the icon displayed for the search query. This is a bindable property.

QueryIconHelpText

Gets or sets the accessibility help text for the query icon. This is a bindable property.

QueryIconName

Gets or sets the accessibility name for the query icon. This is a bindable property.

SearchBoxVisibility

Gets or sets the visibility mode of the search box. This is a bindable property.

SelectedItem

Gets the currently selected search result item. This is a bindable property.

ShowsResults

Gets or sets a value indicating whether search results are displayed. This is a bindable property.

TextColor

Gets or sets the color of the search text. This is a bindable property.

TextTransform

Gets or sets the text transformation applied to the search text. This is a bindable property.

VerticalTextAlignment

Gets or sets the vertical alignment of the search text. This is a bindable property.

Methods

Name Description
ApplyBindings()

Applies all the current bindings to BindingContext.

(Inherited from BindableObject)
ClearValue(BindableProperty)

Clears any value that is previously set for a bindable property.

(Inherited from BindableObject)
ClearValue(BindablePropertyKey)

Clears any value that is previously set for a bindable property, identified by its key.

(Inherited from BindableObject)
CoerceValue(BindableProperty)

Coerces the value of the specified bindable property. This is done by invoking BindableProperty.CoerceValueDelegate of the specified bindable property.

(Inherited from BindableObject)
CoerceValue(BindablePropertyKey)

Coerces the value of the specified bindable property. This is done by invoking BindableProperty.CoerceValueDelegate of the specified bindable property.

(Inherited from BindableObject)
Focus()

Sets focus to the search handler, causing the input field to become the current focus.

GetValue(BindableProperty)

Returns the value that is contained in the given bindable property.

(Inherited from BindableObject)
HideSoftInputAsync()
IsSet(BindableProperty)

Determines whether or not a bindable property exists and has a value set.

(Inherited from BindableObject)
OnBindingContextChanged()

Raises the BindingContextChanged event.

(Inherited from BindableObject)
OnClearPlaceholderClicked()
OnFocused()
OnItemSelected(Object)
OnPropertyChanged(String)

Raises the PropertyChanged event.

(Inherited from BindableObject)
OnPropertyChanging(String)

Raises the PropertyChanging event.

(Inherited from BindableObject)
OnQueryChanged(String, String)
OnQueryConfirmed()
OnUnfocus()
RemoveBinding(BindableProperty)

Removes a previously set binding from a bindable property.

(Inherited from BindableObject)
SetBinding(BindableProperty, BindingBase)

Assigns a binding to a bindable property.

(Inherited from BindableObject)
SetIsFocused(Boolean)

Sets the value of the IsFocused property. For internal use by platform renderers.

SetValue(BindableProperty, Object)

Sets the value of the specified bindable property.

(Inherited from BindableObject)
SetValue(BindablePropertyKey, Object)

Sets the value of the specified bindable property.

(Inherited from BindableObject)
ShowSoftInputAsync()
UnapplyBindings()

Removes all current bindings from the current context.

(Inherited from BindableObject)
Unfocus()

Removes focus from the search handler.

UpdateFormsText(String, TextTransform)

Returns the transformed text using the specified TextTransform.

Events

Name Description
BindingContextChanged

Occurs when the value of the BindingContext property changes.

(Inherited from BindableObject)
FocusChangeRequested
Focused
PropertyChanged

Occurs when a property value changes.

(Inherited from BindableObject)
PropertyChanging

Occurs when a property value is changing.

(Inherited from BindableObject)
Unfocused

Explicit Interface Implementations

Name Description
IDynamicResourceHandler.SetDynamicResource(BindableProperty, String) (Inherited from BindableObject)
IFontElement.FontSizeDefaultValueCreator()
IFontElement.OnFontAttributesChanged(FontAttributes, FontAttributes)
IFontElement.OnFontAutoScalingEnabledChanged(Boolean, Boolean)
IFontElement.OnFontFamilyChanged(String, String)
IFontElement.OnFontSizeChanged(Double, Double)
ISearchHandlerController.ClearPlaceholderClicked()
ISearchHandlerController.ItemSelected(Object)
ISearchHandlerController.ListProxy
ISearchHandlerController.ListProxyChanged
ISearchHandlerController.QueryConfirmed()
ITextAlignmentElement.OnHorizontalTextAlignmentPropertyChanged(TextAlignment, TextAlignment)
ITextElement.OnCharacterSpacingPropertyChanged(Double, Double)
ITextElement.OnTextColorPropertyChanged(Color, Color)
ITextElement.OnTextTransformChanged(TextTransform, TextTransform)

Extension Methods

Name Description
GetPropertyIfSet<T>(BindableObject, BindableProperty, T)
SetAppTheme<T>(BindableObject, BindableProperty, T, T)
SetAppThemeColor(BindableObject, BindableProperty, Color, Color)
SetBinding(BindableObject, BindableProperty, String, BindingMode, IValueConverter, String)

Creates and applies a binding to a property.

SetBinding<TSource,TProperty>(BindableObject, BindableProperty, Func<TSource,TProperty>, BindingMode, IValueConverter, Object, String, Object, Object, Object)

Creates a binding between a property on the source object and a property on the target object.

ToFont(IFontElement, Nullable<Double>)

Applies to