-
Notifications
You must be signed in to change notification settings - Fork 39
FreakyAutoCompleteView
Gulam Ali H edited this page Oct 1, 2023
·
1 revision
The FreakyAutoCompleteView
class is a versatile auto-complete text input view designed for use in .NET MAUI applications. It offers a wide range of customization options and events for creating interactive and dynamic auto-complete experiences.
-
Type:
string
- Description: Gets or sets the text displayed in the auto-complete input field.
-
Type:
int
-
Default Value:
1
- Description: Gets or sets the minimum number of characters the user must type before auto-complete suggestions are displayed.
-
Type:
Color
-
Default Value:
Colors.Gray
- Description: Gets or sets the text color of the auto-complete input field.
-
Type:
string
-
Default Value:
string.Empty
- Description: Gets or sets the placeholder text displayed in the input field when it's empty.
-
Type:
Color
-
Default Value:
Colors.Gray
- Description: Gets or sets the color of the placeholder text.
-
Type:
string
-
Default Value:
string.Empty
- Description: Gets or sets the binding path for the text content of each suggestion item.
-
Type:
string
-
Default Value:
string.Empty
- Description: Gets or sets the binding path for the display content of each suggestion item.
-
Type:
bool
-
Default Value:
false
- Description: Gets or sets whether the auto-complete suggestion list is currently open.
-
Type:
bool
-
Default Value:
true
- Description: Gets or sets whether the text input should be updated when a suggestion is selected.
-
Type:
System.Collections.IList
- Description: Gets or sets the collection of items to be used as suggestions for auto-complete.
-
Type:
bool
-
Default Value:
false
- Description: Gets or sets whether the user is allowed to copy and paste text in the input field.
-
Type:
ImageSource
- Description: Gets or sets the image to be displayed within the auto-complete view.
-
Type:
int
-
Default Value:
25
- Description: Gets or sets the height of the image within the auto-complete view.
-
Type:
int
-
Default Value:
25
- Description: Gets or sets the width of the image within the auto-complete view.
-
Type:
ImageAlignment
-
Default Value:
ImageAlignment.Right
- Description: Gets or sets the alignment of the image within the auto-complete view.
-
Type:
int
-
Default Value:
5
- Description: Gets or sets the padding around the image within the auto-complete view.
-
Type:
ICommand
- Description: Gets or sets the command to be executed when the image is tapped.
-
Type:
object
- Description: Gets or sets the command parameter to be passed to the image command.
- Description: Occurs when the text in the auto-complete input field changes. Use this event to respond to text changes.
- Description: Occurs when a suggestion from the auto-complete list is chosen. Use this event to handle item selection.
- Description: Occurs when a query is submitted, typically when the user presses the Enter key. Use this event to handle query submissions.
To use the FreakyAutoCompleteView
in your MAUI application, follow these steps:
- Initialize the
FreakyAutoCompleteView
instance. - Customize its appearance and behavior using the available properties.
- Subscribe to the
TextChanged
,SuggestionChosen
, andQuerySubmitted
events to handle user interactions. - Add the
FreakyAutoCompleteView
to your MAUI layout.
Example:
// Initialize the auto-complete view
var autoCompleteView = new FreakyAutoCompleteView
{
ItemsSource = yourSuggestionsCollection,
Threshold = 2,
TextColor = Color.Black,
Placeholder = "Type to search...",
// Customize other properties as needed
};
// Handle events
autoCompleteView.TextChanged += (sender, e) =>
{
// Handle text changes
};
autoCompleteView.SuggestionChosen += (sender, e) =>
{
// Handle suggestion chosen
};
autoCompleteView.QuerySubmitted += (sender, e) =>
{
// Handle query submitted
};