0

各リストボックス項目にチェックボックスを含む長いリストセレクターがあります。

ロングリストセレクターは、画像の名前とステータスを含むリストにバインドされます

フィールドのステータスに応じて、チェックボックスをオンまたはオフにします。

私はたくさんの検索をしました、そして私はこれを達成することができません助けてください。

XAML:

<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 = new CViewModel(AppResources.DBConnectionString);
        List<UBCars> ubc = cView.GetAllCars();

        lstBoxRates.ItemsSource = ubc;
4

1 に答える 1

0

私はあなたのコードを試しましたが、これらの変更を加えた後に動作します:

  1. xaml の ItemsSource バインディングを削除しました。2回設定しても意味がない
  2. モデル (UBCars クラス) では、フィールドではなくプロパティを使用します。
于 2013-02-19T12:50:49.537 に答える