Giter Site home page Giter Site logo

xfx.controls's Introduction

Xamarin Forms Extended Controls

Description Xfx Controls are just a few controls that differ from the baked in Xamarin.Forms Controls.

iOS Android UWP Mac
XfxEntry
XfxComboBox


Getting Started

Android

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.

iOS

In your AppDelegate, initialize XfxControls just before initializing Xamarin Forms

XfxControls.Init();
global::Xamarin.Forms.Forms.Init();

Demos

Code

Declaration is exactly the same as a Xamarin.Forms.Entry, with some added properties

XfxEntry

<!-- 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

<!-- 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();
}

Contributions / Thanks

License

Licensed MIT, please review the license file.

xfx.controls's People

Contributors

chaseflorell avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.