I'm making an Android app in Xamarin using MvvmCross.
My UI has a search field and a button. I want the button to reflect whatever is in the search field. So if the search field has Alamo Drafthouse
, I want the button to say Create "Alamo Drafthouse" Venue
, however the Create "x" Venue
string should come from the strings.xml
file so that it can be localized.
My current plan of attack is to create a ValueConverter that takes the search term and does the formatting, using the ConvertParameter to specify the ID of the string resource, so I'd be able to do something like this:
<Button local:MvxBind="Text SearchTerm, Converter=FormatResource, ConvertParameter='create_view'" />
where create_view
is a string resource defined in strings.xml
.
I thought I should ask whether there is a better way to do this. Is there?