The art of creating a good control
What is a control (or component)
Do you remember the joy when you were playing lego in your young years ? With small Lego parts you can build your most wanted star wars ship. You don’t build the Lego parts though, you buy them.
It’s the same for software components, also called controls. They are well built, polished piece of code solving a problem; and they can be easily plugged into your app. They bring you value, and if they fit your needs out of the box, or if you are a little weak on coding (lots of us are), they will save you a lot of time and maintenance.
It is not because they seem small that they are easy to build. Most of the time they have much more than 10 lines of code, and in fact they are often quite big projects. So use them!
What makes a good control
A good control should:
- Bring a strong value to both the application and its developer
- Have a good documentation with a light learning curve
- Be fully tested and stable on multiple configurations and devices
- Be distributed through a package manager like nuget.org, and/or an extension to the development environment like the visual studio marketplace for visual studio windows/mac and vscode.
- Report usage or configuration problems in a descriptive way
- At least have an online support, by email or direct chat
- Have an easy to understand and relaxed licence plan, and optionally extended support plans
- Have a community version that can be used in open source projects, or for evaluation purposes
At Vapolia, i’m building components since a long time, both internal components that never surfaced in public (for customer projects), the award winning components XamSvg and WheelPicker, and some open source components among which KeyValueLite, XamarinFormsGesture and MvvmCross-UserInteraction which started as a fork and was fully rewritten and improved.
Where to find controls
There are a few top controls providers:
Syncfusion, Telerik, Grapecity, Infragistics, all with tons of quite standard components like grids, calendars, and many others.
Open source controls are more difficult to discover, as the excellent Xamarin Component Store has been shut down by Microsoft after it acquired Xamarin. But a peer has consolidated a list referencing quite a lot of them there on Github.
In the next article i’ll go deeper in the architecture of a Xamarin Forms control. I will explain how to leverage the multi targeting feature of visual studio to have all targeted platform codes (iOS, Android, WPF, Mac, …) in the same project, automatically generate a nuget package ready to be published, and remove the requirement of the control registration.