StyleCop Analyzers template for .NET Standard

One of the most demanding aspects of a developer’s life is working with legacy code created by others who may not share your philosophy on code creation. Code consistency is beneficial to both the team and the organization, with the added benefit of improving performance through rules such as closing database connections. Microsoft StyleCop provides the vehicle to put such rules in place, and it seemlessly integrates with Visual Studio.

Read More

Xamarin Close Android app on back button

Some time in your application, it is needed to prompt user before exit from application. In this article, we will see how you can prompt user on pressing back button with a dialog, questioning whether or not the user wishes to exit the application. So, in this article we are going to learn how to prevent user to exit from application without giving response.

Read More

Enforce C# Coding Standards with StyleCop.MSBuild for VS

The StyleCop tool provides warnings that indicate style and consistency rule violations in C# code. The warnings are organized into rule areas such as documentation, layout, naming, ordering, readability, spacing, and so forth. Each warning signifies a violation of a style or consistency rule. This section provides an explanation of each of the default StyleCop rules.

Read More

Multi-line text truncation in Xamarin Forms

Truncate the label in Xamarin forms by add LineBreakMode = TailTruncation is easy, but it truncates it and restricts it to one line. But on a specific label we wanted to show more text to the end user and even than add an ellipsis if needed. So in other words we would love to be able to tell the label control how many lines it should at least try to display.

Read More

Letter Spacing label in Xamarin Forms

One of the limitations of the Label control in Xamarin Forms is that it’s missing a letter spacing property. On one of our most recent Forms projects we needed to specify differing letter spacing on some labels so I’ve put together a few code samples to save you time on how to do this in your iOS and Android renderers.

Read More