Xamarin Forms RadioButton List Source Binding using ReactiveUI

Paul de Boer
4 min readJan 10, 2021

I've been developing in Xamarin Forms for about 6 years now and last week a ran into a problem I've been having for some time. And I finally found an acceptable solution.

I thought I would share it here to get some feedback on my solution and maybe help others having the same problem.

The result

The Problem

In an application I've been working on the user needs to select an item from a list of items. These items come from an API call and I want to bind the result of this call to a list of RadioButtons.

Xamarin Forms recently introduced a RadioButton control: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/radiobutton.

Unfortunately binding a list source is not supported.

Solution

The solution is to use a BindableLayout for binding the list of items to a list of RadioButtons. This works perfectly but how do you implement the selected item?

I've been using ReactiveUI for a couple of weeks now and instantly fell in love with it. This has helped me to find a nice way of making this dynamic list of RadioButtons work.

Xaml

--

--

Paul de Boer
0 Followers

I'm a freelance developer focussing mainly on .NET and mobile applications using Xamarin Forms