FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    AutoCompleteBox

    struct · ferroui-controls · v0.5.0

    struct AutoCompleteBox
    

    Represents a control that provides a text box for user input and a drop-down that contains possible matches based on the input in the text box.

    View source

    Members

    TYPE

    const TYPE: &'static $crate::TypeInfo
    

    The runtime type of this class.

    Source

    to_ref

    fn to_ref(self: &Self) -> $crate::Ref<AutoCompleteBox>
    

    Returns a strong reference to this object.

    Source

    get_selection_adapter_part

    fn get_selection_adapter_part(self: &Self, name_scope: &NameScopeRef) -> Option<Rc<dyn ISelectionAdapter>>
    

    Returns the ISelectionAdapter part, if possible. Otherwise, None.

    Source

    on_populating

    fn on_populating(self: &Self, e: &PopulatingEventArgs)
    

    Raises the Populating event.

    Source

    on_populated

    fn on_populated(self: &Self, e: &PopulatedEventArgs)
    

    Raises the Populated event.

    Source

    on_selection_changed

    fn on_selection_changed(self: &Self, e: &SelectionChangedEventArgs)
    

    Raises the SelectionChanged event.

    Source

    on_drop_down_opening

    fn on_drop_down_opening(self: &Self, e: &CancelEventArgs)
    

    Raises the DropDownOpening event.

    Source

    on_drop_down_opened

    fn on_drop_down_opened(self: &Self)
    

    Raises the DropDownOpened event.

    Source

    on_drop_down_closing

    fn on_drop_down_closing(self: &Self, e: &CancelEventArgs)
    

    Raises the DropDownClosing event.

    Source

    on_drop_down_closed

    fn on_drop_down_closed(self: &Self)
    

    Raises the DropDownClosed event.

    Source

    on_text_changed

    fn on_text_changed(self: &Self, e: &TextChangedEventArgs)
    

    Raises the TextChanged event.

    Source

    format_value

    fn format_value(self: &Self, value: &Option<BoxedValue>) -> Option<String>
    

    Converts the specified object to a string by using the binding specified by the ValueMemberBinding property.

    Override this method to provide a custom string conversion.

    Source

    caret_index_property

    fn caret_index_property() -> &'static StyledProperty<i32>
    

    Defines the CaretIndex property.

    Source

    placeholder_text_property

    fn placeholder_text_property() -> &'static StyledProperty<Option<String>>
    

    Defines the PlaceholderText property.

    Source

    placeholder_foreground_property

    fn placeholder_foreground_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
    

    Defines the PlaceholderForeground property.

    Source

    minimum_prefix_length_property

    fn minimum_prefix_length_property() -> &'static StyledProperty<i32>
    

    Identifies the MinimumPrefixLength property.

    Source

    minimum_populate_delay_property

    fn minimum_populate_delay_property() -> &'static StyledProperty<Duration>
    

    Identifies the MinimumPopulateDelay property.

    A Duration: a negative delay, which the reference refuses in its validation (IsValidMinimumPopulateDelay), is not a value of the type.

    Source

    max_drop_down_height_property

    fn max_drop_down_height_property() -> &'static StyledProperty<f64>
    

    Identifies the MaxDropDownHeight property.

    Source

    is_text_completion_enabled_property

    fn is_text_completion_enabled_property() -> &'static StyledProperty<bool>
    

    Identifies the IsTextCompletionEnabled property.

    Source

    item_template_property

    fn item_template_property() -> &'static StyledProperty<Option<Rc<dyn IDataTemplate>>>
    

    Identifies the ItemTemplate property.

    Source

    clear_selection_on_lost_focus_property

    fn clear_selection_on_lost_focus_property() -> &'static StyledProperty<bool>
    

    Defines the ClearSelectionOnLostFocus property.

    Source

    is_drop_down_open_property

    fn is_drop_down_open_property() -> &'static StyledProperty<bool>
    

    Identifies the IsDropDownOpen property.

    Source

    selected_item_property

    fn selected_item_property() -> &'static StyledProperty<Option<BoxedValue>>
    

    Identifies the SelectedItem property.

    Source

    text_property

    fn text_property() -> &'static StyledProperty<Option<String>>
    

    Identifies the Text property.

    Source

    search_text_property

    fn search_text_property() -> &'static DirectProperty<AutoCompleteBox, Option<String>>
    

    Identifies the SearchText property.

    Source

    filter_mode_property

    fn filter_mode_property() -> &'static StyledProperty<AutoCompleteFilterMode>
    

    Gets the identifier for the FilterMode property.

    Source

    item_filter_property

    fn item_filter_property() -> &'static StyledProperty<Option<AutoCompleteFilterPredicate<Option<BoxedValue>>>>
    

    Identifies the ItemFilter property.

    Source

    text_filter_property

    fn text_filter_property() -> &'static StyledProperty<Option<AutoCompleteFilterPredicate<Option<String>>>>
    

    Identifies the TextFilter property.

    Source

    item_selector_property

    fn item_selector_property() -> &'static StyledProperty<Option<AutoCompleteSelector<BoxedValue>>>
    

    Identifies the ItemSelector property.

    Source

    text_selector_property

    fn text_selector_property() -> &'static StyledProperty<Option<AutoCompleteSelector<Option<String>>>>
    

    Identifies the TextSelector property.

    Source

    items_source_property

    fn items_source_property() -> &'static StyledProperty<Option<ItemsSource>>
    

    Identifies the ItemsSource property.

    Source

    async_populator_property

    fn async_populator_property() -> &'static StyledProperty<Option<AutoCompleteAsyncPopulator>>
    

    Identifies the AsyncPopulator property.

    Source

    max_length_property

    fn max_length_property() -> &'static StyledProperty<i32>
    

    Defines the MaxLength property.

    Source

    inner_left_content_property

    fn inner_left_content_property() -> &'static StyledProperty<Option<BoxedValue>>
    

    Defines the InnerLeftContent property.

    Source

    inner_right_content_property

    fn inner_right_content_property() -> &'static StyledProperty<Option<BoxedValue>>
    

    Defines the InnerRightContent property.

    Source

    value_member_binding_property

    fn value_member_binding_property() -> &'static StyledProperty<Option<AssignedBinding>>
    

    Defines the ValueMemberBinding property.

    Source

    watermark_property

    fn watermark_property() -> &'static StyledProperty<Option<String>>
    

    Defines the Watermark property.

    Deprecated. Use placeholder_text_property instead.

    Source

    watermark_foreground_property

    fn watermark_foreground_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
    

    Defines the WatermarkForeground property.

    Deprecated. Use placeholder_foreground_property instead.

    Source

    selection_changed_event

    fn selection_changed_event() -> &'static RoutedEvent<SelectionChangedEventArgs>
    

    Defines the SelectionChanged event.

    Source

    query_submitted_event

    fn query_submitted_event() -> &'static RoutedEvent<AutoCompleteBoxQuerySubmittedEventArgs>
    

    Defines the QuerySubmitted event: a FerroUI addition after WinUI's AutoSuggestBox.QuerySubmitted, raised when Enter submits the text of the box.

    Source

    text_changed_event

    fn text_changed_event() -> &'static RoutedEvent<TextChangedEventArgs>
    

    Defines the TextChanged event.

    Source

    construct

    fn construct() -> Self
    

    Creates the class data; see ferroui_base::FerroObject::construct.

    Source

    new

    fn new() -> Ref<Self>
    

    Initializes a new instance of the AutoCompleteBox class.

    Source

    caret_index

    fn caret_index(self: &Self) -> i32
    

    Gets or sets the caret index.

    Source

    set_caret_index

    fn set_caret_index(self: &Self, value: i32)
    

    Source

    minimum_prefix_length

    fn minimum_prefix_length(self: &Self) -> i32
    

    Gets or sets the minimum number of characters required to be entered in the text box before the AutoCompleteBox displays possible matches. The default is 1.

    If you set MinimumPrefixLength to -1, the control will not provide possible matches. There is no maximum value, but setting it to a value that is too large will prevent the control from providing possible matches as well.

    Source

    set_minimum_prefix_length

    fn set_minimum_prefix_length(self: &Self, value: i32)
    

    Source

    is_text_completion_enabled

    fn is_text_completion_enabled(self: &Self) -> bool
    

    Gets or sets a value indicating whether the first possible match found during the filtering process will be displayed automatically in the text box. The default is false.

    Source

    set_is_text_completion_enabled

    fn set_is_text_completion_enabled(self: &Self, value: bool)
    

    Source

    item_template

    fn item_template(self: &Self) -> Option<Rc<dyn IDataTemplate>>
    

    Gets or sets the data template that is used to display the items in the drop-down portion of the AutoCompleteBox control.

    Source

    set_item_template

    fn set_item_template(self: &Self, value: Option<Rc<dyn IDataTemplate>>)
    

    Source

    minimum_populate_delay

    fn minimum_populate_delay(self: &Self) -> Duration
    

    Gets or sets the minimum delay after text is typed in the text box before the control populates the list of possible matches in the drop-down. The default is zero.

    Source

    set_minimum_populate_delay

    fn set_minimum_populate_delay(self: &Self, value: Duration)
    

    Source

    max_drop_down_height

    fn max_drop_down_height(self: &Self) -> f64
    

    Gets or sets the maximum height of the drop-down portion of the AutoCompleteBox control. The default is infinity.

    Source

    set_max_drop_down_height

    fn set_max_drop_down_height(self: &Self, value: f64)
    

    Source

    is_drop_down_open

    fn is_drop_down_open(self: &Self) -> bool
    

    Gets or sets a value indicating whether the drop-down portion of the control is open.

    Source

    set_is_drop_down_open

    fn set_is_drop_down_open(self: &Self, value: bool)
    

    Source

    clear_selection_on_lost_focus

    fn clear_selection_on_lost_focus(self: &Self) -> bool
    

    Gets or sets a value that determines whether the control clears its selection after it loses focus.

    Source

    set_clear_selection_on_lost_focus

    fn set_clear_selection_on_lost_focus(self: &Self, value: bool)
    

    Source

    value_member_binding

    fn value_member_binding(self: &Self) -> Option<AssignedBinding>
    

    Gets or sets the binding that is used to get the values for display in the text box portion of the AutoCompleteBox control, and to filter items for display in the drop-down.

    Source

    set_value_member_binding

    fn set_value_member_binding(self: &Self, value: Option<AssignedBinding>)
    

    Source

    selected_item

    fn selected_item(self: &Self) -> Option<BoxedValue>
    

    Gets or sets the selected item in the drop-down. The default is None.

    If the IsTextCompletionEnabled property is true and text typed by the user matches an item in the ItemsSource collection, which is then displayed in the text box, the SelectedItem property will be a null reference.

    Source

    set_selected_item

    fn set_selected_item(self: &Self, value: Option<BoxedValue>)
    

    Source

    text

    fn text(self: &Self) -> Option<String>
    

    Gets or sets the text in the text box portion of the AutoCompleteBox control.

    Source

    set_text

    fn set_text(self: &Self, value: Option<&str>)
    

    Source

    search_text

    fn search_text(self: &Self) -> Option<String>
    

    Gets the text that is used to filter items in the ItemsSource item collection.

    The search text value is typically the same as the Text property, but is set after the text changed event occurs and before the Populating event.

    Source

    filter_mode

    fn filter_mode(self: &Self) -> AutoCompleteFilterMode
    

    Gets or sets how the text in the text box is used to filter items specified by the ItemsSource property for display in the drop-down. The default is AutoCompleteFilterMode::StartsWith.

    Use the FilterMode property to specify how possible matches are filtered. For example, possible matches can be filtered in a predefined or custom way. FilterMode is automatically set to Custom if you set the ItemFilter property.

    Source

    set_filter_mode

    fn set_filter_mode(self: &Self, value: AutoCompleteFilterMode)
    

    Source

    placeholder_text

    fn placeholder_text(self: &Self) -> Option<String>
    

    Gets or sets the placeholder or descriptive text that is displayed even if the Text property is not yet set.

    Source

    set_placeholder_text

    fn set_placeholder_text(self: &Self, value: Option<&str>)
    

    Source

    watermark

    fn watermark(self: &Self) -> Option<String>
    

    Gets or sets the placeholder or descriptive text that is displayed even if the Text property is not yet set.

    Deprecated. Use placeholder_text instead.

    Source

    set_watermark

    fn set_watermark(self: &Self, value: Option<&str>)
    

    Deprecated. Use set_placeholder_text instead.

    Source

    placeholder_foreground

    fn placeholder_foreground(self: &Self) -> Option<Rc<dyn IBrush>>
    

    Gets or sets the brush used for the foreground color of the placeholder text.

    Source

    set_placeholder_foreground

    fn set_placeholder_foreground(self: &Self, value: Option<Rc<dyn IBrush>>)
    

    Source

    watermark_foreground

    fn watermark_foreground(self: &Self) -> Option<Rc<dyn IBrush>>
    

    Gets or sets the brush used for the foreground color of the placeholder text.

    Deprecated. Use placeholder_foreground instead.

    Source

    set_watermark_foreground

    fn set_watermark_foreground(self: &Self, value: Option<Rc<dyn IBrush>>)
    

    Deprecated. Use set_placeholder_foreground instead.

    Source

    item_filter

    fn item_filter(self: &Self) -> Option<AutoCompleteFilterPredicate<Option<BoxedValue>>>
    

    Gets or sets the custom method that uses user-entered text to filter the items specified by the ItemsSource property for display in the drop-down. The default is None.

    The filter mode is automatically set to Custom if you set the ItemFilter property.

    Source

    set_item_filter

    fn set_item_filter(self: &Self, value: Option<AutoCompleteFilterPredicate<Option<BoxedValue>>>)
    

    Source

    text_filter

    fn text_filter(self: &Self) -> Option<AutoCompleteFilterPredicate<Option<String>>>
    

    Gets or sets the custom method that uses the user-entered text to filter items specified by the ItemsSource property in a text-based way for display in the drop-down.

    The search mode is automatically set to Custom if you set the TextFilter property.

    Source

    set_text_filter

    fn set_text_filter(self: &Self, value: Option<AutoCompleteFilterPredicate<Option<String>>>)
    

    Source

    item_selector

    fn item_selector(self: &Self) -> Option<AutoCompleteSelector<BoxedValue>>
    

    Gets or sets the custom method that combines the user-entered text and one of the items specified by the ItemsSource.

    Source

    set_item_selector

    fn set_item_selector(self: &Self, value: Option<AutoCompleteSelector<BoxedValue>>)
    

    Source

    text_selector

    fn text_selector(self: &Self) -> Option<AutoCompleteSelector<Option<String>>>
    

    Gets or sets the custom method that combines the user-entered text and one of the items specified by the ItemsSource in a text-based way.

    Source

    set_text_selector

    fn set_text_selector(self: &Self, value: Option<AutoCompleteSelector<Option<String>>>)
    

    Source

    async_populator

    fn async_populator(self: &Self) -> Option<AutoCompleteAsyncPopulator>
    

    Gets or sets the asynchronous populator of the drop-down.

    Source

    set_async_populator

    fn set_async_populator(self: &Self, value: Option<AutoCompleteAsyncPopulator>)
    

    Source

    items_source

    fn items_source(self: &Self) -> Option<ItemsSource>
    

    Gets or sets a collection that is used to generate the items for the drop-down portion of the AutoCompleteBox control.

    Source

    set_items_source

    fn set_items_source(self: &Self, value: Option<ItemsSource>)
    

    Source

    max_length

    fn max_length(self: &Self) -> i32
    

    Gets or sets the maximum number of characters that the AutoCompleteBox can accept. This constraint only applies for manually entered (user-inputted) text.

    Source

    set_max_length

    fn set_max_length(self: &Self, value: i32)
    

    Source

    inner_left_content

    fn inner_left_content(self: &Self) -> Option<BoxedValue>
    

    Gets or sets custom content that is positioned on the left side of the text layout box.

    Source

    set_inner_left_content

    fn set_inner_left_content(self: &Self, value: Option<BoxedValue>)
    

    Source

    inner_right_content

    fn inner_right_content(self: &Self) -> Option<BoxedValue>
    

    Gets or sets custom content that is positioned on the right side of the text layout box.

    Source

    set_inner_right_content

    fn set_inner_right_content(self: &Self, value: Option<BoxedValue>)
    

    Source

    selection_adapter

    fn selection_adapter(self: &Self) -> Option<Rc<dyn ISelectionAdapter>>
    

    Gets the selection adapter used to populate the drop-down with a list of selectable items.

    You can use this property when you create an automation peer to use with the control or deriving from AutoCompleteBox to create a custom control.

    Source

    set_selection_adapter

    fn set_selection_adapter(self: &Self, value: Option<Rc<dyn ISelectionAdapter>>)
    

    Sets the selection adapter used to populate the drop-down with a list of selectable items.

    Source

    has_focus

    fn has_focus(self: &Self) -> bool
    

    Determines whether the text box or drop-down portion of the AutoCompleteBox control has focus.

    Deprecated. Use is_keyboard_focus_within instead.

    Source

    query_submitted

    fn query_submitted(self: &Self, handler: impl Fn(&Interactive, &AutoCompleteBoxQuerySubmittedEventArgs) -> () + 'static) -> RoutedEventHandlerToken
    

    Occurs when Enter submits the text of the box (a WinUI addition, see query_submitted_event).

    Source

    text_changed

    fn text_changed(self: &Self, handler: impl Fn(&Interactive, &TextChangedEventArgs) -> () + 'static) -> RoutedEventHandlerToken
    

    Occurs asynchronously when the text in the text box portion of the AutoCompleteBox changes.

    Source

    populating

    fn populating(self: &Self, handler: impl Fn(&PopulatingEventArgs) -> () + 'static) -> Subscription
    

    Occurs when the AutoCompleteBox is populating the drop-down with possible matches based on the Text property.

    If the event is cancelled, by setting the cancel flag of the args, the control will not automatically populate the selection adapter contained in the drop-down. In this case, if you want possible matches to appear, you must provide the logic for populating the selection adapter.

    Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the box.

    Source

    populated

    fn populated(self: &Self, handler: impl Fn(&PopulatedEventArgs) -> () + 'static) -> Subscription
    

    Occurs when the AutoCompleteBox has populated the drop-down with possible matches based on the Text property.

    Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the box.

    Source

    drop_down_opening

    fn drop_down_opening(self: &Self, handler: impl Fn(&CancelEventArgs) -> () + 'static) -> Subscription
    

    Occurs when the value of the IsDropDownOpen property is changing from false to true.

    Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the box.

    Source

    drop_down_opened

    fn drop_down_opened(self: &Self, handler: impl Fn() -> () + 'static) -> Subscription
    

    Occurs when the value of the IsDropDownOpen property has changed from false to true and the drop-down is open.

    Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the box.

    Source

    drop_down_closing

    fn drop_down_closing(self: &Self, handler: impl Fn(&CancelEventArgs) -> () + 'static) -> Subscription
    

    Occurs when the IsDropDownOpen property is changing from true to false.

    Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the box.

    Source

    drop_down_closed

    fn drop_down_closed(self: &Self, handler: impl Fn() -> () + 'static) -> Subscription
    

    Occurs when the IsDropDownOpen property was changed from true to false and the drop-down is open.

    Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the box.

    Source

    selection_changed

    fn selection_changed(self: &Self, handler: impl Fn(&Interactive, &SelectionChangedEventArgs) -> () + 'static) -> RoutedEventHandlerToken
    

    Occurs when the selected item in the drop-down portion of the AutoCompleteBox has changed.

    Source

    populate_complete

    fn populate_complete(self: &Self)
    

    Notifies the AutoCompleteBox that the ItemsSource property has been set and the data can be filtered to provide possible matches in the drop-down.

    Call this method when you are providing custom population of the drop-down portion of the control, to signal the control that you are done with the population process. Typically, you use it when the population process is a long-running process and you want to cancel built-in filtering of the ItemsSource items. In this case, you can handle the Populating event and set the cancel flag of its args. When the long-running process has completed you call populate_complete to indicate the drop-down is populated.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.