Xamarin Forms: Public C# Properties Missing on Android

While working on the mobile apps for McAllen Next (my new side project, stay tuned for more soon!), I discovered a very strange issue when running the app on Android; I kept getting repeated errors like this:

Binding: ‘IsLoading’ property not found on ‘RegionModel’, target property: ‘Xamarin.Forms.Label’

and as such, the UI would not bind and would render an empty label (or not at all, depending on the control).

At first I thought it was because the app wasn’t rebuilding properly, resulting in stale binaries as was suggested in a StackOverflow post I found while trying to find a fix.

Eventually I posted my own question about this issue and I swear before two minutes passed, I was provided the solution by a very helpful user Gusman.

Turns out I had the box checked in the Android properties for the project to link both SDK and User assemblies.

xamarin-forms-android-link-sdk-user-assemblies

Apparently this optimizes the selected assemblies, removing references to properties that the linker detects are not in use.

I don’t remember much from my college days when we built a compiler, but although optimization sounds great, completely deleting references is strange to me, especially if they’re going to be bound at runtime to the XAML as they are when working with Xamarin Forms…

But hey I’m not a compiler builder, so I changed the option to only link SDK assemblies, and everything is back to normal!

As always, I hope this is helpful, and thanks for reading!

Adding Transparency to the ListView on iOS with Xamarin Forms Custom Renderer

One of the minor issues we encountered when developing Falafel 2 Go was that on iOS, the ListView defaults the background color of the ViewCell to white. I’m not sure if this is an oversight, intentionally by design, or if it will be changed in the future, but we needed a way to make it transparent. Otherwise the textured custom background from the design would be covered up by the white background of the ListView on iOS.

Read more at the Falafel Software Blog: Adding Transparency to the ListView on iOS with Xamarin Forms Custom Renderer

Adding Tapped Event Gestures to Any XAML Control with Xamarin Forms

We previously looked at how to create User Controls with Xamarin Forms to display an Image Button for the different activities in our Falafel 2 Go application. Now that we have these reusable buttons, we need to make them tab-enabled so that they can launch the appropriate activity. As we’ll see in today’s post, this is very simple to implement with Xamarin Forms.

Read more at the Falafel Software Blog: Adding Tapped Event Gestures to Any XAML Control with Xamarin Forms

Creating Reusable XAML User Controls with Xamarin Forms

In the previous post on making fancy layouts with Xamarin Forms we saw how you can design a Dashboard style application that stretches to fill any device size. However one of the challenges of the particular design we chose for Falafel 2 Go was the need to support the concept of an Image Button, where both the icon and the text work as a single control to launch an activity.

Xamarin Forms does provide an ImageCell control, which can be used in a TableView to render both text and image as a single control. However, this control is laid out horizontally with the text positioned on the right side of the image as you would expect for a list of items.

While we could likely acheive a more precise layout with a custom renderer, we found a much more elegnat, and more importantly, reusable option by instead creating a User Control.

Read more at the Falafel Software Blog: Creating Reusable XAML User Controls with Xamarin Forms

Using Xamarin Forms DependencyService and Azure Mobile Services to Add Authentication to Cross-Platform Apps

We previously looked how to create a Xamarin Forms App using Azure Mobile Services for storing and retrieving data. However, up until now, we have been saving the data globally so that it is accessible to all users. This post will explore how to add device-specific authentication to each app so that users can register and manage their own private data using any of the supported authentication providers.

Read more at the Falafel Software Blog: Using Xamarin Forms DependencyService and Azure Mobile Services to Add Authentication to Cross-Platform Apps

Loading Indicators and Automatic ViewModel Refresh in Xamarin Forms

This post continues the series on building a cross-platform app with Xamarin Forms. Although the focus is to demonstrate using Azure Mobile Services, there is a lot that we can do first to improve the user experience of the app. Today we will look at how easy it is to add a loading indicator as well as automatically refresh the app views when changes are made.

Read more at the Falafel Software Blog: Loading Indicators and Automatic ViewModel Refresh in Xamarin Forms

Creating Global Resources for Xamarin Forms Apps

In our last post (Creating Device-Specific Properties in Cross-Platform Apps with Xamarin Forms) we looked at how we can leverage Page Resources to create device-specific properties that can be reused across the page. Today we’ll look at how we can convert these and other reusable property definitions to global resources so that all of an apps resources can be maintained from a single location.

Read more at the Falafel Software Blog: Creating Global Resources for Xamarin Forms Apps