How to change dynamically your listview using templates

Basically all the apps use a Listview to show one or more list of items.
Sometimes you want to change the appearance of your items according to some parameter (for example inside the same page, sometimes you want to show partial forms, other times completed forms and so on).

Let's see how easily you can achieve this in Xamarin.

read more

Read More

How to invert a boolean value in XAML with a IValueConverter

In this post we'll how is possible to invert a boolean value in our XAML page using a Converter

Let's say that we have a Label that should be visible only if a boolean property is false.

read more

Read More

How to add a Checkbox in Xamarin.Forms

We are going to show step by step how to create a Checkbox for Xamarin.Forms with a very simple code without the use of Custom Renderers.

This checkbox will work on every platform: Android, iOS, UWP... and the final result will be something like...

read more

Read More

Xamarin.Forms on Android: How to remove the Uppercase from a button text

If you create a button on Android and write its text in lowercase ("my text"), when you launch the app, you can see that the text is all uppercase ("MY TEXT").

This is not a bug but the standard style for Android.

Sometimes we prefer to have our text in lowercase so here I'll show you different methods to do it...

read more

Read More

Xamarin.Forms: A tutorial about DependencyService

Xamarin.Forms is fantastic, you write your code once inside your PCL/.NetStandard project and it will run on many different platforms.

However sometimes we need to access directly the native platform. To do so, we can use something called DependencyService.

read more

Read More

Active Directory Authentication in Xamarin.Forms

Many modern apps require a secure authentication for users and Azure Active Directory Authentication Library (ADAL) enables application developers to authenticate users to cloud or on-premises Active Directory (AD). Here I show two different ways to add ADAL to a Xamarin.Forms project.

read more

Read More

Xamarin Forms – A guide to build your first Xamarin project

You want to create a mobile multi platform app and you really like C#.

Xamarin is the perfect solution for you and if you don't have any major experience with native mobile development, Xamarin.Forms is just a day-dream.

read more

Read More

Sqlite for Xamarin made easy

Let’s see how we can add a Sqlite database to your Xamarin projects in an incredibly easy way.

To help you to speed up your Xamarin development, I’ve created a set of plugins, one of them is MTSQL. Thanks to this plugin you can add a Sqlite database with a single line of code. The plugin is built on top of the Sqlite-net plugin by Frank A. Krueger.

A couple of useful link you can find useful:

Nuget link: https://www.nuget.org/packages/MarcTron.SQL
Project website: http://www.xamarinexpert.it/plugins/mt-sql/
To report any issue: https://bitbucket.org/marcojak81/mtsql

And now let’s see how to integrate the plugin inside your Xamarin Forms solution.

First of all we need to install the plugin. To do that, do a right-click on your solution and click on “Manage NuGet Packages for Solution…”

Now search the package MarcTron.Sqlite, click on it and remember to select all your projects (.Net Standard project + all the main application projects) then click Install.

The Plugin will take care to install for you also the Sqllite-net plugin by Frank A. Krueger.

If everything worked as expected, you will see the version of the plugin next to each of the projects you have selected in the previous step.

Now it’s time to try the plugin to see how easy it is.

Inside the MainPage constructor you can see that the only line of code you need to create your database and open a connection to it is:

SQLiteConnection conn = MTSql.Current.GetConnection("YOURDBNAME.db3");

Remember to replace the string with the name you want for your database.

As you can see in the image after we obtain a connection to the database, we can create a table and add some elements to it.

Just for test I have added 3 items. If everything works as expected we should see inside the text “Rows:3” on screen.

And this is exactly what we get launching the app on UWP.

So, thanks to this plugin, you have your Sqlite database inside your app with only 1 line of code.

What do you think? Add your comment at the end of the page. read more

Read More

Active Directory Authentication Library made easy

Let’s see how we can make the Active Directory authentication incredibly easy for your Xamarin projects.

To help you to speed up your Xamarin development, I’ve created a set of plugins, one of them is MTADAL. Thanks to this plugin you can authenticate users in your projects with a single line of code.

A couple of useful link you can find useful

Nuget link: https://www.nuget.org/packages/MarcTron.ADAL
Project website: http://www.xamarinexpert.it/plugins/mt-adal/
To report any issue: https://bitbucket.org/marcojak81/mtadal

And now let’s see how to integrate the plugin inside your Xamarin Forms solution.

Add

read more

Read More