Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

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

$
0
0

This question was asked on stackoverflow (http://stackoverflow.com/questions/26596448/xamarin-forms-labs-checkboxes-in-listview-not-working-on-windows-phone-8) but never answered.

The checkboxes show up for each item in the listview and correctly reflect the state of what the Checked property is bound to in the viewmodel. The problem is that when you interact with one of them the changed state isn't shown in the view. The change from un-checked to checked or the reverse is passed via the binding to the viewmodel. If you close the view and reopen it the item you changed now reflects what you did.

The same code works as expected in the Android application. From what I can tell I have initialized Xamarin Forms Labs. If I comment out what was added to the constructor for App in App.xaml.cs when I run I get no checkboxes.

If it makes a difference the checkboxes are used in the ViewCell template of the ListView which is in a TabbedPage child.

<ContentPage Title="{Binding PIShowListHeaderText}">
      <ListView Grid.Row="1"
                x:Name="lvBirdsnBflys"
                ItemsSource="{Binding ThisList.ListView, Mode=OneWay}">
        <ListView.RowHeight>
          <OnPlatform x:TypeArguments="x:Int32"
                      iOS="60"
                      Android="60"
                      WinPhone="100" />
        </ListView.RowHeight>
        <ListView.ItemTemplate>
          <DataTemplate>
            <ViewCell>
        <StackLayout Orientation="Vertical">
                <Label Text="{Binding IdxName}" TextColor="White" />
                <StackLayout Orientation="Horizontal">
                  <Label Text="     " />
                  <controls:CheckBox DefaultText="Life List"
                                     Checked="{Binding LifeList, Mode=TwoWay}"
                                     TextColor="White"
                                     FontSize="{StaticResource checkBoxFontSize}" />
                  <controls:CheckBox DefaultText="State"
                                     Checked="{Binding SeenInThisState, Mode=TwoWay}"
                                     TextColor="White"
                                     FontSize="{StaticResource checkBoxFontSize}" />
                  <controls:CheckBox DefaultText="This List"
                                     Checked="{Binding SeenThisList, Mode=TwoWay}"
                                     TextColor="White"
                                     FontSize="{StaticResource checkBoxFontSize}" />
                </StackLayout>
              </StackLayout>
            </ViewCell>
          </DataTemplate>
        </ListView.ItemTemplate>
      </ListView>
    </ContentPage>

Thanks,
Dave


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>