Xamarin.Forms Plugin – Unobtrusive FluentValidation

Xamarin.Forms Plugin – Unobtrusive FluentValidation

Background

One of my all time favorite libraries is FluentValidation, Jeremy Skinner has done a great job at producing a library that is easy to use and just works.  Whether it is trivial validation or complicated databases access validation, FluentValidation has the means to get it done; while keeping your validation away from your view.  I won’t go into depth on why one would need/want to separate validation from a view in this post, but I might make another post in future describing in detail why that is important.

This post will assume a basic understanding of MVVM and ASP.NET’s MVC Framework with a little common knowledge of javascript.

The Problem

During my expedition as a Xamarin developer, I’ve seen and tried many different forms of validation.  Some were great and some were just good, but they all seemed have different approaches on when or where the validation gets triggered.

From my experience the best user-interface one can offer when validation is a small and effective means of communication.  Not multiple popups with fancy emoticons of sad faces.  People already don’t like to click on their phones (just look at the most popular apps, they just scroll), so why force them to click an ‘X’ or an ‘okay’ button?  Just tell the user what they should do to correct the form and move on.

The Solution

So one night I decided to blend what FluentValidation.MVCX has to offer with Xamarin.Forms.

Enter the first Unobtrusive FluentValidation Plugin for Xamarin.Forms!

Now this plugin is built on top of the latest FluentValidation NuGet published version.  There isn’t anything that is specific with this version, just needed a starting place. If you need an older version, please let me know and I’ll do my best to support older versions.

Check out the code on GitHub and get the latest version from NuGet!

 

Take care and have a great day!

Hooked On Twitch – V8.9

Recently Twitch made an update to their API that requires all clients to authenticate for every request.  Months before they made the switch they sent out a notification to all registered clients suggesting to perform the update.  Unfortunately, life gets in the way sometimes and I missed that deadline. 🙁

Nevertheless, version 8.9 is available today in Google’s Play Store and address the issue.  So have fun viewing and stay tuned for further updates coming down the pipeline!

Check it out here!

Continue reading “Hooked On Twitch – V8.9”

A Few Years With Xamarin: The Good, The Bad, The Great

People jump to conclusions. A lot.  It’s human nature and we somehow forget that and we always focus on the negative rather than the positive of most things.   This is apparent when you search for “mobile cross-platform frameworks”.  Yes you’ll find frameworks like Xamarin, Appcelerator, Apache Cordova, Sencha, etc.; And the list keeps growing everyday.

One of the most intriguing platforms, for C# developers, is Xamarin.  A platform that allows you to write C# code and it compiles down into Natvie code for Android, iOS, and Windows Phones.  This is possible by the original project called “mono-project“, this is where it all started some years ago as an open source project that quickly grew over night. Now Xamarin has employees and clients around the world building great mobile apps and solving unique problems in less time than ever before.  Lets be honest C# (.NET) isn’t on as many devices as Java, yet. Xamarin is helping make that transition more quickly with giving Microsoft’s .NET Framework the ability to go across platform.  I’m not sure if Microsoft ever thought that they’d be running, compiling, and deploying products on the Linux Platform, but they are and I believe the push from Xamarin has something to do with that.  Enough rambling, lets get into the technical aspect of Xamarin!

Continue reading “A Few Years With Xamarin: The Good, The Bad, The Great”

Xamarin MVC Project Separation & Fluent Validation – Part III

Continuing from Part II:

Finally, I’ll show you the actual validator implementation and that BaseType<T> you saw earlier.

Validator 

 

public class UserProfileValidator : AbstractValidator&lt;UserProfile&gt;
{
	public UserProfileValidator()
	{
		RuleFor(a =&gt; a.FirstName)
		.NotEmpty()
		.WithMessage("First Name required.");

		RuleFor(a =&gt; a.LastName)
		.NotEmpty()
		.WithMessage("Last name required.");
	}
}

Continue reading “Xamarin MVC Project Separation & Fluent Validation – Part III”

Employee Directory Xamarin.Forms

Let me preface this the fact  that when building a mobile app for a large company one of the first things that comes up is the ability to view all their employees in their current intranet.  Especially if they already take pictures of each employee for the intranet, it tends to give them a proxy “Facebook”  feeling.

My instance for this particular client was slightly different, the project manager/lead developer and I had to convince the client this was the best way to step into the mobile app world for his client.  Since he had no idea what we could do or what he wanted to see.  So I set out to begin the mobile app: extending the existing MVC 4 project by adding a new project to the solution strictly for the Web API and creating a new Mobile App project with Xamarin.Forms.

Continue reading “Employee Directory Xamarin.Forms”

Xamarin Support and Why You Should Use It

Recently I’ve had the opportunity to dive deeper and deeper into the Xamarin.Forms platform.  At first glance it seems to be a bit overwhelming with all the differences and setup modules you need to get up and running.  Forget about managing Activities (Android) and pushing UIControllers on the stack (iOS), with Xamarin.Forms we’re able to get at the heart of what we care about: the content itself.

At the beginning of the project I began to experiment with all the controls that Xamarin.Forms has available, which you can find here.   In particular I found my self using the ListView with and “ImageCell” type.  This was working out GREAT, showing an employee like directory for the company, but one day after an update with Xamarin.Forms did everything seem to turn bad.

Continue reading “Xamarin Support and Why You Should Use It”