How can we link search text entered in SearchView in Android via mvvmcross

I am developing an application in Xamarin Android with MvvmCross. MvvmCross helps you associate view properties in a layout directly with ViewModels. For EditText, we can bind text, for example

<EditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    local:MvxBind="Text Property" />

I need to bind SearchView text using MvvmCross. I tried Textas below, but it does not work.

<SearchView     
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:queryHint="Customer name" 
    local:MvxBind="Text SearchString" />

How can I link SearchView text using MvvmCross?

+4
source share
1 answer

For SearchViewyou need to use the property Query:

<SearchView     
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:queryHint="Customer name" 
    local:MvxBind="Query SearchString" />
+6
source

Source: https://habr.com/ru/post/1652177/


All Articles