Masked Entry in Xamarin.Forms

Alegria Kilanda
May 17, 2020

In this article I present a way to create mask in the entry in xamrin.forms without using a library.

Currently developers have an habit of always using libraries when they have a problem, and sometimes these libraries add weight to projects or create limitations in customizing it. Many of these problems could be solved without the libraries, if we would have some patience. The entry mask is one of those problems.

In this article I present how to create a mask in the entry without using a library.

Code

A class was created called CustomEntry Extend Entry, and the Mask property (used to define the mask) was added and all logic was applied in this class.

CustomEntry

MainPage

MainPage

Result

Not filled
Filled

The project is available on github for contributions and improvements.

Hope this helps!

Sign up to discover human stories that deepen your understanding of the world.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet

Write a response