Xamarin.Forms.Labs - Checkboxes in ListView not working on Windows Phone 8?

I want to display a list of checkboxes (using a control from Xamarin.Forms.Labs libriary) inside a Xamarin.Forms app. I followed the Xamarin.Forms.Labs wiki to initialize the application correctly.

It works fine on Android, however when I try to use it on Windows Phone 8 emulator the checkboxes don't change their state when clicked / listened.

I have XAML:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
                       xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                       xmlns:controls="clr-namespace:Xamarin.Forms.Labs.Controls;assembly=Xamarin.Forms.Labs"
                       x:Class="App4.CheckBoxPage">
  <StackLayout>
    <ListView x:Name="listView">
      <ListView.ItemTemplate>
        <DataTemplate>
          <ViewCell>
            <ViewCell.View>
              <controls:CheckBox DefaultText="{Binding}" HorizontalOptions="FillAndExpand" TextColor="White" FontSize="25" />
            </ViewCell.View>
          </ViewCell>
        </DataTemplate>
      </ListView.ItemTemplate>
    </ListView>
  </StackLayout>
</ContentPage>

      

... and the simple code behind:

using System;
using System.Linq;

using Xamarin.Forms;

namespace App4
{    
    public partial class CheckBoxPage : ContentPage
    {    
        public CheckBoxPage ()
        {
            InitializeComponent ();
            listView.ItemsSource = Enum.GetValues(typeof(DayOfWeek)).OfType<DayOfWeek>().Select(c => c.ToString());
        }
    }

    public class App
    {
        public static Page GetMainPage()
        {
            return new CheckBoxPage();            
        }
    }
}

      

Any ideas for working with checkboxes?

+3


source to share


1 answer


It seems as it just doesn't work on iOS and WP right now. On Android, you have to set TextColor (otherwise no text will be shown). But ... the problems are known to the XLabs team.

See also here: XF-forum-thread



and here: Issue page on XLabs

Hope it helps ...

+1


source







All Articles