Windows phone 7 Windows phone长列表选择器
我有一个长列表选择器,每个列表框项中都包含一个复选框 长列表选择器绑定到包含名称、图像和状态的列表 我想根据字段的状态选中或取消选中复选框 我已经做了很多搜索,我无法实现这一点,请帮助 XAML:Windows phone 7 Windows phone长列表选择器,windows-phone-7,windows-phone-8,longlistselector,Windows Phone 7,Windows Phone 8,Longlistselector,我有一个长列表选择器,每个列表框项中都包含一个复选框 长列表选择器绑定到包含名称、图像和状态的列表 我想根据字段的状态选中或取消选中复选框 我已经做了很多搜索,我无法实现这一点,请帮助 XAML: <phone:LongListSelector x:Name="lstBoxRates" Margin="0,27,-12,0" ItemsSource="{Binding Items}" Height="16776941" SelectionChanged="MainLongListSelec
<phone:LongListSelector x:Name="lstBoxRates" Margin="0,27,-12,0" ItemsSource="{Binding Items}" Height="16776941" SelectionChanged="MainLongListSelector_SelectionChanged">
<phone:LongListSelector.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="0,0,0,17">
<Image Width="54" Height="54">
<Image.Source>
<BitmapImage UriSource="{Binding LocalPath}" />
</Image.Source>
</Image>
<TextBlock Text="{Binding name}" TextWrapping="NoWrap" Style="{StaticResource PhoneTextSubtleStyle}"/>
<CheckBox x:Name="LBCheckBox" Content="{Binding LineOne}" IsChecked="{Binding IsChecked}" Height="75" Width="412" Checked="CheckBox_Checked" Unchecked="CheckBox_Unchecked" />
</StackPanel>
</DataTemplate>
</phone:LongListSelector.ItemTemplate>
</phone:LongListSelector>
C#:
cView=新的CViewModel(AppResources.DBConnectionString);
List ubc=cView.GetAllCars();
lstBoxRates.ItemsSource=ubc;
我尝试了您的代码,在做了以下更改后,代码仍然有效:
分享代码,你的longlistselector xaml和list是怎样的!!完成后,代码也被添加到XAML代码中。我们需要看看装订。
cView = new CViewModel(AppResources.DBConnectionString);
List<UBCars> ubc = cView.GetAllCars();
lstBoxRates.ItemsSource = ubc;