Description Xfx Controls are just a few controls that differ from the baked in Xamarin.Forms Controls.
iOS | Android | UWP | Mac | |
---|---|---|---|---|
XfxEntry | ✅ | ✅ | ❌ | ❌ |
XfxComboBox | ✅ | ✅ | ❌ | ❌ |
In your MainActivity, initialize XfxControls just before initializing Xamarin Forms
XfxControls.Init();
global::Xamarin.Forms.Forms.Init(this, bundle);
note: XfxEntry and XfxComboBox REQUIRES your app to use an AppCompat theme.
In your AppDelegate, initialize XfxControls just before initializing Xamarin Forms
XfxControls.Init();
global::Xamarin.Forms.Forms.Init();
Declaration is exactly the same as a Xamarin.Forms.Entry, with some added properties
<!-- XfxEntry-->
<xfx:XfxEntry Placeholder="Enter your name"
Text="{Binding Name}"
ErrorText="{Binding NameErrorText}" />
When the ErrorText
property is set, the ErrorText will display, otherwise if it is null or empty, it's removed.
<!-- XfxComboBox-->
<xfx:XfxComboBox Placeholder="Enter your email address"
Text="{Binding EmailAddress}"
ItemsSource="{Binding EmailSuggestions}"
SortingAlgorithm="{Binding SortingAlgorithm}"/>
The XfxComboBox extends the XfxEntry and therefore also includes the ErrorText
property.
Beyond that there is an ItemsSource
property, SelectedItem
property, and a SortingAlgorithm
property.
The first two are pretty self explanitory, but here's an example of how you can set the SortingAlgorithm
public class MyViewModel : INotifyPropertyChanged
{
public Func<string, ICollection<string>, ICollection<string>> SortingAlgorithm { get; } = (text, values) => values
.Where(x => x.ToLower().StartsWith(text.ToLower()))
.OrderBy(x => x)
.ToList();
}
- @MarcBruins for: MBAutoComplete
- @gshackles for: FloatLabeledEntry
Licensed MIT, please review the license file.